thigobr
thigobr

Reputation: 51

Android resource qualifiers for Huge/Small fonts (accessibility)

I have searched the documentation and have not found an answer so here we go:

Does Android have a resource qualifier to select between different resources when accessibility options are used? Like when the user sets font size to Huge.

I would like use different dimensions on some views when dealing with Huge/Small fonts.

Thanks in advance!

Upvotes: 1

Views: 488

Answers (1)

Sam Dozor
Sam Dozor

Reputation: 40734

No, there is no resource qualifier for font scale. I assume you're aware of the sp unit for specifying text size. I would suggest either -

  1. Make your layouts more flexible and sized based on their contents.
  2. You can use getResources().getConfiguration().fontScale to determine the scale at runtime, and select or adjust your layout(s) accordingly.
  3. This may cause more harm than good, and the docs explicitly say not to do this, but you could try using sp rather than dp for your various layout parameters as well.

Upvotes: 1

Related Questions