title: Android MotionLayout starts to transition to start when NestedScrollView is not on top
body: <p>The problem is that my MotionLayout starts to transition to start position when NestedScrollView is not on top. It goes to end correctly - when I start swiping my nestedScrollView to bottom. Going to start position of animation should be only if NestedScrollView reaches top but now animation to start position goes also when I am in anywhere position of my NestedScrollView (I can be either on top, in halfway, on bottom, etc).</p>
  <p>I wonder how to solve that.</p>
  <p>Here is my code:</p>
  <p>show_note_activity.xml</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;androidx.constraintlayout.motion.widget.MotionLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      android:id=&quot;@+id/rl&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      app:layoutDescription=&quot;@xml/show_note_activity_scene&quot;&gt;
  
  
      &lt;TextView
          android:id=&quot;@+id/textView&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_marginTop=&quot;10dp&quot;
          android:gravity=&quot;center&quot;
          android:text=&quot;@string/note_title&quot;
          android:textColor=&quot;?attr/myTextColor&quot;
          android:textSize=&quot;18sp&quot;
          android:textStyle=&quot;bold&quot;
          app:layout_constraintLeft_toLeftOf=&quot;parent&quot;
          app:layout_constraintRight_toRightOf=&quot;parent&quot;
          app:layout_constraintTop_toTopOf=&quot;parent&quot; /&gt;
  
      &lt;TextView
          android:id=&quot;@+id/noteTitle&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_below=&quot;@id/textView3&quot;
          android:gravity=&quot;top|left&quot;
          android:hint=&quot;@string/enter_title&quot;
          android:inputType=&quot;textMultiLine&quot;
          android:lines=&quot;2&quot;
          android:maxLines=&quot;10&quot;
          android:minHeight=&quot;48dp&quot;
          android:textColor=&quot;?attr/myTextColor&quot;
          android:textColorHint=&quot;?attr/myHintTextColor&quot;
          android:textSize=&quot;18sp&quot;
          app:layout_constraintLeft_toLeftOf=&quot;parent&quot;
          app:layout_constraintTop_toBottomOf=&quot;@id/textView&quot; /&gt;
  
  
      &lt;TextView
          android:id=&quot;@+id/textView2&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;45dp&quot;
          android:layout_below=&quot;@id/noteTitle&quot;
          android:layout_marginTop=&quot;10dp&quot;
          android:gravity=&quot;center&quot;
          android:text=&quot;@string/note_desc&quot;
          android:textColor=&quot;?attr/myTextColor&quot;
          android:textSize=&quot;18sp&quot;
          android:textStyle=&quot;bold&quot;
          app:layout_constraintLeft_toLeftOf=&quot;parent&quot;
          app:layout_constraintRight_toRightOf=&quot;parent&quot;
          app:layout_constraintTop_toBottomOf=&quot;@id/noteTitle&quot; /&gt;
  
      &lt;androidx.core.widget.NestedScrollView
          android:id=&quot;@+id/nestedScrollView&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          app:layout_constraintTop_toBottomOf=&quot;@id/textView2&quot;&gt;
  
          &lt;RelativeLayout
              android:id=&quot;@+id/rl_nested_scrollview_content&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;wrap_content&quot;&gt;
  
          &lt;TextView
              android:id=&quot;@+id/noteDesc&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:hint=&quot;@string/enter_desc&quot;
              android:textColor=&quot;?attr/myTextColor&quot;
              android:textColorHint=&quot;?attr/myHintTextColor&quot;
              android:textSize=&quot;18sp&quot; /&gt;
  
          &lt;/RelativeLayout&gt;
  
      &lt;/androidx.core.widget.NestedScrollView&gt;
  &lt;/androidx.constraintlayout.motion.widget.MotionLayout&gt;
  </code></pre>
  <p>and show_note_activity_scene.xml</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;MotionScene
      xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;&gt;
  
      &lt;ConstraintSet android:id=&quot;@+id/start&quot;&gt;
          &lt;Constraint
              android:id=&quot;@id/textView&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              app:layout_constraintLeft_toLeftOf=&quot;parent&quot;
              app:layout_constraintRight_toRightOf=&quot;parent&quot;
              app:layout_constraintTop_toTopOf=&quot;parent&quot;/&gt;
      &lt;/ConstraintSet&gt;
  
      &lt;ConstraintSet android:id=&quot;@+id/end&quot;&gt;
          &lt;Constraint
              android:id=&quot;@id/textView&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;1dp&quot;
              android:alpha=&quot;0&quot; /&gt;
      &lt;/ConstraintSet&gt;
      &lt;Transition
          app:constraintSetStart=&quot;@id/start&quot;
          app:constraintSetEnd=&quot;@id/end&quot;
          app:duration=&quot;1000&quot;&gt;
          &lt;OnSwipe
              app:touchAnchorId=&quot;@id/nestedScrollView&quot;
              app:dragDirection=&quot;dragUp&quot;
              /&gt;
      &lt;/Transition&gt;
  &lt;/MotionScene&gt;
  </code></pre>