MotionLayout

public class MotionLayout extends ConstraintLayout

Object
   ↳ ConstraintLayout
     ↳ MotionLayout

A subclass of ConstraintLayout that supports animating between various states Added in 2.0

A {@code MotionLayout} is a subclass of ConstraintLayout which supports transitions between between various states (ConstraintSet) defined in MotionScenes.

Note:{@code MotionLayout} is available as a support library that you can use on Android systems starting with API level 14 (ICS).

{@code MotionLayout} links to and requires a MotionScene file. The file contains one top level tag "MotionScene"

LayoutDescription
Tags Description
{@code } Describes states supported by the system (optional)
{@code } Describes a constraint set
{@code } Describes a transition between two states or ConstraintSets
{@code } Describes a transition of a View within a states or ConstraintSets
Transition
Attributes Description
android:id The id of the Transition
constraintSetStart ConstraintSet to be used as the start constraints or a layout file to get the constraint from
constraintSetEnd ConstraintSet to be used as the end constraints or a layout file to get the constraint from
motionInterpolator The ability to set an overall interpolation (easeInOut, linear, etc.)
duration Length of time to take to perform the transition
staggered Overrides the Manhattan distance from the top most view in the list of views.
  • For any view of stagger value {@code S(Vi)}
  • With the transition stagger value of {@code TS} (from 0.0 - 1.0)
  • The duration of the animation is {@code duration}
  • The views animation duration {@code DS = duration * (1 -TS)}
  • Call the stagger fraction {@code SFi = (S(Vi) - S(V0)) / (S(Vn) - S(V0))}
  • The view starts animating at: {@code (duration-DS) * SFi}
pathMotionArc The path will move in arc (quarter ellipses) key words {startVertical | startHorizontal | flip | none }
autoTransition automatically transition from one state to another. key words {none, jumpToStart, jumpToEnd, animateToStart, animateToEnd}
transitionFlags flags that adjust the behaviour of Transitions. supports {none, beginOnFirstDraw} begin on first draw forces the transition's clock to start when it is first displayed not when the begin is called
layoutDuringTransition Configures MotionLayout on how to react to requestLayout calls during transitions. Allowed values are {ignoreRequest, honorRequest}
{@code } Adds support for touch handling (optional)
{@code } Adds support for triggering transition (optional)
{@code } Describes a set of Key object which modify the animation between constraint sets.
  • A transition is typically defined by specifying its start and end ConstraintSets. You also have the possibility to not specify them, in which case such transition will become a Default transition. That Default transition will be applied between any state change that isn't explicitly covered by a transition.
  • The starting state of the MotionLayout is defined to be the constraintSetStart of the first transition.
  • If no transition is specified (or only a default Transition) the MotionLayout tag must contain a app:currentState to define the starting state of the MotionLayout
ViewTransition
Attributes Description
android:id The id of the ViewTransition
viewTransitionMode currentState, allStates, noState transition affect the state of the view in the current constraintSet or all ConstraintSets or non if noState the ViewTransitions are run asynchronous
onStateTransition actionDown or actionUp run transition if on touch down or up if view matches motionTarget
motionInterpolator The ability to set an overall interpolation key words {easeInOut, linear, etc.}
duration Length of time to take to perform the {@code ViewTransition}
pathMotionArc The path will move in arc (quarter ellipses) key words {startVertical | startHorizontal | flip | none }
motionTarget Apply ViewTransition matching this string or id.
setsTag set this tag at end of transition
clearsTag clears this tag at end of transition
ifTagSet run transition if this tag is set on view
ifTagNotSet run transition if this tag is not set on view/td>
{@code } Adds support for touch handling (optional)
{@code } Adds support for triggering transition (optional)
{@code } Describes a set of Key object which modify the animation between constraint sets.
  • A Transition is typically defined by specifying its start and end ConstraintSets. You also have the possibility to not specify them, in which case such transition will become a Default transition. That Default transition will be applied between any state change that isn't explicitly covered by a transition.
  • The starting state of the MotionLayout is defined to be the constraintSetStart of the first transition.
  • If no transition is specified (or only a default Transition) the MotionLayout tag must contain a app:currentState to define the starting state of the MotionLayout
OnSwipe (optional)
Attributes Description
touchAnchorId Have the drag act as if it is moving the "touchAnchorSide" of this object
touchRegionId Limits the region that the touch can be start in to the bounds of this view (even if the view is invisible)
touchAnchorSide The side of the object to move with {top|left|right|bottom}
maxVelocity limit the maximum velocity (in progress/sec) of the animation will on touch up. Default 4
dragDirection which side to swipe from {dragUp|dragDown|dragLeft|dragRight}
maxAcceleration how quickly the animation will accelerate (progress/sec/sec) and decelerate on touch up. Default 1.2
dragScale scale factor to adjust the swipe by. (e.g. 0.5 would require you to move 2x as much)
dragThreshold How much to drag before swipe gesture runs. Important for mult-direction swipe. Default is 10. 1 is very sensitive.
moveWhenScrollAtTop If the swipe is scrolling and View (such as RecyclerView or NestedScrollView) do scroll and transition happen at the same time
onTouchUp Support for various swipe modes autoComplete,autoCompleteToStart,autoCompleteToEnd,stop,decelerate,decelerateAndComplete
OnClick (optional)
Attributes Description
motionTarget What view triggers Transition.
clickAction Direction for buttons to move the animation. Or (|) combination of: toggle, transitionToEnd, transitionToStart, jumpToEnd, jumpToStart
StateSet
defaultState The constraint set or layout to use
{@code } The side of the object to move
State
android:id Id of the State
constraints Id of the ConstraintSet or the Layout file
{@code } a different constraintSet/layout to choose if the with or height matches
Variant
region_widthLessThan Match if width less than
region_widthMoreThan Match if width more than
region_heightLessThan Match if height less than
region_heightMoreThan Match if height more than
constraints Id of the ConstraintSet or layout
ConstraintSet
android:id The id of the ConstraintSet
deriveConstraintsFrom The id of another constraintSet which defines the constraints not define in this set. If not specified the layout defines the undefined constraints.
{@code } A ConstraintLayout Constraints + other attributes associated with a view
Constraint

Constraint supports two forms:

1: All of ConstraintLayout + the ones listed below + {@code }.

Or

