0

I do have a nested layout in a MotionLayout by using an <include>.

<androidx.constraintlayout.motion.widget.MotionLayout
...>
   <include android:id="@+id/incl"
        layout="@layout/layout2"/>
    ...
</<androidx.constraintlayout.motion.widget.MotionLayout>

Layout2 file is as follows:

<androidx.constraintlayout.widget.ConstraintLayout>
    <TextView 
        android:id="@+id/tv1"
        android:text="A"
        android:textSize="16sp"

    />
    <TextView 
        android:id="@+id/tv2"
        android:text="B"
        android:textSize="16sp"

    />
    <TextView 
        android:id="@+id/tv3"
        android:text="C"
        android:textSize="16sp"

    />
</androidx.constraintlayout.widget.ConstraintLayout>

What I want to do is to change the textSize to 20 sp when Animation of the MotionLayout Ends.

Motionlayout animation is basic just some grow Animation by changing dimensions.

Sayok Majumder
  • 1,012
  • 13
  • 28

1 Answers1

1

A MotionLayout can only animate the properties of its direct children. You can bring your Views out of the inner ConstraintLayout.

Abbas
  • 3,529
  • 5
  • 36
  • 64
  • But the Include layout is used multiple times. Is there any whay it can be achieved using Kotlin or java – Sayok Majumder Sep 24 '21 at 07:08
  • The only option is to animate the nested layout on its own. To do that, you can either make `MotionLayout` the parent of your nested layout or you can animate nested views programmatically in Java or Kotlin. – Abbas Sep 24 '21 at 08:45