1

I want user to use SeekBar to choose the font size and apply it to whole app. I don't want to extend base classes e.g TextView. I'm thinking something like in styles.xml set font size.

<item name="android:textSize">X</item>

Where "X" is a font size load from SharedPreferences. Is this even possibile? Also I want that text will change dynamical in app. So if user select with SeekBar font size to e.g. 20dp. It will change instantly. I found this. But there is exemple with predefined font size and this is not I'm looking for.

Community
  • 1
  • 1
slovvic
  • 417
  • 3
  • 6
  • 14

1 Answers1

1

No, you can't dynamically change values from resource files. This is how I would do it:

  1. Store the font size selected by the user in SharedPreferences.
  2. In every class, load the value from the SharedPreferences and apply it to all TextViews