Stay organized with collections
Save and categorize content based on your preferences.
MotionLayout.TransitionListener
public
static
interface
MotionLayout.TransitionListener
android.support.constraint.motion.MotionLayout.TransitionListener
|
Known indirect subclasses
|
Added in 2.0
Listener for monitoring events about TransitionLayout.
Summary
Public methods
onTransitionChange
public 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 |
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
public 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 |
currentId |
int : the id it has reached
|
onTransitionStarted
public 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 |
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
public abstract void onTransitionTrigger (MotionLayout motionLayout,
int triggerId,
boolean positive,
float progress)
Call when a trigger is fired
Parameters |
triggerId |
int : The id set set with triggerID |
positive |
boolean : for positive transition edge |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# MotionLayout.TransitionListener\n\nSummary: [Methods](#pubmethods) \n\nMotionLayout.TransitionListener\n===============================\n\n| This package is part of the Android [support library](/topic/libraries/support-library) which is no longer maintained. The Constraint Layout support library has been superseded by the [AndroidX Constraint\n| Layout library](/reference/androidx/constraintlayout/classes), which is part of [Jetpack](/jetpack). The `MotionLayout.TransitionListener` interface has been superseded by [`androidx.constraintlayout.motion.widget.MotionLayout.TransitionListener`](/reference/androidx/constraintlayout/motion/widget/MotionLayout.TransitionListener). We recommend using the AndroidX libraries in all new projects. You should also consider [migrating](/jetpack/androidx/migrate) existing projects to AndroidX.\n\n\n`\npublic\nstatic\n\n\ninterface\nMotionLayout.TransitionListener\n`\n\n\n`\n\n\n`\n\n|-------------------------------------------------------------------|\n| android.support.constraint.motion.MotionLayout.TransitionListener |\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known indirect subclasses [TransitionAdapter](/reference/android/support/constraint/motion/TransitionAdapter) |-------------------------------------------------------------------------------------|---| | [TransitionAdapter](/reference/android/support/constraint/motion/TransitionAdapter) | | |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n**Added in 2.0**\n\n\nListener for monitoring events about TransitionLayout.\n\n\u003cbr /\u003e\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onTransitionChange](/reference/android/support/constraint/motion/MotionLayout.TransitionListener#onTransitionChange(android.support.constraint.motion.MotionLayout,%20int,%20int,%20float))`(`[MotionLayout](/reference/android/support/constraint/motion/MotionLayout)` motionLayout, int startId, int endId, float progress) ` Called when a drawer's position changes. |\n| ` abstract void` | ` `[onTransitionCompleted](/reference/android/support/constraint/motion/MotionLayout.TransitionListener#onTransitionCompleted(android.support.constraint.motion.MotionLayout,%20int))`(`[MotionLayout](/reference/android/support/constraint/motion/MotionLayout)` motionLayout, int currentId) ` Called when a drawer has settled completely a state. |\n| ` abstract void` | ` `[onTransitionStarted](/reference/android/support/constraint/motion/MotionLayout.TransitionListener#onTransitionStarted(android.support.constraint.motion.MotionLayout,%20int,%20int))`(`[MotionLayout](/reference/android/support/constraint/motion/MotionLayout)` motionLayout, int startId, int endId) ` Called when a drawer is about to start a transition. |\n| ` abstract void` | ` `[onTransitionTrigger](/reference/android/support/constraint/motion/MotionLayout.TransitionListener#onTransitionTrigger(android.support.constraint.motion.MotionLayout,%20int,%20boolean,%20float))`(`[MotionLayout](/reference/android/support/constraint/motion/MotionLayout)` motionLayout, int triggerId, boolean positive, float progress) ` Call when a trigger is fired |\n\nPublic methods\n--------------\n\n### onTransitionChange\n\n```\npublic abstract void onTransitionChange (MotionLayout motionLayout, \n int startId, \n int endId, \n float progress)\n```\n\nCalled when a drawer's position changes.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------------|------------------------------------------------------------------------------------|\n| `motionLayout` | `MotionLayout`: The TransitionLayout view that was moved \u003cbr /\u003e |\n| `startId` | `int`: the id of the start state (or ConstraintSet). Will be -1 if unknown. \u003cbr /\u003e |\n| `endId` | `int`: the id of the end state (or ConstraintSet). \u003cbr /\u003e |\n| `progress` | `float`: The progress on this transition, from 0 to 1. \u003cbr /\u003e |\n\n### onTransitionCompleted\n\n```\npublic abstract void onTransitionCompleted (MotionLayout motionLayout, \n int currentId)\n```\n\nCalled when a drawer has settled completely a state.\nThe TransitionLayout is interactive at this point.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------------|-----------------------------------------------------|\n| `motionLayout` | `MotionLayout`: Drawer view that is now open \u003cbr /\u003e |\n| `currentId` | `int`: the id it has reached \u003cbr /\u003e |\n\n### onTransitionStarted\n\n```\npublic abstract void onTransitionStarted (MotionLayout motionLayout, \n int startId, \n int endId)\n```\n\nCalled when a drawer is about to start a transition.\nNote. startId may be -1 if starting from an \"undefined state\"\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------------|------------------------------------------------------------------------------------|\n| `motionLayout` | `MotionLayout`: The TransitionLayout view that was moved \u003cbr /\u003e |\n| `startId` | `int`: the id of the start state (or ConstraintSet). Will be -1 if unknown. \u003cbr /\u003e |\n| `endId` | `int`: the id of the end state (or ConstraintSet). \u003cbr /\u003e |\n\n### onTransitionTrigger\n\n```\npublic abstract void onTransitionTrigger (MotionLayout motionLayout, \n int triggerId, \n boolean positive, \n float progress)\n```\n\nCall when a trigger is fired\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------|------------------------------------------------|\n| `triggerId` | `int`: The id set set with triggerID \u003cbr /\u003e |\n| `positive` | `boolean`: for positive transition edge \u003cbr /\u003e |"]]