TransitionAdapter
public abstract class TransitionAdapter implements MotionLayout.TransitionListener
Summary
Public constructors |
|---|
Public methods |
|
|---|---|
void |
onTransitionChange(Called when a drawer's position changes. |
void |
onTransitionCompleted(MotionLayout motionLayout, int currentId)Called when a drawer has settled completely a state. |
void |
onTransitionStarted(MotionLayout motionLayout, int startId, int endId)Called when a drawer is about to start a transition. |
void |
onTransitionTrigger(Call when a trigger is fired |
Public constructors
Public methods
onTransitionChange
public void onTransitionChange(
MotionLayout motionLayout,
int startId,
int endId,
float progress
)
Called when a drawer's position changes.
| Parameters | |
|---|---|
MotionLayout motionLayout |
The TransitionLayout view that was moved |
int startId |
the id of the start state (or ConstraintSet). Will be -1 if unknown. |
int endId |
the id of the end state (or ConstraintSet). |
float progress |
The progress on this transition, from 0 to 1. |
onTransitionCompleted
public void onTransitionCompleted(MotionLayout motionLayout, int currentId)
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 |
int currentId |
the id it has reached |
onTransitionStarted
public void onTransitionStarted(MotionLayout motionLayout, int startId, int endId)
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 |
int startId |
the id of the start state (or ConstraintSet). Will be -1 if unknown. |
int endId |
the id of the end state (or ConstraintSet). |
onTransitionTrigger
public void onTransitionTrigger(
MotionLayout motionLayout,
int triggerId,
boolean positive,
float progress
)
Call when a trigger is fired
| Parameters | |
|---|---|
MotionLayout motionLayout |
|
int triggerId |
The id set set with triggerID |
boolean positive |
for positive transition edge |
float progress |