title: Android MotionLayout Transition Listener not called
body: <p>I'm trying to make a slide animation.
  For it I use a MotionLayout with a MotionScene containing two ConstraintSet.</p>
  <p>The slide animation works fine. However I get an error in the LogCat:</p>
  <blockquote>
  <p>E/MotionLayout: WARNING NO app:layoutDescription tag</p>
  </blockquote>
  <p>view_slider.xml</p>
  <pre><code>&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/motion_layout&quot;
  android:layout_width=&quot;match_parent&quot;
  android:layout_height=&quot;wrap_content&quot;
  android:background=&quot;@color/white&quot;
  app:layoutDescription=&quot;@xml/scene_slider&quot;
  app:showPaths=&quot;true&quot;&gt;
  
  &lt;View
      android:id=&quot;@+id/btn_slide&quot;
      android:layout_width=&quot;64dp&quot;
      android:layout_height=&quot;64dp&quot;
      android:background=&quot;@color/grey26&quot; /&gt;
  &lt;/androidx.constraintlayout.motion.widget.MotionLayout&gt;
  </code></pre>
  <p>scene_slider.xml:</p>
  <pre><code>&lt;MotionScene xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:motion=&quot;http://schemas.android.com/apk/res-auto&quot;&gt;
  
      &lt;Transition
          motion:constraintSetStart=&quot;@+id/start&quot;
          motion:constraintSetEnd=&quot;@+id/end&quot;
          motion:duration=&quot;1000&quot;&gt;
  
          &lt;OnSwipe
              motion:touchAnchorId=&quot;@+id/btn_slide&quot;
              motion:touchAnchorSide=&quot;right&quot;
              motion:dragDirection=&quot;dragRight&quot;/&gt;
  
      &lt;/Transition&gt;
  
      &lt;ConstraintSet android:id=&quot;@+id/start&quot;&gt;
          &lt;Constraint
              android:id=&quot;@+id/btn_slide&quot;
              android:layout_width=&quot;64dp&quot;
              android:layout_height=&quot;64dp&quot;
              android:layout_marginStart=&quot;8dp&quot;
              motion:layout_constraintBottom_toBottomOf=&quot;parent&quot;
              motion:layout_constraintStart_toStartOf=&quot;parent&quot;
              motion: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/btn_slide&quot;
              android:layout_width=&quot;64dp&quot;
              android:layout_height=&quot;64dp&quot;
              android:layout_marginEnd=&quot;8dp&quot;
              motion:layout_constraintBottom_toBottomOf=&quot;parent&quot;
              motion:layout_constraintEnd_toEndOf=&quot;parent&quot;
              motion:layout_constraintTop_toTopOf=&quot;parent&quot; /&gt;
      &lt;/ConstraintSet&gt;
  
  &lt;/MotionScene&gt;
  </code></pre>
  <p>SliderView.kt:</p>
  <pre><code>class SliderView @JvmOverloads constructor(
      context: Context,
      attrs: AttributeSet? = null,
      defStyleAttr: Int = 0
  ) : MotionLayout(context, attrs, defStyleAttr) {
  
      init {
          LayoutInflater.from(context).inflate(R.layout.view_slider, this)
      }
  
      override fun onFinishInflate() {
          super.onFinishInflate()
  
          motion_layout.setTransitionListener(object : MotionLayout.TransitionListener {
              override fun onTransitionCompleted(motionLayout: MotionLayout?, currentId: Int) {
                  debug(javaClass.simpleName, &quot;transition completed&quot;)
              }
  
              override fun onTransitionChange(motionLayout: MotionLayout?, startId: Int, endId: Int, progress: Float) {
                  debug(javaClass.simpleName, &quot;progress = $progress&quot;)
              }
          })
      }
  }
  </code></pre>
  <p>fragment.xml</p>
  <pre><code>&lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      android:orientation=&quot;vertical&quot;
      android:background=&quot;@color/red&quot;&gt;
  
      &lt;com.myapp.utils.views.SliderView
          android:id=&quot;@+id/slider&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  <p>I might be missing something because there is a layoutDescription to the MotionLayout in code.</p>
  <p>How to fix this error and why the TransitionListener callbacks are now called?</p>