Upgrade to Pro — share decks privately, control downloads, hide ads and more …

MotionLayout : Animation Magic

Thomas Kioko
October 05, 2018
140

MotionLayout : Animation Magic

Thomas Kioko

October 05, 2018
Tweet

Transcript

  1. xml/ scene_movie.xml <MotionScene … > <ConstraintSet android:id=“@+id/start”> … </ConstraintSet> <ConstraintSet

    android:id=“@+id/end”> … </ConstraintSet> </MotionScene> -4- Add ConstraintSet
  2. xml/ scene_movie.xml <MotionScene … > <Transition … </Transition> <Constraint app:constraintSetStart="@id/start”>

    <Constraint android:id="@+id/iv_backdrop" android:layout_width="wrap_content" android:layout_height=“280dp” app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> </Constraint> </MotionScene> -6- Add Constraint Start
  3. xml/ scene_movie.xml <MotionScene … > <Transition … </Transition> <Constraint app:constraintSetStart="@id/end”>

    <Constraint android:id="@+id/iv_backdrop" android:layout_width="wrap_content" android:layout_height=“30dp” app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> </Constraint> </MotionScene> -7- Add Constraint End