In our code, we often set 3 or 4 steps for the size of the text so that it looks uniform, for example
<dimen name="textview_small_size">11sp</dimen>
<dimen name="textview_middle_size">13sp</dimen>
<dimen name="textview_big_0_size">21sp</dimen>
<dimen name="textview_big_1_size">30sp</dimen>
And for the interface to look perfect, you must define individual sizes in different DPIs and screen sizes, such as the values-sw800dp-large-port.
So, just set the size of the text so that it looks perfect and follows a single rule. There is no difference between the size of a set in xml and at runtime, basically it is the same thing.
source
share