Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android:textSize change in MotionLayout

I am going to animate text size change using MotionLayout.

I do the following for start state

<CustomAttribute
    motion:attributeName="textSize"
    motion:customDimension="16sp" />

And the following for end state

<CustomAttribute
    motion:attributeName="textSize"
    motion:customDimension="14sp" />

As a result, it looks like size is actually changing, but it's much larger than 14sp-16sp

So, how to change text size properly?

like image 614
Artyom Avatar asked Nov 14 '19 12:11

Artyom


People also ask

What is the attribute to change size of TextView?

Use sp for text size…

How to change font size of TextView in android studio?

Go to File -> Settings, a new setting dialogue box will appear. Then go to Editor -> General. Now mark the checkbox Change font size with Ctrl + Mouse wheel and click on Apply button. Now to change your editor font size, you just have to press and hold Ctrl and rotate the Mouse wheel.


1 Answers

Try this

<CustomAttribute
    motion:attributeName="textSize"
    motion:customFloatValue="14" />
like image 164
Sk Suraj Avatar answered Sep 19 '22 05:09

Sk Suraj