1

In my app we are using mostly SP in order to help visually impaired people.

However, sometimes font is just too big or too small and android components don't work very well, cutting some text or miscalculating the appropriate width and height of the textview.

We have been using autoshrink components but still there are some edgecases that break the app. For those cases, I want to create specific layouts.

My question is, does the configuration change fall into some of the resource directories of the app? I mean, if The user chose large font, will I be able to place special layouts in the ldpi or any other directory for example?

htafoya
  • 18,261
  • 11
  • 80
  • 104
  • `dimens.xml` can be used for any dimensions sp, dp... – cmak Mar 04 '22 at 17:07
  • I think TextAppearance should be a better way to fit text size than direct text size in sp. – aslamhossin Mar 04 '22 at 17:09
  • @cmak yes but in which folder do you place the dimens.xml in order to chose one dimen according to the font configuration of the user? I mean, I wish to use SP but sometimes i don't want to , or I want some layout to be different if the SP becomes too big. – htafoya Mar 04 '22 at 17:26
  • @AslamHossin textappearance is just a shortcut to use default SP. the problem remains, that in certain screens, the font size will break the screen. – htafoya Mar 04 '22 at 17:27
  • @htafoya Most devices can fit the text size if you use text appearance. If not, you can make several dimension files with different text sizes in sp and use those in your style. You can check out this reference https://stackoverflow.com/a/9883641/4676291. – aslamhossin Mar 04 '22 at 17:37
  • @aslamconsole I think you are missunderstanding. I am looking for variations in the user settings on the same device, not in different devices. – htafoya Mar 05 '22 at 21:56

0 Answers0