2: Combination of tags: {@code . The advantage of using these is that if not present the attributes are taken from the base layout file. This saves from replicating all the layout tags if only a Motion tag is needed. If is used then all layout attributes in the base are ignored.

android:id Id of the View
[ConstraintLayout attributes] Any attribute that is part of ConstraintLayout layout is allowed
[Standard View attributes] A collection of view attributes supported by the system (see below)
transitionEasing define an easing curve to be used when animating from this point (e.g. {@code curve(1.0,0,0,1.0)}) or key words {standard | accelerate | decelerate | linear}
pathMotionArc the path will move in arc (quarter ellipses) or key words {startVertical | startHorizontal | none }
transitionPathRotate (float) rotate object relative to path taken
drawPath draw the path the layout will animate animate
progress call method setProgress(float) on this view (used to talk to nested ConstraintLayouts etc.)
{@code } call a set"name" method via reflection
{@code } Attributes for the ConstraintLayout e.g. layout_constraintTop_toTopOf
{@code } currently only visibility, alpha, motionProgress,layout_constraintTag.
{@code } All the view transform API such as android:rotation.
{@code } Motion Layout control commands such as transitionEasing and pathMotionArc
Layout
[ConstraintLayout attributes] see {@see androidx.constraintlayout.widget.ConstraintLayout ConstraintLayout} for attributes
PropertySet
visibility set the Visibility of the view. One of Visible, invisible or gone
alpha setAlpha value
motionProgress using reflection call setProgress
layout_constraintTag a tagging string to identify the type of object
Transform
android:elevation base z depth of the view.
android:rotation rotation of the view, in degrees.
android:rotationX rotation of the view around the x axis, in degrees.
android:rotationY rotation of the view around the y axis, in degrees.
android:scaleX scale of the view in the x direction
android:scaleY scale of the view in the y direction.
android:translationX translation in x of the view. This value is added post-layout to the left property of the view, which is set by its layout.
android:translationY translation in y of the view. This value is added post-layout to th e top property of the view, which is set by its layout
android:translationZ translation in z of the view. This value is added to its elevation.
Motion
transitionEasing Defines an acceleration curve.
pathMotionArc Says the object should move in a quarter ellipse unless the motion is vertical or horizontal
motionPathRotate set the rotation to the path of the object + this angle.
drawPath Debugging utility to draw the motion of the path
CustomAttribute
attributeName The name of the attribute. Case sensitive. ( MyAttr will look for method setMyAttr(...)
customColorValue The value is a color looking setMyAttr(int )
customIntegerValue The value is an integer looking setMyAttr(int )
customFloatValue The value is a float looking setMyAttr(float )
customStringValue The value is a String looking setMyAttr(String )
customDimension The value is a dimension looking setMyAttr(float )
customBoolean The value is true or false looking setMyAttr(boolean )
KeyFrameSet

This is the container for a collection of Key objects (such as KeyPosition) which provide information about how the views should move

{@code } Controls the layout position during animation
{@code } Controls the post layout properties during animation
{@code } Controls oscillations with respect to position of post layout properties during animation
{@code } Controls oscillations with respect to time of post layout properties during animation
{@code } trigger callbacks into code at fixed point during the animation
KeyPosition
motionTarget Id of the View or a regular expression to match layout_ConstraintTag
framePosition The point along the interpolation 0 = start 100 = end
transitionEasing define an easing curve to be used when animating from this point (e.g. curve(1.0,0,0, 1.0)) or key words {standard | accelerate | decelerate | linear }
pathMotionArc The path will move in arc (quarter ellipses) key words {startVertical | startHorizontal | flip | none }
keyPositionType how this keyframe's deviation for linear path is calculated {deltaRelative | pathRelative|parentRelative}
percentX (float) percent distance from start to end along X axis (deltaRelative) or along the path in pathRelative
percentY (float) Percent distance from start to end along Y axis (deltaRelative) or perpendicular to path in pathRelative
percentWidth (float) Percent of change in the width. Note if the width does not change this has no effect.This overrides sizePercent.
percentHeight (float) Percent of change in the width. Note if the width does not change this has no effect.This overrides sizePercent.
curveFit path is traced
drawPath Draw the path of the objects layout takes useful for debugging
sizePercent If the view changes size this controls how growth of the size. (for fixed size objects use KeyAttributes scaleX/X)
curveFit selects a path based on straight lines or a path based on a monotonic spline {linear|spline}
KeyAttribute
motionTarget Id of the View or a regular expression to match layout_ConstraintTag
framePosition The point along the interpolation 0 = start 100 = end
curveFit selects a path based on straight lines or a path based on a monotonic spline {linear|spline}
transitionEasing Define an easing curve to be used when animating from this point (e.g. curve(1.0,0,0, 1.0)) or key words {standard | accelerate | decelerate | linear }
transitionPathRotate (float) rotate object relative to path taken
drawPath draw the path the layout will animate animate
motionProgress call method setProgress(float) on this view (used to talk to nested ConstraintLayouts etc.)
[standard view attributes](except visibility) A collection of post layout view attributes see below
{@code } call a set"name" method via reflection
CustomAttribute
attributeName The name of the attribute. Case sensitive. ( MyAttr will look for method setMyAttr(...)
customColorValue The value is a color looking setMyAttr(int )
customIntegerValue The value is an integer looking setMyAttr(int )
customFloatValue The value is a float looking setMyAttr(float )
customStringValue The value is a String looking setMyAttr(String )
customDimension The value is a dimension looking setMyAttr(float )
customBoolean The value is true or false looking setMyAttr(boolean )
KeyCycle
motionTarget Id of the View or a regular expression to match layout_ConstraintTag
framePosition The point along the interpolation 0 = start 100 = end
[Standard View attributes] A collection of view attributes supported by the system (see below)
waveShape The shape of the wave to generate {sin|square|triangle|sawtooth|reverseSawtooth|cos|bounce}
wavePeriod The number of cycles to loop near this region
waveOffset offset value added to the attribute
transitionPathRotate Cycles applied to rotation relative to the path the view is travelling
progress call method setProgress(float) on this view (used to talk to nested ConstraintLayouts etc.)
{@code } call a set"name" method via reflection (limited to floats)
CustomAttribute
attributeName The name of the attribute. Case sensitive. ( MyAttr will look for method setMyAttr(...)
customFloatValue The value is a float looking setMyAttr(float )
KeyTimeCycle
motionTarget Id of the View or a regular expression to match layout_ConstraintTag
framePosition The point along the interpolation 0 = start 100 = end
[Standard View attributes] A collection of view attributes supported by the system (see below)
waveShape The shape of the wave to generate {sin|square|triangle|sawtooth|reverseSawtooth|cos|bounce}
wavePeriod The number of cycles per second
waveOffset offset value added to the attribute
transitionPathRotate Cycles applied to rotation relative to the path the view is travelling
progress call method setProgress(float) on this view (used to talk to nested ConstraintLayouts etc.)
{@code } call a set"name" method via reflection (limited to floats)
CustomAttribute
attributeName The name of the attribute. Case sensitive. ( MyAttr will look for method setMyAttr(...)
customFloatValue The value is a float looking setMyAttr(float )
KeyTrigger
motionTarget Id of the View or a regular expression to match layout_ConstraintTag
framePosition The point along the interpolation 0 = start 100 = end
onCross (method name) on crossing this position call this methods on the t arget
onPositiveCross (method name) on forward crossing of the framePosition call this methods on the target
onNegativeCross/td> (method name) backward crossing of the framePosition call this methods on the target
viewTransitionOnCross (ViewTransition Id) start a NoState view transition on crossing or hitting t arget
viewTransitionOnPositiveCross (ViewTransition Id) start a NoState view transition forward crossing of the framePosition or entering target
viewTransitionOnNegativeCross/td> (ViewTransition Id) start a NoState view transition backward crossing of the framePosition or leaving target
triggerSlack (float) do not call trigger again if the framePosition has not moved this fraction away from the trigger point
triggerId (id) call the TransitionListener with this trigger id
motion_postLayoutCollision Define motion pre or post layout. Post layout is more expensive but captures KeyAttributes or KeyCycle motions.
motion_triggerOnCollision (id) Trigger if the motionTarget collides with the other motionTarget
Standard attributes
android:visibility Android view attribute that
android:alpha Android view attribute that
android:elevation base z depth of the view.
android:rotation rotation of the view, in degrees.
android:rotationX rotation of the view around the x axis, in degrees.
android:rotationY rotation of the view around the y axis, in degrees.
android:scaleX scale of the view in the x direction.
android:scaleY scale of the view in the y direction.
android:translationX translation in x of the view.
android:translationY translation in y of the view.
android:translationZ translation in z of the view.

Summary

Nested types

MotionLayout.TransitionListener

Listener for monitoring events about TransitionLayout.

Constants

static final @NonNull int
static final @NonNull int
static final @NonNull int
static final @NonNull int
static final @NonNull int
static final @NonNull int
static final @NonNull int
static final @NonNull int
static final @NonNull int
static final @NonNull int
static final @NonNull int
static final @NonNull int
static final @NonNull int
static final @NonNull int
static final @NonNull int

Public fields

static @NonNull boolean

Public constructors

MotionLayout(
    @NonNull Context context,
    @Nullable AttributeSet attrs,
    @NonNull int defStyleAttr
)

Public methods

@NonNull void

adds a listener to be notified of drawer events.

@NonNull boolean
applyViewTransition(
    @NonNull int viewTransitionId,
    @NonNull MotionController motionController
)

Apply the view transitions keyFrames to the MotionController.

@NonNull ConstraintSet

Creates a ConstraintSet based on an existing constraintSet.

@NonNull void
enableTransition(@NonNull int transitionID, @NonNull boolean enable)
@NonNull void
enableViewTransition(
    @NonNull int viewTransitionId,
    @NonNull boolean enable
)

Enable a ViewTransition ID.

@NonNull void
fireTrigger(
    @NonNull int triggerId,
    @NonNull boolean positive,
    @NonNull float progress
)

This causes the callback onTransitionTrigger to be called

@NonNull ConstraintSet

Get the ConstraintSet associated with an id This returns a link to the constraintset But in most cases can be used.

@NonNull Array<@NonNull int>

Get the id's of all constraintSets used by MotionLayout

@NonNull int

Return the current state id

@NonNull void
getDebugMode(@NonNull boolean showPaths)

This method is deprecated.

will be removed beta 1

@NonNull ArrayList<@NonNull MotionScene.Transition>

Get all Transitions known to the system.

@NonNull DesignTool
@NonNull int

Gets the state you are currently transition to.

@NonNull float

Get current position during an animation.

@NonNull int

Gets the state you are currently transitioning from.

@NonNull float

Gets the position you are animating to typically 0 or 1.

@NonNull MotionScene.Transition

This returns the internal Transition Structure

@NonNull Bundle
@NonNull long

Gets the time of the currently set animation.

@NonNull float

Returns the last velocity used in the transition

@NonNull void
getViewVelocity(
    @NonNull View view,
    @NonNull float posOnViewX,
    @NonNull float posOnViewY,
    @NonNull Array<@NonNull float> returnVelocity,
    @NonNull int type
)

Returns the last layout velocity used in the transition

@Override @NonNull boolean

Returns true if the provided view is currently attached to a window.

@NonNull boolean

Is initial state changes are applied during onAttachedToWindow or after.

@NonNull boolean
@NonNull boolean

Determines whether MotionLayout's touch & click handling are enabled.

@NonNull boolean
isViewTransitionEnabled(@NonNull int viewTransitionId)

Is transition id enabled or disabled

@NonNull void

This jumps to a state It will be at that state after one repaint cycle If the current transition contains that state.

@Override @NonNull void
loadLayoutDescription(@NonNull int motionScene)

This overrides ConstraintLayout and only accepts a MotionScene.

@Override @NonNull boolean

Intercepts the touch event to correctly handle touch region id handover

@Override @NonNull boolean
onNestedFling(
    @NonNull View target,
    @NonNull float velocityX,
    @NonNull float velocityY,
    @NonNull boolean consumed
)
@Override @NonNull boolean
onNestedPreFling(
    @NonNull View target,
    @NonNull float velocityX,
    @NonNull float velocityY
)
@Override @NonNull void
onNestedPreScroll(
    @NonNull View target,
    @NonNull int dx,
    @NonNull int dy,
    @NonNull Array<@NonNull int> consumed,
    @NonNull int type
)
@Override @NonNull void
onNestedScroll(
    @NonNull View target,
    @NonNull int dxConsumed,
    @NonNull int dyConsumed,
    @NonNull int dxUnconsumed,
    @NonNull int dyUnconsumed,
    @NonNull int type,
    @NonNull Array<@NonNull int> consumed
)
@Override @NonNull void
onNestedScroll(
    @NonNull View target,
    @NonNull int dxConsumed,
    @NonNull int dyConsumed,
    @NonNull int dxUnconsumed,
    @NonNull int dyUnconsumed,
    @NonNull int type
)
@Override @NonNull void
onNestedScrollAccepted(
    @NonNull View child,
    @NonNull View target,
    @NonNull int axes,
    @NonNull int type
)
@Override @NonNull void
onRtlPropertiesChanged(@NonNull int layoutDirection)
@Override @NonNull boolean
onStartNestedScroll(
    @NonNull View child,
    @NonNull View target,
    @NonNull int axes,
    @NonNull int type
)
@Override @NonNull void
onStopNestedScroll(@NonNull View target, @NonNull int type)
@Override @NonNull boolean
@Override @NonNull void
@Override @NonNull void
@NonNull void

This method is deprecated.

Please call rebuildScene() instead.

@NonNull void

rebuild the motion Layouts

@NonNull boolean

adds a listener to be notified of drawer events.

@Override @NonNull void
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1) @NonNull void
rotateTo(@NonNull int id, @NonNull int duration)
@NonNull void

on completing the current transition, transition to this state.

@NonNull void
setDebugMode(@NonNull int debugMode)

Display the debugging information such as paths information

@NonNull void

Initial state changes are applied during onAttachedToWindow unless this is set to true.

@NonNull void
setInteractionEnabled(@NonNull boolean enabled)

Enables (or disables) MotionLayout's onClick and onSwipe handling.

@NonNull void

Set the transition position between 0 an 1

@NonNull void
setOnHide(@NonNull float progress)
@NonNull void
setOnShow(@NonNull float progress)
@NonNull void
setProgress(@NonNull float pos, @NonNull float velocity)

Set the transition position between 0 an 1

@NonNull void
setProgress(@NonNull float pos)

Set the transition position between 0 an 1

@NonNull void

Sets a motion scene to the layout.

@Override @NonNull void
setState(@NonNull int id, @NonNull int screenWidth, @NonNull int screenHeight)

Set the State of the Constraint layout.

@NonNull void
setTransition(@NonNull int beginId, @NonNull int endId)

Set a transition explicitly between two constraint sets

@NonNull void
setTransition(@NonNull int transitionId)

Set a transition explicitly to a Transition that has an ID The transition must have been named with android:id=...

@NonNull void
setTransitionDuration(@NonNull int milliseconds)

Change the current Transition duration.

@NonNull void

Set a listener to be notified of drawer events.

@NonNull void
@Override @NonNull String
@NonNull void
touchAnimateTo(
    @NonNull int touchUpMode,
    @NonNull float position,
    @NonNull float currentVelocity
)
@NonNull void
touchSpringTo(@NonNull float position, @NonNull float currentVelocity)

Allows you to use trigger spring motion touch behaviour.

@NonNull void

Animate to the ending position of the current transition.

@NonNull void

Animate to the ending position of the current transition.

@NonNull void

Animate to the starting position of the current transition.

@NonNull void

Animate to the state defined by the id.

@NonNull void
transitionToState(@NonNull int id, @NonNull int duration)

Animate to the state defined by the id.

@NonNull void
transitionToState(
    @NonNull int id,
    @NonNull int screenWidth,
    @NonNull int screenHeight
)

Animate to the state defined by the id.

@NonNull void
transitionToState(
    @NonNull int id,
    @NonNull int screenWidth,
    @NonNull int screenHeight,
    @NonNull int duration
)

Animate to the state defined by the id.

@NonNull void
updateState(@NonNull int stateId, @NonNull ConstraintSet set)

update a ConstraintSet under the id.

@NonNull void

Not sure we want this

@NonNull void
updateStateAnimate(
    @NonNull int stateId,
    @NonNull ConstraintSet set,
    @NonNull int duration
)

Update a ConstraintSet but animate the change.

@NonNull void
viewTransition(
    @NonNull int viewTransitionId,
    @NonNull Array<@NonNull View> view
)

Execute a ViewTransition.

Inherited methods

From class ConstraintLayout
@NonNull void
@Override @NonNull void
@Override @NonNull ConstraintLayout.LayoutParams
@NonNull Object
@NonNull int

The maximum height of this view.

@NonNull int
@NonNull int

The minimum height of this view.

@NonNull int

The minimum width of this view.

@NonNull int

Return the current optimization level for the layout resolution

static @NonNull SharedValues

Returns the SharedValues instance, creating it if it doesn't exist.

@NonNull View
final @NonNull ConstraintWidget
@NonNull void

Sets a ConstraintSet object to manage constraints.

@NonNull void
setDesignInformation(
    @NonNull int type,
    @NonNull Object value1,
    @NonNull Object value2
)
@Override @NonNull void
setId(@NonNull int id)
@NonNull void
setMaxHeight(@NonNull int value)

Set the max height for this view

@NonNull void
setMaxWidth(@NonNull int value)

Set the max width for this view

@NonNull void
setMinHeight(@NonNull int value)

Set the min height for this view

@NonNull void
setMinWidth(@NonNull int value)

Set the min width for this view

@NonNull void
setOnConstraintsChanged(
    @NonNull ConstraintsChangedListener constraintsChangedListener
)
@NonNull void

Set the optimization for the layout resolution.

@Override @NonNull boolean
From class View
@NonNull void
@NonNull void
@NonNull void
@NonNull ViewPropertyAnimator
@NonNull void
@NonNull void
@NonNull void
@NonNull void

This method is deprecated.

@NonNull void
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
canScrollVertically(@NonNull int direction)
final @NonNull void
@NonNull void
final @NonNull void
@NonNull boolean
@NonNull void
static @NonNull int
combineMeasuredStates(@NonNull int curState, @NonNull int newState)
@NonNull void
@NonNull WindowInsets
computeSystemWindowInsets(
    @NonNull WindowInsets in,
    @NonNull Rect outLocalInsets
)
@NonNull AccessibilityNodeInfo
@NonNull void
@NonNull void

This method is deprecated.

@NonNull boolean
@NonNull boolean
dispatchNestedFling(
    @NonNull float velocityX,
    @NonNull float velocityY,
    @NonNull boolean consumed
)
@NonNull boolean
dispatchNestedPreFling(@NonNull float velocityX, @NonNull float velocityY)
@NonNull boolean
dispatchNestedPrePerformAccessibilityAction(
    @NonNull int action,
    @NonNull Bundle arguments
)
@NonNull boolean
dispatchNestedPreScroll(
    @NonNull int dx,
    @NonNull int dy,
    @NonNull Array<@NonNull int> consumed,
    @NonNull Array<@NonNull int> offsetInWindow
)
@NonNull boolean
dispatchNestedScroll(
    @NonNull int dxConsumed,
    @NonNull int dyConsumed,
    @NonNull int dxUnconsumed,
    @NonNull int dyUnconsumed,
    @NonNull Array<@NonNull int> offsetInWindow
)
@NonNull boolean
@NonNull void
draw(@NonNull Canvas canvas)
@NonNull void
drawableHotspotChanged(@NonNull float x, @NonNull float y)
final @NonNull T
<T extends View> findViewById(@NonNull int id)
final @NonNull T
<T extends View> findViewWithTag(@NonNull Object tag)
@NonNull void
forceHasOverlappingRendering(@NonNull boolean hasOverlappingRendering)
@NonNull void
static @NonNull int
@NonNull View.AccessibilityDelegate
@NonNull int
@NonNull AccessibilityNodeProvider
@NonNull CharSequence
@NonNull int
@NonNull int
@NonNull float
@NonNull Animation
@NonNull Matrix
@NonNull IBinder
@NonNull Array<@NonNull int>
@NonNull Map<@NonNull Integer, @NonNull Integer>
@NonNull Array<@NonNull String>
final @NonNull AutofillId
@NonNull int
@NonNull AutofillValue
@NonNull Drawable
@NonNull BlendMode
@NonNull ColorStateList
@NonNull PorterDuff.Mode
@NonNull int
final @NonNull int
@NonNull float
@NonNull Rect
@NonNull boolean
final @NonNull boolean
final @NonNull ContentCaptureSession
@NonNull CharSequence
final @NonNull Context
final @NonNull boolean
static @NonNull int
getDefaultSize(@NonNull int size, @NonNull int measureSpec)
@NonNull Display
final @NonNull Array<@NonNull int>
@NonNull Bitmap

This method is deprecated.

@NonNull int

This method is deprecated.

@NonNull int

This method is deprecated.

@NonNull void
@NonNull long
@NonNull float
@NonNull int
@NonNull boolean
@NonNull boolean
@NonNull int
@NonNull ArrayList<@NonNull View>
getFocusables(@NonNull int direction)
@NonNull void
@NonNull Drawable
@NonNull int
@NonNull BlendMode
@NonNull ColorStateList
@NonNull PorterDuff.Mode
@NonNull boolean
@NonNull Handler
final @NonNull boolean
final @NonNull int
@NonNull void
@NonNull int
@NonNull Drawable
@NonNull Drawable
@NonNull int
@NonNull int
@NonNull int
@NonNull int
@NonNull boolean
@NonNull KeyEvent.DispatcherState
@NonNull int
@NonNull int
@NonNull int
@NonNull ViewGroup.LayoutParams
final @NonNull int
final @NonNull boolean
@NonNull void
@NonNull void
@NonNull void
@NonNull Matrix
final @NonNull int
final @NonNull int
final @NonNull int
final @NonNull int
final @NonNull int
@NonNull int
@NonNull int
@NonNull int
@NonNull int
@NonNull int
@NonNull int
@NonNull int
@NonNull int
@NonNull View.OnFocusChangeListener
@NonNull int
@NonNull ViewOutlineProvider
@NonNull int
@NonNull int
@NonNull ViewOverlay
@NonNull int
@NonNull int
@NonNull int
@NonNull int
@NonNull int
@NonNull int
final @NonNull ViewParent
@NonNull ViewParent
@NonNull float
@NonNull float
@NonNull PointerIcon
@NonNull Resources
final @NonNull boolean
final @NonNull int
@NonNull View
@NonNull WindowInsets
@NonNull float
@NonNull float
@NonNull float
@NonNull float
@NonNull float
@NonNull int
@NonNull int
@NonNull int
@NonNull int
@NonNull int
final @NonNull int
final @NonNull int
@NonNull int
@NonNull int
final @NonNull CharSequence
@NonNull StateListAnimator
@NonNull List<@NonNull Rect>
@NonNull int

This method is deprecated.

@NonNull Object
@NonNull int
@NonNull int
@NonNull CharSequence
final @NonNull int
@NonNull TouchDelegate
@NonNull ArrayList<@NonNull View>
@NonNull float
@NonNull String
@NonNull float
@NonNull float
@NonNull float
@NonNull long
@NonNull int
@NonNull int
@NonNull Drawable
@NonNull Drawable
@NonNull int
@NonNull ViewTreeObserver
@NonNull int
final @NonNull int
@NonNull WindowId
@NonNull WindowInsetsController
@NonNull int

This method is deprecated.

@NonNull IBinder
@NonNull int
@NonNull void
@NonNull float
@NonNull float
@NonNull float
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
static @NonNull View
inflate(
    @NonNull Context context,
    @NonNull int resource,
    @NonNull ViewGroup root
)
@NonNull void

This method is deprecated.

@NonNull void
@NonNull void
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean

This method is deprecated.

@NonNull boolean
@NonNull boolean
final @NonNull boolean
final @NonNull boolean
@NonNull boolean
final @NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
final @NonNull boolean
final @NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
final @NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
final @NonNull boolean
@NonNull boolean
@NonNull boolean
final @NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull View
keyboardNavigationClusterSearch(
    @NonNull View currentCluster,
    @NonNull int direction
)
final @NonNull void
measure(@NonNull int widthMeasureSpec, @NonNull int heightMeasureSpec)
@NonNull void
@NonNull void
@NonNull WindowInsets
@NonNull void
@NonNull boolean
@NonNull boolean
@NonNull InputConnection
@NonNull boolean
@NonNull void
@NonNull boolean
@NonNull void
@NonNull boolean
@NonNull void
onHoverChanged(@NonNull boolean hovered)
@NonNull boolean
@NonNull void
@NonNull void
@NonNull boolean
onKeyDown(@NonNull int keyCode, @NonNull KeyEvent event)
@NonNull boolean
onKeyLongPress(@NonNull int keyCode, @NonNull KeyEvent event)
@NonNull boolean
onKeyMultiple(
    @NonNull int keyCode,
    @NonNull int repeatCount,
    @NonNull KeyEvent event
)
@NonNull boolean
onKeyPreIme(@NonNull int keyCode, @NonNull KeyEvent event)
@NonNull boolean
onKeyShortcut(@NonNull int keyCode, @NonNull KeyEvent event)
@NonNull boolean
onKeyUp(@NonNull int keyCode, @NonNull KeyEvent event)
@NonNull void
onPointerCaptureChange(@NonNull boolean hasCapture)
@NonNull void
@NonNull void
onProvideAutofillStructure(
    @NonNull ViewStructure structure,
    @NonNull int flags
)
@NonNull void
onProvideAutofillVirtualStructure(
    @NonNull ViewStructure structure,
    @NonNull int flags
)
@NonNull void
onProvideContentCaptureStructure(
    @NonNull ViewStructure structure,
    @NonNull int flags
)
@NonNull void
@NonNull void
@NonNull void
onScreenStateChanged(@NonNull int screenState)
@NonNull void
@NonNull boolean
@NonNull void
onVisibilityAggregated(@NonNull boolean isVisible)
@NonNull void
onWindowFocusChanged(@NonNull boolean hasWindowFocus)
@NonNull void

This method is deprecated.

@NonNull boolean
performAccessibilityAction(@NonNull int action, @NonNull Bundle arguments)
@NonNull boolean
@NonNull boolean
performContextClick(@NonNull float x, @NonNull float y)
@NonNull boolean
performHapticFeedback(@NonNull int feedbackConstant)
@NonNull boolean
@NonNull void
playSoundEffect(@NonNull int soundConstant)
@NonNull boolean
@NonNull boolean
postDelayed(@NonNull Runnable action, @NonNull long delayMillis)
@NonNull void
@NonNull void
postInvalidateDelayed(@NonNull long delayMilliseconds)
@NonNull void
@NonNull void
@NonNull void
postOnAnimationDelayed(@NonNull Runnable action, @NonNull long delayMillis)
@NonNull void
@NonNull void
@NonNull boolean
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void

This method is deprecated.

final @NonNull boolean
@NonNull void
@NonNull void
@NonNull boolean
final @NonNull void
final @NonNull T
<T extends View> requireViewById(@NonNull int id)
@NonNull void
static @NonNull int
resolveSize(@NonNull int size, @NonNull int measureSpec)
static @NonNull int
resolveSizeAndState(
    @NonNull int size,
    @NonNull int measureSpec,
    @NonNull int childMeasuredState
)
@NonNull void
final @NonNull void
saveAttributeDataForStyleable(
    @NonNull Context context,
    @NonNull Array<@NonNull int> styleable,
    @NonNull AttributeSet attrs,
    @NonNull TypedArray t,
    @NonNull int defStyleAttr,
    @NonNull int defStyleRes
)
@NonNull void
@NonNull void
scheduleDrawable(
    @NonNull Drawable who,
    @NonNull Runnable what,
    @NonNull long when
)
@NonNull void
scrollBy(@NonNull int x, @NonNull int y)
@NonNull void
scrollTo(@NonNull int x, @NonNull int y)
@NonNull void
@NonNull void
@NonNull void
@NonNull void
setAccessibilityHeading(@NonNull boolean isHeading)
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
setActivated(@NonNull boolean activated)
@NonNull void
setAlpha(@NonNull float alpha)
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void

This method is deprecated.

@NonNull void
@NonNull void
@NonNull void
@NonNull void
final @NonNull void
setBottom(@NonNull int bottom)
@NonNull void
setCameraDistance(@NonNull float distance)
@NonNull void
setClickable(@NonNull boolean clickable)
@NonNull void
setClipBounds(@NonNull Rect clipBounds)
@NonNull void
setClipToOutline(@NonNull boolean clipToOutline)
@NonNull void
setContentCaptureSession(
    @NonNull ContentCaptureSession contentCaptureSession
)
@NonNull void
@NonNull void
setContextClickable(@NonNull boolean contextClickable)
@NonNull void
setDefaultFocusHighlightEnabled(
    @NonNull boolean defaultFocusHighlightEnabled
)
@NonNull void

This method is deprecated.

@NonNull void
setDrawingCacheEnabled(@NonNull boolean enabled)

This method is deprecated.

@NonNull void

This method is deprecated.

@NonNull void
@NonNull void
setElevation(@NonNull float elevation)
@NonNull void
setEnabled(@NonNull boolean enabled)
@NonNull void
@NonNull void
@NonNull void
setFitsSystemWindows(@NonNull boolean fitSystemWindows)
@NonNull void
setFocusable(@NonNull boolean focusable)
@NonNull void
setFocusableInTouchMode(@NonNull boolean focusableInTouchMode)
@NonNull void
setFocusedByDefault(@NonNull boolean isFocusedByDefault)
@NonNull void
setForceDarkAllowed(@NonNull boolean allow)
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
setHapticFeedbackEnabled(@NonNull boolean hapticFeedbackEnabled)
@NonNull void
setHasTransientState(@NonNull boolean hasTransientState)
@NonNull void
setHorizontalFadingEdgeEnabled(
    @NonNull boolean horizontalFadingEdgeEnabled
)
@NonNull void
setHorizontalScrollBarEnabled(
    @NonNull boolean horizontalScrollBarEnabled
)
@NonNull void
@NonNull void
@NonNull void
setHovered(@NonNull boolean hovered)
@NonNull void
setId(@NonNull int id)
@NonNull void
@NonNull void
@NonNull void
@NonNull void
setKeepScreenOn(@NonNull boolean keepScreenOn)
@NonNull void
@NonNull void
@NonNull void
@NonNull void
setLayerType(@NonNull int layerType, @NonNull Paint paint)
@NonNull void
setLayoutDirection(@NonNull int layoutDirection)
@NonNull void
final @NonNull void
setLeft(@NonNull int left)
final @NonNull void
setLeftTopRightBottom(
    @NonNull int left,
    @NonNull int top,
    @NonNull int right,
    @NonNull int bottom
)
@NonNull void
setLongClickable(@NonNull boolean longClickable)
@NonNull void
setMinimumHeight(@NonNull int minHeight)
@NonNull void
setMinimumWidth(@NonNull int minWidth)
@NonNull void
@NonNull void
setNextClusterForwardId(@NonNull int nextClusterForwardId)
@NonNull void
setNextFocusDownId(@NonNull int nextFocusDownId)
@NonNull void
setNextFocusForwardId(@NonNull int nextFocusForwardId)
@NonNull void
setNextFocusLeftId(@NonNull int nextFocusLeftId)
@NonNull void
setNextFocusRightId(@NonNull int nextFocusRightId)
@NonNull void
setNextFocusUpId(@NonNull int nextFocusUpId)
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void

This method is deprecated.

@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
setOverScrollMode(@NonNull int overScrollMode)
@NonNull void
setPadding(
    @NonNull int left,
    @NonNull int top,
    @NonNull int right,
    @NonNull int bottom
)
@NonNull void
setPaddingRelative(
    @NonNull int start,
    @NonNull int top,
    @NonNull int end,
    @NonNull int bottom
)
@NonNull void
setPivotX(@NonNull float pivotX)
@NonNull void
setPivotY(@NonNull float pivotY)
@NonNull void
@NonNull void
setPressed(@NonNull boolean pressed)
final @NonNull void
setRevealOnFocusHint(@NonNull boolean revealOnFocus)
final @NonNull void
setRight(@NonNull int right)
@NonNull void
setRotation(@NonNull float rotation)
@NonNull void
setRotationX(@NonNull float rotationX)
@NonNull void
setRotationY(@NonNull float rotationY)
@NonNull void
setSaveEnabled(@NonNull boolean enabled)
@NonNull void
@NonNull void
setScaleX(@NonNull float scaleX)
@NonNull void
setScaleY(@NonNull float scaleY)
@NonNull void
setScreenReaderFocusable(@NonNull boolean screenReaderFocusable)
@NonNull void
setScrollBarDefaultDelayBeforeFade(
    @NonNull int scrollBarDefaultDelayBeforeFade
)
@NonNull void
setScrollBarFadeDuration(@NonNull int scrollBarFadeDuration)
@NonNull void
setScrollBarSize(@NonNull int scrollBarSize)
@NonNull void
@NonNull void
setScrollContainer(@NonNull boolean isScrollContainer)
@NonNull void
setScrollIndicators(@NonNull int indicators)
@NonNull void
setScrollX(@NonNull int value)
@NonNull void
setScrollY(@NonNull int value)
@NonNull void
setScrollbarFadingEnabled(@NonNull boolean fadeScrollbars)
@NonNull void
setSelected(@NonNull boolean selected)
@NonNull void
setSoundEffectsEnabled(@NonNull boolean soundEffectsEnabled)
@NonNull void
@NonNull void
@NonNull void
@NonNull void
setSystemUiVisibility(@NonNull int visibility)

This method is deprecated.

@NonNull void
@NonNull void
setTextAlignment(@NonNull int textAlignment)
@NonNull void
setTextDirection(@NonNull int textDirection)
@NonNull void
final @NonNull void
setTop(@NonNull int top)
@NonNull void
@NonNull void
final @NonNull void
setTransitionName(@NonNull String transitionName)
@NonNull void
@NonNull void
setTranslationX(@NonNull float translationX)
@NonNull void
setTranslationY(@NonNull float translationY)
@NonNull void
setTranslationZ(@NonNull float translationZ)
@NonNull void
setVerticalFadingEdgeEnabled(@NonNull boolean verticalFadingEdgeEnabled)
@NonNull void
setVerticalScrollBarEnabled(@NonNull boolean verticalScrollBarEnabled)
@NonNull void
@NonNull void
@NonNull void
@NonNull void
setVisibility(@NonNull int visibility)
@NonNull void
setWillNotCacheDrawing(@NonNull boolean willNotCacheDrawing)

This method is deprecated.

@NonNull void
setWillNotDraw(@NonNull boolean willNotDraw)
@NonNull void
setX(@NonNull float x)
@NonNull void
setY(@NonNull float y)
@NonNull void
setZ(@NonNull float z)
@NonNull boolean
@NonNull ActionMode
@NonNull void
final @NonNull boolean
startDrag(
    @NonNull ClipData data,
    @NonNull View.DragShadowBuilder shadowBuilder,
    @NonNull Object myLocalState,
    @NonNull int flags
)

This method is deprecated.

final @NonNull boolean
startDragAndDrop(
    @NonNull ClipData data,
    @NonNull View.DragShadowBuilder shadowBuilder,
    @NonNull Object myLocalState,
    @NonNull int flags
)
@NonNull boolean
@NonNull void
@NonNull void
@NonNull void
@NonNull void
final @NonNull void
@NonNull boolean

This method is deprecated.

@NonNull boolean
From class ViewGroup
@NonNull void
@NonNull void
addExtraDataToAccessibilityNodeInfo(
    @NonNull AccessibilityNodeInfo info,
    @NonNull String extraDataKey,
    @NonNull Bundle arguments
)
@NonNull void
addFocusables(
    @NonNull ArrayList<@NonNull View> views,
    @NonNull int direction,
    @NonNull int focusableMode
)
@NonNull void
addKeyboardNavigationClusters(
    @NonNull Collection<@NonNull View> views,
    @NonNull int direction
)
@NonNull boolean
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
childHasTransientStateChanged(
    @NonNull View child,
    @NonNull boolean childHasTransientState
)
@NonNull void
@NonNull void
@NonNull void
@NonNull WindowInsets
@NonNull boolean
@NonNull void
@NonNull void
@NonNull boolean
@NonNull void
@NonNull void
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull void
@NonNull void
dispatchProvideAutofillStructure(
    @NonNull ViewStructure structure,
    @NonNull int flags
)
@NonNull void
@NonNull void
dispatchSetActivated(@NonNull boolean activated)
@NonNull void
dispatchSetSelected(@NonNull boolean selected)
@NonNull void
@NonNull void

This method is deprecated.

@NonNull boolean
@NonNull boolean
@NonNull boolean
dispatchUnhandledMove(@NonNull View focused, @NonNull int direction)
@NonNull void
@NonNull void
@NonNull void
@NonNull WindowInsets
@NonNull WindowInsetsAnimation.Bounds
@NonNull void

This method is deprecated.

@NonNull void
@NonNull void
@NonNull View
@NonNull void
findViewsWithText(
    @NonNull ArrayList<@NonNull View> outViews,
    @NonNull CharSequence text,
    @NonNull int flags
)
@NonNull View
focusSearch(@NonNull View focused, @NonNull int direction)
@NonNull void
@NonNull boolean
@NonNull ViewGroup.LayoutParams
@NonNull CharSequence
@NonNull View
getChildAt(@NonNull int index)
@NonNull int
static @NonNull int
getChildMeasureSpec(
    @NonNull int spec,
    @NonNull int padding,
    @NonNull int childDimension
)
@NonNull boolean
getChildVisibleRect(
    @NonNull View child,
    @NonNull Rect r,
    @NonNull Point offset
)
@NonNull boolean
@NonNull boolean
@NonNull int
@NonNull View
@NonNull LayoutAnimationController
@NonNull Animation.AnimationListener
@NonNull int
@NonNull LayoutTransition
@NonNull int
@NonNull ViewGroupOverlay
@NonNull int

This method is deprecated.

@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull int
final @NonNull void

This method is deprecated.

@NonNull ViewParent
invalidateChildInParent(
    @NonNull Array<@NonNull int> location,
    @NonNull Rect dirty
)

This method is deprecated.

@NonNull boolean

This method is deprecated.

@NonNull boolean

This method is deprecated.

@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull void
final @NonNull void
layout(@NonNull int l, @NonNull int t, @NonNull int r, @NonNull int b)
@NonNull void
notifySubtreeAccessibilityStateChanged(
    @NonNull View child,
    @NonNull View source,
    @NonNull int changeType
)
final @NonNull void
offsetDescendantRectToMyCoords(
    @NonNull View descendant,
    @NonNull Rect rect
)
final @NonNull void
offsetRectIntoDescendantCoords(
    @NonNull View descendant,
    @NonNull Rect rect
)
@NonNull void
@NonNull boolean
@NonNull boolean
onNestedPrePerformAccessibilityAction(
    @NonNull View target,
    @NonNull int action,
    @NonNull Bundle args
)
@NonNull void
onNestedPreScroll(
    @NonNull View target,
    @NonNull int dx,
    @NonNull int dy,
    @NonNull Array<@NonNull int> consumed
)
@NonNull void
onNestedScroll(
    @NonNull View target,
    @NonNull int dxConsumed,
    @NonNull int dyConsumed,
    @NonNull int dxUnconsumed,
    @NonNull int dyUnconsumed
)
@NonNull void
onNestedScrollAccepted(
    @NonNull View child,
    @NonNull View target,
    @NonNull int axes
)
@NonNull boolean
@NonNull PointerIcon
onResolvePointerIcon(@NonNull MotionEvent event, @NonNull int pointerIndex)
@NonNull boolean
onStartNestedScroll(
    @NonNull View child,
    @NonNull View target,
    @NonNull int nestedScrollAxes
)
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
removeViewAt(@NonNull int index)
@NonNull void
@NonNull void
removeViews(@NonNull int start, @NonNull int count)
@NonNull void
removeViewsInLayout(@NonNull int start, @NonNull int count)
@NonNull void
@NonNull boolean
requestChildRectangleOnScreen(
    @NonNull View child,
    @NonNull Rect rectangle,
    @NonNull boolean immediate
)
@NonNull void
requestDisallowInterceptTouchEvent(@NonNull boolean disallowIntercept)
@NonNull boolean
requestFocus(@NonNull int direction, @NonNull Rect previouslyFocusedRect)
@NonNull boolean
@NonNull void
@NonNull boolean
@NonNull void
@NonNull void
setAddStatesFromChildren(@NonNull boolean addsStates)
@NonNull void

This method is deprecated.

@NonNull void

This method is deprecated.

@NonNull void
setClipChildren(@NonNull boolean clipChildren)
@NonNull void
setClipToPadding(@NonNull boolean clipToPadding)
@NonNull void
@NonNull void
@NonNull void
@NonNull void
setLayoutMode(@NonNull int layoutMode)
@NonNull void
@NonNull void
@NonNull void
@NonNull void
setPersistentDrawingCache(@NonNull int drawingCacheToKeep)

This method is deprecated.

@NonNull void
setTouchscreenBlocksFocus(@NonNull boolean touchscreenBlocksFocus)
@NonNull void
setTransitionGroup(@NonNull boolean isTransitionGroup)
@NonNull void
@NonNull boolean
@NonNull boolean
@NonNull ActionMode
startActionModeForChild(
    @NonNull View originalView,
    @NonNull ActionMode.Callback callback
)
@NonNull void
@NonNull void
@NonNull void
suppressLayout(@NonNull boolean suppress)
@NonNull void

Constants

DEBUG_SHOW_NONE

@NonNull
public static final @NonNull int DEBUG_SHOW_NONE

DEBUG_SHOW_PATH

@NonNull
public static final @NonNull int DEBUG_SHOW_PATH

DEBUG_SHOW_PROGRESS

@NonNull
public static final @NonNull int DEBUG_SHOW_PROGRESS

TOUCH_UP_COMPLETE

@NonNull
public static final @NonNull int TOUCH_UP_COMPLETE

TOUCH_UP_COMPLETE_TO_END

@NonNull
public static final @NonNull int TOUCH_UP_COMPLETE_TO_END

TOUCH_UP_COMPLETE_TO_START

@NonNull
public static final @NonNull int TOUCH_UP_COMPLETE_TO_START

TOUCH_UP_DECELERATE

@NonNull
public static final @NonNull int TOUCH_UP_DECELERATE

TOUCH_UP_DECELERATE_AND_COMPLETE

@NonNull
public static final @NonNull int TOUCH_UP_DECELERATE_AND_COMPLETE

TOUCH_UP_NEVER_TO_END

@NonNull
public static final @NonNull int TOUCH_UP_NEVER_TO_END

TOUCH_UP_NEVER_TO_START

@NonNull
public static final @NonNull int TOUCH_UP_NEVER_TO_START

TOUCH_UP_STOP

@NonNull
public static final @NonNull int TOUCH_UP_STOP

VELOCITY_LAYOUT

@NonNull
public static final @NonNull int VELOCITY_LAYOUT

VELOCITY_POST_LAYOUT

@NonNull
public static final @NonNull int VELOCITY_POST_LAYOUT

VELOCITY_STATIC_LAYOUT

@NonNull
public static final @NonNull int VELOCITY_STATIC_LAYOUT

VELOCITY_STATIC_POST_LAYOUT

@NonNull
public static final @NonNull int VELOCITY_STATIC_POST_LAYOUT

Public fields

IS_IN_EDIT_MODE

@NonNull
public static @NonNull boolean IS_IN_EDIT_MODE

Public constructors

MotionLayout

public MotionLayout(@NonNull Context context)

MotionLayout

public MotionLayout(@NonNull Context context, @Nullable AttributeSet attrs)

MotionLayout

public MotionLayout(
    @NonNull Context context,
    @Nullable AttributeSet attrs,
    @NonNull int defStyleAttr
)

Public methods

addTransitionListener

@NonNull
public void addTransitionListener(@NonNull MotionLayout.TransitionListener listener)

adds a listener to be notified of drawer events.

Parameters
@NonNull MotionLayout.TransitionListener listener

Listener to notify when drawer events occur

applyViewTransition

@NonNull
public boolean applyViewTransition(
    @NonNull int viewTransitionId,
    @NonNull MotionController motionController
)

Apply the view transitions keyFrames to the MotionController. Note ConstraintOverride is not used

Parameters
@NonNull int viewTransitionId

the id of the view transition

@NonNull MotionController motionController

the MotionController to apply the keyframes to

Returns
boolean

true if it found and applied the viewTransition false otherwise

cloneConstraintSet

@NonNull
public ConstraintSet cloneConstraintSet(@NonNull int id)

Creates a ConstraintSet based on an existing constraintSet. This makes a copy of the ConstraintSet.

Parameters
@NonNull int id

The ide of the ConstraintSet

Returns
ConstraintSet

the ConstraintSet

enableTransition

@NonNull
public void enableTransition(@NonNull int transitionID, @NonNull boolean enable)

enableViewTransition

@NonNull
public void enableViewTransition(
    @NonNull int viewTransitionId,
    @NonNull boolean enable
)

Enable a ViewTransition ID.

Parameters
@NonNull int viewTransitionId

id of ViewTransition

@NonNull boolean enable

If false view transition cannot be executed.

fireTrigger

@NonNull
public void fireTrigger(
    @NonNull int triggerId,
    @NonNull boolean positive,
    @NonNull float progress
)

This causes the callback onTransitionTrigger to be called

Parameters
@NonNull int triggerId

The id set set with triggerID

@NonNull boolean positive

for positive transition edge

@NonNull float progress

the current progress

getConstraintSet

@NonNull
public ConstraintSet getConstraintSet(@NonNull int id)

Get the ConstraintSet associated with an id This returns a link to the constraintset But in most cases can be used. createConstraintSet makes a copy which is more expensive.

Parameters
@NonNull int id
Returns
ConstraintSet
See also
cloneConstraintSet

#cloneConstraintSet(int)

getConstraintSetIds

@NonNull
public Array<@NonNull int> getConstraintSetIds()

Get the id's of all constraintSets used by MotionLayout

Returns
Array<@NonNull int>

getCurrentState

@NonNull
public int getCurrentState()

Return the current state id

Returns
int

current state id

getDebugMode

@NonNull
public void getDebugMode(@NonNull boolean showPaths)

Display the debug paths information

Parameters
@NonNull boolean showPaths

show the paths if true

getDefinedTransitions

@NonNull
public ArrayList<@NonNull MotionScene.TransitiongetDefinedTransitions()

Get all Transitions known to the system.

getDesignTool

@NonNull
public DesignTool getDesignTool()

getEndState

@NonNull
public int getEndState()

Gets the state you are currently transition to.

Returns
int

The State you are transitioning to.

getProgress

@NonNull
public float getProgress()

Get current position during an animation.

Returns
float

current position from 0.0 to 1.0 inclusive

getStartState

@NonNull
public int getStartState()

Gets the state you are currently transitioning from. If you are transitioning from an unknown state returns -1

Returns
int

State you are transitioning from.

getTargetPosition

@NonNull
public float getTargetPosition()

Gets the position you are animating to typically 0 or 1. This is useful during animation after touch up

Returns
float

The target position you are moving to

getTransition

@NonNull
public MotionScene.Transition getTransition(@NonNull int id)

This returns the internal Transition Structure

Parameters
@NonNull int id

getTransitionState

@NonNull
public Bundle getTransitionState()
Returns
Bundle

bundle containing start and end state

getTransitionTimeMs

@NonNull
public long getTransitionTimeMs()

Gets the time of the currently set animation.

Returns
long

time in Milliseconds

getVelocity

@NonNull
public float getVelocity()

Returns the last velocity used in the transition

Returns
float

getViewVelocity

@NonNull
public void getViewVelocity(
    @NonNull View view,
    @NonNull float posOnViewX,
    @NonNull float posOnViewY,
    @NonNull Array<@NonNull float> returnVelocity,
    @NonNull int type
)

Returns the last layout velocity used in the transition

Parameters
@NonNull View view

The view

@NonNull float posOnViewX

The x position on the view

@NonNull float posOnViewY

The y position on the view

@NonNull Array<@NonNull float> returnVelocity

The velocity

@NonNull int type

The type of velocity you want 0 = post layout, 1 = layout, 2 = static postlayout

isAttachedToWindow

@Override
@NonNull
public @Override boolean isAttachedToWindow()

Returns true if the provided view is currently attached to a window.

isDelayedApplicationOfInitialState

@NonNull
public boolean isDelayedApplicationOfInitialState()

Is initial state changes are applied during onAttachedToWindow or after.

Returns
boolean

isInRotation

@NonNull
public boolean isInRotation()

isInteractionEnabled

@NonNull
public boolean isInteractionEnabled()

Determines whether MotionLayout's touch & click handling are enabled. An interaction enabled MotionLayout can respond to user input and initiate and control. MotionLayout interactions are enabled initially by default. MotionLayout touch & click handling may be enabled or disabled by calling its setInteractionEnabled method.

Returns
boolean

true if MotionLayout's touch & click is enabled, false otherwise

isViewTransitionEnabled

@NonNull
public boolean isViewTransitionEnabled(@NonNull int viewTransitionId)

Is transition id enabled or disabled

Parameters
@NonNull int viewTransitionId

the ide of the transition

Returns
boolean

true if enabled

jumpToState

@NonNull
public void jumpToState(@NonNull int id)

This jumps to a state It will be at that state after one repaint cycle If the current transition contains that state. It setsProgress 0 or 1 to that state. If not in the current transition itsl

Parameters
@NonNull int id

state to set

loadLayoutDescription

@Override
@NonNull
public @Override void loadLayoutDescription(@NonNull int motionScene)

This overrides ConstraintLayout and only accepts a MotionScene.

Parameters
@NonNull int motionScene

The resource id, or 0 to reset the MotionScene.

onInterceptTouchEvent

@Override
@NonNull
public @Override boolean onInterceptTouchEvent(@NonNull MotionEvent event)

Intercepts the touch event to correctly handle touch region id handover

Parameters
@NonNull MotionEvent event
Returns
@Override boolean

onNestedFling

@Override
@NonNull
public @Override boolean onNestedFling(
    @NonNull View target,
    @NonNull float velocityX,
    @NonNull float velocityY,
    @NonNull boolean consumed
)

onNestedPreFling

@Override
@NonNull
public @Override boolean onNestedPreFling(
    @NonNull View target,
    @NonNull float velocityX,
    @NonNull float velocityY
)

onNestedPreScroll

@Override
@NonNull
public @Override void onNestedPreScroll(
    @NonNull View target,
    @NonNull int dx,
    @NonNull int dy,
    @NonNull Array<@NonNull int> consumed,
    @NonNull int type
)

onNestedScroll

@Override
@NonNull
public @Override void onNestedScroll(
    @NonNull View target,
    @NonNull int dxConsumed,
    @NonNull int dyConsumed,
    @NonNull int dxUnconsumed,
    @NonNull int dyUnconsumed,
    @NonNull int type,
    @NonNull Array<@NonNull int> consumed
)

onNestedScroll

@Override
@NonNull
public @Override void onNestedScroll(
    @NonNull View target,
    @NonNull int dxConsumed,
    @NonNull int dyConsumed,
    @NonNull int dxUnconsumed,
    @NonNull int dyUnconsumed,
    @NonNull int type
)

onNestedScrollAccepted

@Override
@NonNull
public @Override void onNestedScrollAccepted(
    @NonNull View child,
    @NonNull View target,
    @NonNull int axes,
    @NonNull int type
)

onRtlPropertiesChanged

@Override
@NonNull
public @Override void onRtlPropertiesChanged(@NonNull int layoutDirection)

onStartNestedScroll

@Override
@NonNull
public @Override boolean onStartNestedScroll(
    @NonNull View child,
    @NonNull View target,
    @NonNull int axes,
    @NonNull int type
)

onStopNestedScroll

@Override
@NonNull
public @Override void onStopNestedScroll(@NonNull View target, @NonNull int type)

onTouchEvent

@Override
@NonNull
public @Override boolean onTouchEvent(@NonNull MotionEvent event)

onViewAdded

@Override
@NonNull
public @Override void onViewAdded(@NonNull View view)

onViewRemoved

@Override
@NonNull
public @Override void onViewRemoved(@NonNull View view)

rebuildMotion

@NonNull
public void rebuildMotion()

rebuild the motion Layouts

rebuildScene

@NonNull
public void rebuildScene()

rebuild the motion Layouts

removeTransitionListener

@NonNull
public boolean removeTransitionListener(
    @NonNull MotionLayout.TransitionListener listener
)

adds a listener to be notified of drawer events.

Parameters
@NonNull MotionLayout.TransitionListener listener

Listener to notify when drawer events occur

Returns
boolean

true if it contained the specified listener

requestLayout

@Override
@NonNull
public @Override void requestLayout()

rotateTo

@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)
@NonNull
public @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1) void rotateTo(@NonNull int id, @NonNull int duration)

scheduleTransitionTo

@NonNull
public void scheduleTransitionTo(@NonNull int id)

on completing the current transition, transition to this state.

Parameters
@NonNull int id

setDebugMode

@NonNull
public void setDebugMode(@NonNull int debugMode)

Display the debugging information such as paths information

Parameters
@NonNull int debugMode

integer representing various debug modes

setDelayedApplicationOfInitialState

@NonNull
public void setDelayedApplicationOfInitialState(@NonNull boolean delayedApply)

Initial state changes are applied during onAttachedToWindow unless this is set to true.

Parameters
@NonNull boolean delayedApply

setInteractionEnabled

@NonNull
public void setInteractionEnabled(@NonNull boolean enabled)

Enables (or disables) MotionLayout's onClick and onSwipe handling.

Parameters
@NonNull boolean enabled

If true, touch & click is enabled; otherwise it is disabled

setInterpolatedProgress

@NonNull
public void setInterpolatedProgress(@NonNull float pos)

Set the transition position between 0 an 1

Parameters
@NonNull float pos

setOnHide

@NonNull
public void setOnHide(@NonNull float progress)

setOnShow

@NonNull
public void setOnShow(@NonNull float progress)

setProgress

@NonNull
public void setProgress(@NonNull float pos, @NonNull float velocity)

Set the transition position between 0 an 1

Parameters
@NonNull float pos
@NonNull float velocity

setProgress

@NonNull
public void setProgress(@NonNull float pos)

Set the transition position between 0 an 1

Parameters
@NonNull float pos

the position in the transition from 0...1

setScene

@NonNull
public void setScene(@NonNull MotionScene scene)

Sets a motion scene to the layout. Subsequent calls to it will override the previous scene.

setState

@Override
@NonNull
public @Override void setState(@NonNull int id, @NonNull int screenWidth, @NonNull int screenHeight)

Set the State of the Constraint layout. Causing it to load a particular ConstraintSet. for states with variants the variant with matching width and height constraintSet will be chosen

Parameters
@NonNull int id

set the state width and height

@NonNull int screenWidth
@NonNull int screenHeight

setTransition

@NonNull
public void setTransition(@NonNull int beginId, @NonNull int endId)

Set a transition explicitly between two constraint sets

Parameters
@NonNull int beginId

the id of the start constraint set

@NonNull int endId

the id of the end constraint set

setTransition

@NonNull
public void setTransition(@NonNull int transitionId)

Set a transition explicitly to a Transition that has an ID The transition must have been named with android:id=...

Parameters
@NonNull int transitionId

the id to set

setTransitionDuration

@NonNull
public void setTransitionDuration(@NonNull int milliseconds)

Change the current Transition duration.

Parameters
@NonNull int milliseconds

duration for transition to complete

setTransitionListener

@NonNull
public void setTransitionListener(@NonNull MotionLayout.TransitionListener listener)

Set a listener to be notified of drawer events.

Parameters
@NonNull MotionLayout.TransitionListener listener

Listener to notify when drawer events occur

setTransitionState

@NonNull
public void setTransitionState(@NonNull Bundle bundle)
Returns
void

bundle containing start and end state

toString

@Override
@NonNull
public @Override String toString()

touchAnimateTo

@NonNull
public void touchAnimateTo(
    @NonNull int touchUpMode,
    @NonNull float position,
    @NonNull float currentVelocity
)
Parameters
@NonNull int touchUpMode

behavior on touch up, can be either:

  • TOUCH_UP_COMPLETE (default) : will complete the transition, picking up automatically a correct velocity to do so
  • TOUCH_UP_STOP : will allow stopping mid-transition
  • TOUCH_UP_DECELERATE : will slowly decay, possibly past the transition (i.e. it will do a hard stop if unmanaged)
  • TOUCH_UP_DECELERATE_AND_COMPLETE : will automatically pick between TOUCH_UP_COMPLETE and TOUCH_UP_DECELERATE
, TOUCH_UP_STOP (will allow stopping
@NonNull float position

animate to given position

@NonNull float currentVelocity

touchSpringTo

@NonNull
public void touchSpringTo(@NonNull float position, @NonNull float currentVelocity)

Allows you to use trigger spring motion touch behaviour. You must have configured all the spring parameters in the Transition's OnSwipe

Parameters
@NonNull float position

the position 0 - 1

@NonNull float currentVelocity

the current velocity rate of change in position per second

transitionToEnd

@NonNull
public void transitionToEnd()

Animate to the ending position of the current transition. This will not work during on create as there is no transition Transitions are only set up during onAttach

transitionToEnd

@NonNull
public void transitionToEnd(@NonNull Runnable onComplete)

Animate to the ending position of the current transition. This will not work during on create as there is no transition Transitions are only set up during onAttach

Parameters
@NonNull Runnable onComplete

callback when task is don

transitionToStart

@NonNull
public void transitionToStart()

Animate to the starting position of the current transition. This will not work during on create as there is no transition Transitions are only set up during onAttach

transitionToState

@NonNull
public void transitionToState(@NonNull int id)

Animate to the state defined by the id. The id is the id of the ConstraintSet or the id of the State.

Parameters
@NonNull int id

the state to transition to

transitionToState

@NonNull
public void transitionToState(@NonNull int id, @NonNull int duration)

Animate to the state defined by the id. The id is the id of the ConstraintSet or the id of the State.

Parameters
@NonNull int id

the state to transition to

@NonNull int duration

time in ms. if 0 set by default or transition -1 by current

transitionToState

@NonNull
public void transitionToState(
    @NonNull int id,
    @NonNull int screenWidth,
    @NonNull int screenHeight
)

Animate to the state defined by the id. Width and height may be used in the picking of the id using this StateSet.

Parameters
@NonNull int id

the state to transition

@NonNull int screenWidth

the with of the motionLayout used to select the variant

@NonNull int screenHeight

the height of the motionLayout used to select the variant

transitionToState

@NonNull
public void transitionToState(
    @NonNull int id,
    @NonNull int screenWidth,
    @NonNull int screenHeight,
    @NonNull int duration
)

Animate to the state defined by the id. Width and height may be used in the picking of the id using this StateSet.

Parameters
@NonNull int id

the state to transition

@NonNull int screenWidth

the with of the motionLayout used to select the variant

@NonNull int screenHeight

the height of the motionLayout used to select the variant

@NonNull int duration

time in ms. if 0 set by default or transition -1 by current

updateState

@NonNull
public void updateState(@NonNull int stateId, @NonNull ConstraintSet set)

update a ConstraintSet under the id.

Parameters
@NonNull int stateId

id of the ConstraintSet

@NonNull ConstraintSet set

The constraintSet

updateState

@NonNull
public void updateState()

Not sure we want this

updateStateAnimate

@NonNull
public void updateStateAnimate(
    @NonNull int stateId,
    @NonNull ConstraintSet set,
    @NonNull int duration
)

Update a ConstraintSet but animate the change.

Parameters
@NonNull int stateId

id of the ConstraintSet

@NonNull ConstraintSet set

The constraintSet

@NonNull int duration

The length of time to perform the animation

viewTransition

@NonNull
public void viewTransition(
    @NonNull int viewTransitionId,
    @NonNull Array<@NonNull View> view
)

Execute a ViewTransition. Transition will execute if its conditions are met and it is enabled

Parameters
@NonNull int viewTransitionId
@NonNull Array<@NonNull View> view

The views to apply to