app/src/main/res/xml/collapsing_motion_layout_scene.xml
<?xml version="1.0" encoding="utf-8"?>
<MotionScene xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<Transition
android:id="@+id/first"
app:constraintSetStart="@id/start"
app:constraintSetEnd="@id/hideProfile">
<OnSwipe
app:touchAnchorId="@+id/profile"
app:touchAnchorSide="top"
app:dragDirection="dragUp" />
</Transition>
<Transition
android:id="@+id/second"
app:constraintSetStart="@id/hideProfile"
app:constraintSetEnd="@id/hideBars">
<OnSwipe
app:touchAnchorId="@+id/profileTabs"
app:touchAnchorSide="top"
app:dragDirection="dragUp" />
</Transition>
<ConstraintSet android:id="@+id/start">
<Constraint android:id="@id/top_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
</Constraint>
</ConstraintSet>
<ConstraintSet android:id="@+id/hideProfile">
<Constraint android:id="@id/profile"
android:layout_width="match_parent"
app:layout_constraintBottom_toBottomOf="@id/top_bar"
app:layout_constraintStart_toStartOf="parent">
</Constraint>
<Constraint android:id="@id/profileTabs"
android:layout_width="match_parent"
app:layout_constraintTop_toBottomOf="@id/top_bar"
app:layout_constraintStart_toStartOf="parent">
</Constraint>
<Constraint android:id="@id/top_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
</Constraint>
</ConstraintSet>
<ConstraintSet android:id="@+id/hideBars">
<Constraint android:id="@id/profile"
android:layout_width="match_parent"
app:layout_constraintBottom_toBottomOf="@id/top_bar"
app:layout_constraintStart_toStartOf="parent">
</Constraint>
<Constraint android:id="@id/profileTabs"
android:layout_width="match_parent"
app:layout_constraintBottom_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent">
</Constraint>
<Constraint android:id="@id/top_bar"
android:layout_width="match_parent"
app:layout_constraintBottom_toTopOf="@id/profileTabs"
app:layout_constraintStart_toStartOf="parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent">
</Constraint>
</ConstraintSet>
</MotionScene>