abstract class TransitionAdapter : MotionLayout.TransitionListener


Summary

Public constructors

Public functions

Unit
onTransitionChange(
    motionLayout: MotionLayout!,
    startId: Int,
    endId: Int,
    progress: Float
)

Called when a drawer's position changes.

Unit
onTransitionCompleted(motionLayout: MotionLayout!, currentId: Int)

Called when a drawer has settled completely a state.

Unit
onTransitionStarted(motionLayout: MotionLayout!, startId: Int, endId: Int)

Called when a drawer is about to start a transition.

Unit
onTransitionTrigger(
    motionLayout: MotionLayout!,
    triggerId: Int,
    positive: Boolean,
    progress: Float
)

Call when a trigger is fired

Public constructors

TransitionAdapter

Added in 2.2.0-alpha13
TransitionAdapter()

Public functions

onTransitionChange

Added in 2.2.0-alpha13
fun onTransitionChange(
    motionLayout: MotionLayout!,
    startId: Int,
    endId: Int,
    progress: Float
): Unit

Called when a drawer's position changes.

Parameters
motionLayout: MotionLayout!

The TransitionLayout view that was moved

startId: Int

the id of the start state (or ConstraintSet). Will be -1 if unknown.

endId: Int

the id of the end state (or ConstraintSet).

progress: Float

The progress on this transition, from 0 to 1.

onTransitionCompleted

Added in 2.2.0-alpha13
fun onTransitionCompleted(motionLayout: MotionLayout!, currentId: Int): Unit

Called when a drawer has settled completely a state. The TransitionLayout is interactive at this point.

Parameters
motionLayout: MotionLayout!

Drawer view that is now open

currentId: Int

the id it has reached

onTransitionStarted

Added in 2.2.0-alpha13
fun onTransitionStarted(motionLayout: MotionLayout!, startId: Int, endId: Int): Unit

Called when a drawer is about to start a transition. Note. startId may be -1 if starting from an "undefined state"

Parameters
motionLayout: MotionLayout!

The TransitionLayout view that was moved

startId: Int

the id of the start state (or ConstraintSet). Will be -1 if unknown.

endId: Int

the id of the end state (or ConstraintSet).

onTransitionTrigger

Added in 2.2.0-alpha13
fun onTransitionTrigger(
    motionLayout: MotionLayout!,
    triggerId: Int,
    positive: Boolean,
    progress: Float
): Unit

Call when a trigger is fired

Parameters
motionLayout: MotionLayout!
triggerId: Int

The id set set with triggerID

positive: Boolean

for positive transition edge

progress: Float