0

I'm using an Android motion layout. Animation is implemented through scale change, but the size of the internal text view is reduced together, making it strange to see. Is there a way to fix or increase the size of the internal textview?

Here I attach my symptoms and some codes.

this is motionscene xml

  <Transition
        app:constraintSetEnd="@+id/b"
        app:constraintSetStart="@+id/a"
        app:duration="300"
        app:motionInterpolator="linear"
        app:autoTransition="none">
        <KeyFrameSet>
            <KeyAttribute
                app:motionTarget="@+id/main_fragment_CalendarLayout"
                app:framePosition="0"
                android:scaleX="1.0" />
            <KeyAttribute
                app:motionTarget="@+id/main_fragment_CalendarLayout"
                app:framePosition="0"
                android:scaleY="1.0" />

            <KeyAttribute
                app:motionTarget="@+id/main_fragment_CalendarLayout"
                app:framePosition="100"
                android:scaleX="0.5" />
            <KeyAttribute
                app:motionTarget="@+id/main_fragment_CalendarLayout"
                app:framePosition="100"
                android:scaleY="0.25"
                />
        </KeyFrameSet>
    </Transition>
</MotionScene>

code is just control transition to start or end.

        var test = true
        binding.topBarLayoutChangeBtn.setOnClickListener {

            if(test)
                binding.mainFragmentRoot.transitionToEnd()
            else
                binding.mainFragmentRoot.transitionToStart()
            test = !test

enter image description here

Thank you.

jihunAn
  • 1
  • 1
  • If you are trying to change the size of a view but not the text use KeyPositions and change the Constraints. see https://youtu.be/3HQMCyAkWTE – hoford Jun 14 '23 at 14:02

0 Answers0