Stay organized with collections
Save and categorize content based on your preferences.
TransitionAdapter
public
abstract
class
TransitionAdapter
extends Object
implements
MotionLayout.TransitionListener
java.lang.Object
|
↳ |
android.support.constraint.motion.TransitionAdapter
|
Summary
Inherited methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
|
Public constructors
TransitionAdapter
public TransitionAdapter ()
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 |
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 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 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 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,["# TransitionAdapter\n\nSummary: [Ctors](#pubctors) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nTransitionAdapter\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 `TransitionAdapter` class has been superseded by [`androidx.constraintlayout.motion.widget.TransitionAdapter`](/reference/androidx/constraintlayout/motion/widget/TransitionAdapter). 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\n\n\nabstract\nclass\nTransitionAdapter\n`\n\n\n`\n\nextends Object\n\n\n`\n\n`\n\n\nimplements\n\n`[MotionLayout.TransitionListener](/reference/android/support/constraint/motion/MotionLayout.TransitionListener)`\n\n\n`\n\n|---|-----------------------------------------------------|\n| java.lang.Object ||\n| ↳ | android.support.constraint.motion.TransitionAdapter |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nSummary\n-------\n\n| ### Public constructors ||\n|-----------------------------------------------------------------------------------------------------------------|---|\n| ` `[TransitionAdapter](/reference/android/support/constraint/motion/TransitionAdapter#TransitionAdapter())`() ` |\n\n| ### Public methods ||\n|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` void` | ` `[onTransitionChange](/reference/android/support/constraint/motion/TransitionAdapter#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| ` void` | ` `[onTransitionCompleted](/reference/android/support/constraint/motion/TransitionAdapter#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| ` void` | ` `[onTransitionStarted](/reference/android/support/constraint/motion/TransitionAdapter#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| ` void` | ` `[onTransitionTrigger](/reference/android/support/constraint/motion/TransitionAdapter#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\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` java.lang.Object ` |-------------------|-------------------------------| | ` Object` | ` clone() ` | | ` boolean` | ` equals(Object arg0) ` | | ` void` | ` finalize() ` | | ` final Class\u003c?\u003e` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` String` | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||\n| From interface ` `[android.support.constraint.motion.MotionLayout.TransitionListener](/reference/android/support/constraint/motion/MotionLayout.TransitionListener)` ` |------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` 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. | | ` 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. | | ` 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. | | ` 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 constructors\n-------------------\n\n### TransitionAdapter\n\n```\npublic TransitionAdapter ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### onTransitionChange\n\n```\npublic 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 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 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 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 |"]]