title: Android motion layout not working accordingly
body: <p>I am new to <code>motionlayout</code> and been following various tutorials online like <a href="https://blog.mindorks.com/getting-started-with-motion-layout-android-tutorials" rel="nofollow noreferrer">this</a> to get an understanding of how it works. From a nutshell I have come to know it basically animates <code>constraintSets</code>, you have a <code>start</code> and <code>end</code> <code>constraintSet</code> which you can further customize with <code>KeyFrameSets</code>. I have this layout</p>
  
  <p><a href="https://i.stack.imgur.com/PTncv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PTncv.png" alt="enter image description here"></a></p>
  
  <p>I want to mimic <code>Lyft's bottom sheet</code> </p>
  
  <p><a href="https://i.stack.imgur.com/rqitc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rqitc.png" alt="enter image description here"></a></p>
  
  <p>With my layout the <code>Where are you going</code> button is suppose to slowly fade out as the search destination <code>textInputs</code> fade in. The <code>recyclerview</code> at the bottom is suppose to hold saved <code>addresses</code>, it will not be affected. I tried this implementation using a standard <code>bottomsheet</code> but had challenges with the animation, it had this weird <code>flickering</code> so I decided to use a <code>MotionLayout</code> with a normal view.</p>
  
  <p>My <code>bottomsheet</code> layout is as follows</p>
  
  <pre><code>&lt;com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:id="@+id/cardChooseAddressBottomSheet"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:clickable="true"
      app:shapeAppearance="@style/ShapeAppearanceRoundedLargeTopCorners"&gt;
  
  
  
      &lt;androidx.constraintlayout.widget.ConstraintLayout
          android:id="@+id/bottomSheetConstraintLayout"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_marginLeft="@dimen/activity_horizontal_margin"
          android:layout_marginRight="@dimen/activity_horizontal_margin"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent"&gt;
  
  
  
          &lt;ImageView
              android:id="@+id/swipeUpHandle"
              android:layout_width="50dp"
              android:layout_height="30dp"
              android:layout_gravity="center"
              android:background="@drawable/ic_swipe_up_handle"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toTopOf="parent" /&gt;
  
  
  
          &lt;com.google.android.material.textview.MaterialTextView
              android:id="@+id/hiThere"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginTop="@dimen/medium_margin"
              android:text="@string/hi_there"
              android:textAppearance="@style/h6_headline"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toBottomOf="@id/swipeUpHandle"
              /&gt;
  
  
          &lt;com.google.android.material.button.MaterialButton
              android:id="@+id/btnSearch"
              style="@style/Widget.MaterialComponents.Button.OutlinedButton"
              android:layout_width="match_parent"
              android:layout_height="60dp"
              android:layout_marginTop="@dimen/medium_margin"
              android:gravity="start|center_vertical"
              android:letterSpacing="0.0"
              android:text="@string/where_are_you_going"
              android:textAllCaps="false"
              android:textAppearance="@style/subtitle1"
              android:textColor="@android:color/darker_gray"
              app:backgroundTint="@android:color/white"
              app:icon="@drawable/ic_search"
              app:iconTint="@android:color/black"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toBottomOf="@id/hiThere"
              app:shapeAppearanceOverlay="@style/ShapeAppearanceRoundedMediumAllCorners" /&gt;
  
  
  
          &lt;androidx.constraintlayout.widget.ConstraintLayout
              android:layout_width="match_parent"
              android:layout_height="0dp"
              android:id="@+id/addressViews"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toBottomOf="@+id/btnSearch"&gt;
  
  
  
              &lt;com.google.android.material.textfield.TextInputLayout
                  android:id="@+id/inputOrigin"
                  style="@style/textInput"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_marginTop="@dimen/medium_margin"
                  android:hint="@string/search_destination"
                  android:textColorHint="@android:color/darker_gray"
                  app:layout_constraintEnd_toEndOf="parent"
                  app:layout_constraintStart_toStartOf="parent"
                  app:layout_constraintTop_toTopOf="parent"&gt;
  
                  &lt;com.google.android.material.textfield.TextInputEditText
                      android:id="@+id/edtOrigin"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:inputType="text"
                      android:textAppearance="@style/subtitle1"
                      android:textColor="@android:color/white" /&gt;
  
              &lt;/com.google.android.material.textfield.TextInputLayout&gt;
  
              &lt;com.google.android.material.textfield.TextInputLayout
                  android:id="@+id/inputDestination"
                  style="@style/textInput"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_marginTop="@dimen/medium_margin"
                  android:hint="@string/search_destination"
                  android:textColorHint="@android:color/darker_gray"
                  app:layout_constraintEnd_toEndOf="parent"
                  app:layout_constraintStart_toStartOf="parent"
                  app:layout_constraintTop_toBottomOf="@id/inputOrigin"&gt;
  
                  &lt;com.google.android.material.textfield.TextInputEditText
                      android:id="@+id/edtDestination"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:inputType="text"
                      android:textAppearance="@style/subtitle1"
                      android:textColor="@android:color/white" /&gt;
  
              &lt;/com.google.android.material.textfield.TextInputLayout&gt;
  
  
          &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  
          &lt;androidx.recyclerview.widget.RecyclerView
              android:layout_width="match_parent"
              android:layout_height="0dp"
              android:id="@+id/recyclerAddresses"
              android:layout_marginTop="@dimen/medium_margin"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toBottomOf="@id/addressViews"
              tools:listitem="@layout/recycler_view_item" /&gt;
      &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  
  &lt;/com.google.android.material.card.MaterialCardView&gt;
  </code></pre>
  
  <p>And my parent layout where I include the <code>bottomsheet</code> is as follows</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;androidx.constraintlayout.motion.widget.MotionLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:id="@+id/motionLayout"
      app:layoutDescription="@xml/taxi_bottomsheet_scene"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
  
      &lt;fragment
          android:id="@+id/map"
          android:name="com.google.android.gms.maps.SupportMapFragment"
          android:layout_width="match_parent"
          android:layout_height="match_parent" /&gt;
  
  
  
      &lt;include
          layout="@layout/choose_destination_bottom_sheet_layout"/&gt;
  
  &lt;/androidx.constraintlayout.motion.widget.MotionLayout&gt;
  </code></pre>
  
  <p>And finally my <code>taxi_bottomsheet_scene</code> motion scene is </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;MotionScene xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"&gt;
  
  
  
      &lt;Transition
          app:constraintSetEnd="@+id/expanded"
          app:constraintSetStart="@+id/collapsed"
          app:duration="1000"&gt;
  
          &lt;OnSwipe
              app:touchAnchorId="@+id/btnSearch"
              app:touchAnchorSide="top"
              app:dragDirection="dragUp"/&gt;
  
  
      &lt;/Transition&gt;
  
  
      &lt;ConstraintSet android:id="@+id/expanded"&gt;
  
          &lt;Constraint
              android:id="@+id/cardChooseAddressBottomSheet"
              android:layout_width="0dp"
              android:layout_height="0dp"
              app:layout_constraintBottom_toBottomOf="parent"
              app:layout_constraintHeight_percent="1"
              app:layout_constraintHorizontal_bias="1.0"
              app:layout_constraintLeft_toLeftOf="parent"
              app:layout_constraintRight_toRightOf="parent"
              app:layout_constraintTop_toTopOf="parent"
              app:layout_constraintVertical_bias="0" /&gt;
  
  
  
          &lt;Constraint
              android:id="@+id/addressViews"
              app:layout_constraintHeight_percent="1"/&gt;
  
  
          &lt;Constraint
              android:id="@+id/btnSearch"
              app:layout_constraintHeight_percent="0"/&gt;
  
      &lt;/ConstraintSet&gt;
  
  
  
  
      &lt;ConstraintSet android:id="@+id/collapsed"&gt;
  
          &lt;Constraint
              android:id="@+id/cardChooseAddressBottomSheet"
              android:layout_width="0dp"
              android:layout_height="0dp"
              app:layout_constraintBottom_toBottomOf="parent"
              app:layout_constraintHeight_percent="0.4"
              app:layout_constraintHorizontal_bias="1.0"
              app:layout_constraintLeft_toLeftOf="parent"
              app:layout_constraintRight_toRightOf="parent"
              app:layout_constraintTop_toTopOf="parent"
              app:layout_constraintVertical_bias="1.0"  /&gt;
  
  
          &lt;Constraint
              android:id="@+id/addressViews"
              app:layout_constraintHeight_percent="0.0"/&gt;
  
  
  
          &lt;Constraint
              android:id="@+id/btnSearch"
              app:layout_constraintHeight_percent="0.0"/&gt;
      &lt;/ConstraintSet&gt;
  
  
  
  
  
  &lt;/MotionScene&gt;
  </code></pre>
  
  <p>When I launch this app I cannot get the bottomsheet to slide up, it simply does not respond in any way. One thing I noticed though is after adding the <code>app:layoutDescription="@xml/taxi_bottomsheet_scene"</code>attribute, the bottom sheet size changed to what I had specified in the <code>constraintSetStart</code> but the <code>addressViews</code> view did not.</p>
  
  <p>So my layout looks like </p>
  
  <p><a href="https://i.stack.imgur.com/EbaZV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EbaZV.png" alt="parent layout after attaching it to the motion scene"></a></p>
  
  <p>So my question is, where I am going wrong for my bottomsheet not to respond to my <code>swipes</code> and <code>addressViews</code> to disappear in the initial state?</p>