I have two layout files which I am using to do the start and end transition using a motion layout.
The text moves as expected, based on start layout file to end layout file. But the text size does not change, even though different text sizes have been defined in each of the two layouts.
Could someone please help? The files have been provided below:
motion_layout_start.xml
<androidx.constraintlayout.motion.widget.MotionLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:showPaths="true">
<TextView
android:id="@+id/title"
android:layout_width="@dimen/match_constraints"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@id/description"
android:text="HEADING"
style="@style/TextStyle.Title"
app:layout_constraintVertical_chainStyle="packed"
app:layout_constraintVertical_bias="0"/>
<TextView
android:id="@+id/description"
android:layout_width="@dimen/match_constraints"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title"
app:layout_constraintBottom_toTopOf="@+id/recycler_view"
tools:text="DESCRIPTION"
style="@style/TextStyle.DESC"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_height="@dimen/match_constraints"
android:layout_width="match_parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/description"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.motion.widget.MotionLayout>
motion_layout_end.xml
<androidx.constraintlayout.motion.widget.MotionLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:showPaths="true">
<TextView
android:id="@+id/title"
android:layout_width="@dimen/match_constraints"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@id/recycler_view"
android:text="HEADING"
style="@style/TextStyle.SmallTitle"
app:layout_constraintVertical_chainStyle="packed"
app:layout_constraintVertical_bias="0"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_height="@dimen/match_constraints"
android:layout_width="match_parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.motion.widget.MotionLayout>
motion xml file fragment_motion.xml
<MotionScene xmlns:app="http://schemas.android.com/apk/res-auto">
<Transition
app:constraintSetStart="@layout/motion_layout_start"
app:constraintSetEnd="@layout/motion_layout_end">
<OnSwipe app:touchAnchorSide="top"
app:touchAnchorId="@id/recycler_view"
app:dragDirection="dragUp"
app:moveWhenScrollAtTop="true"/>
</Transition>
</MotionScene>
Thanks