MotionHelperInterface


interface MotionHelperInterface : Animatable, MotionLayout.TransitionListener

Known direct subclasses
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:


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

Summary

Public functions

Boolean

is involved in painting

Boolean

Notify when views are hidden

Boolean

Notify when view is visible

Unit

This is called after motionLayout read motionScene and assembles all constraintSets

Unit
onPostDraw(canvas: Canvas!)

Called after views are painted

Unit
onPreDraw(canvas: Canvas!)

Call before views are painted

Unit
onPreSetup(
    motionLayout: MotionLayout!,
    controllerMap: HashMap<View!, MotionController!>!
)

Called after motionController is populated with start and end and keyframes.

Inherited functions

From androidx.constraintlayout.motion.widget.Animatable
Float

get the progress

Unit
setProgress(progress: Float)

Set the progress

From androidx.constraintlayout.motion.widget.MotionLayout.TransitionListener
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 functions

isDecorator

Added in 2.2.0
fun isDecorator(): Boolean

is involved in painting

Returns
Boolean

isUseOnHide

Added in 2.2.0
fun isUseOnHide(): Boolean

Notify when views are hidden

Returns
Boolean

isUsedOnShow

Added in 2.2.0
fun isUsedOnShow(): Boolean

Notify when view is visible

Returns
Boolean

onFinishedMotionScene

Added in 2.2.0
fun onFinishedMotionScene(motionLayout: MotionLayout!): Unit

This is called after motionLayout read motionScene and assembles all constraintSets

Parameters
motionLayout: MotionLayout!

onPostDraw

Added in 2.2.0
fun onPostDraw(canvas: Canvas!): Unit

Called after views are painted

Parameters
canvas: Canvas!

onPreDraw

Added in 2.2.0
fun onPreDraw(canvas: Canvas!): Unit

Call before views are painted

Parameters
canvas: Canvas!

onPreSetup

Added in 2.2.0
fun onPreSetup(
    motionLayout: MotionLayout!,
    controllerMap: HashMap<View!, MotionController!>!
): Unit

Called after motionController is populated with start and end and keyframes.

Parameters
motionLayout: MotionLayout!
controllerMap: HashMap<View!, MotionController!>!