0

I have a following problem. In my App I have to implement a setting-feature that allows the user to set all font sizes and all views in the app bigger or smaller.

Dimensions of all my views are defined in sp's. So if the user goes to System-Settings and changes the FontSize all my views react on this.

Now I have to implement this feature, whithout changing the system settings.

I read this: android dynamically change style at runtime and this: Android: application-wide font-size preference

but this can only manage all changes on TextViews and all other Views which are extending TextView like EditText, Buttons...

So my Question is: Is it possible to change the scale factor programmatically, which is used in SP?

Thanks in advance!

Community
  • 1
  • 1
Dima
  • 158
  • 6

1 Answers1

0

After some more googling I finally found a solution for my problem. To change the scale factor I'm now using getResources().getDisplayMetrics().scaledDensity

I'm not sure if it works on all devices as it mentioned here: Read font size from Settings

Community
  • 1
  • 1
Dima
  • 158
  • 6