MotionHelper
class MotionHelper : ConstraintHelper, MotionHelperInterface
| kotlin.Any | |||
| ↳ | android.view.View | ||
| ↳ | androidx.constraintlayout.widget.ConstraintHelper | ||
| ↳ | androidx.constraintlayout.motion.widget.MotionHelper |
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: |
Summary
Public constructors |
|---|
MotionHelper(context: Context!) |
MotionHelper(context: Context!, attrs: AttributeSet!) |
MotionHelper(context: Context!, attrs: AttributeSet!, defStyleAttr: Int) |
Public functions |
|
|---|---|
Float |
get the progress |
Boolean |
is involved in painting |
Boolean |
|
Boolean |
|
Unit |
onFinishedMotionScene(motionLayout: MotionLayout!)This is called after motionLayout read motionScene and assembles all constraintSets |
Unit |
onPostDraw(canvas: Canvas!)Called after views are painted |
Unit |
Call before views are painted |
Unit |
onPreSetup(Called after motionController is populated with start and end and keyframes. |
Unit |
onTransitionChange(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(Call when a trigger is fired |
Unit |
setProgress(progress: Float)Set the progress |
Unit |
setProgress(view: View!, progress: Float) |
Protected functions |
|
|---|---|
Unit |
init(attrs: AttributeSet!) |
Inherited Constants |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Inherited properties |
|---|
Public constructors
MotionHelper
MotionHelper(context: Context!, attrs: AttributeSet!, defStyleAttr: Int)
Public functions
onFinishedMotionScene
fun onFinishedMotionScene(motionLayout: MotionLayout!): Unit
This is called after motionLayout read motionScene and assembles all constraintSets
| Parameters | |
|---|---|
motionLayout: MotionLayout! |
onPostDraw
fun onPostDraw(canvas: Canvas!): Unit
Called after views are painted
| Parameters | |
|---|---|
canvas: Canvas! |
onPreDraw
fun onPreDraw(canvas: Canvas!): Unit
Call before views are painted
| Parameters | |
|---|---|
canvas: Canvas! |
onPreSetup
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!>! |
onTransitionChange
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
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
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
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 |
setProgress
fun setProgress(progress: Float): Unit
Set the progress
| Parameters | |
|---|---|
progress: Float |