Sepehr Fatemi Sepehr Fatemi - 3 months ago 12
Android Question

How to change all of text size in java android

for example if device size is 4 inch i need 12-dot per inch size and if size of the screen is 5 or more need 15-dot per inch size for text and how to change all text size with one method i know how to change size text.
if any idea write it
thanks in advance.

Answer

You can say small, medium and large text appearance and android will manage according to screen sizes.

For small

android:textAppearance="?android:attr/textAppearanceSmall"

Like this for medium and large

android:textAppearance="?android:attr/textAppearanceMedium"

android:textAppearance="?android:attr/textAppearanceLarge"

If this didn't solve your problem. Then you have to give different values for different dimensions.

Read this google documentation for managing multiple screen sizes.