app/src/main/res/xml/desc_fragment_main.xml
<?xml version="1.0" encoding="utf-8"?>
<MotionScene xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<Transition
app:constraintSetEnd="@id/collapsed"
app:constraintSetStart="@id/expanded"
app:motionInterpolator="easeInOut">
<OnSwipe
app:dragDirection="dragUp"
app:touchAnchorId="@id/toolbarBg"
app:touchAnchorSide="bottom" />
<KeyFrameSet>
<KeyAttribute
app:framePosition="0"
app:motionTarget="@id/appName">
<CustomAttribute
app:attributeName="alpha"
app:customFloatValue="1" />
</KeyAttribute>
<KeyAttribute
app:framePosition="50"
app:motionTarget="@id/appName">
<CustomAttribute
app:attributeName="alpha"
app:customFloatValue="0" />
</KeyAttribute>
</KeyFrameSet>
</Transition>
<ConstraintSet android:id="@+id/expanded">
<Constraint
android:id="@id/barrier"
android:layout_height="@dimen/app_bar_height__expanded" />
</ConstraintSet>
<ConstraintSet android:id="@+id/collapsed">
<Constraint
android:id="@id/toolbarBgTower"
android:layout_width="56dp"
android:translationX="8dp"
app:layout_constraintBottom_toBottomOf="@id/toolbarBg"
app:layout_constraintEnd_toStartOf="@id/digitalClock"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/toolbarBg" />
<Constraint
android:id="@id/digitalClock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleX="0.6"
android:scaleY="0.6"
android:translationX="-16dp"
app:layout_constraintBottom_toBottomOf="@id/barrier"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/toolbarBgTower"
app:layout_constraintTop_toTopOf="@id/barrier" />
<Constraint
android:id="@+id/analogClock"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginTop="14dp"
android:translationX="8dp"
app:layout_constraintBottom_toBottomOf="@id/toolbarBgTower"
app:layout_constraintEnd_toEndOf="@id/toolbarBgTower"
app:layout_constraintStart_toStartOf="@id/toolbarBgTower"
app:layout_constraintTop_toTopOf="@id/toolbarBgTower" />
<!--
Stop at the size of a usual
action bar.
-->
<Constraint
android:id="@id/barrier"
android:layout_height="@dimen/app_bar_height__collapsed" />
</ConstraintSet>
</MotionScene>