MotionLayout.TransitionListener


public interface MotionLayout.TransitionListener

Known direct subclasses
MotionHelperInterface

This defined the interface for MotionLayout helpers Helpers can be used to draw motion effects or modify motions

TransitionAdapter
Known indirect subclasses
Carousel

Carousel works within a MotionLayout to provide a simple recycler like pattern.

MotionEffect

MotionHelper that automatically inserts keyframes for views moving in a given direction, out of:

MotionHelper

Listener for monitoring events about TransitionLayout. Added in 2.0

Summary

Public methods

abstract void
onTransitionChange(
    MotionLayout motionLayout,
    int startId,
    int endId,
    float progress
)

Called when a drawer's position changes.

abstract void
onTransitionCompleted(MotionLayout motionLayout, int currentId)

Called when a drawer has settled completely a state.

abstract void
onTransitionStarted(MotionLayout motionLayout, int startId, int endId)

Called when a drawer is about to start a transition.

abstract void
onTransitionTrigger(
    MotionLayout motionLayout,
    int triggerId,
    boolean positive,
    float progress
)

Call when a trigger is fired

Public methods

onTransitionChange

Added in 2.2.0-rc01
abstract 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

Added in 2.2.0-rc01
abstract 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

Added in 2.2.0-rc01
abstract 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

Added in 2.2.0-rc01
abstract 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