Different strings resource files for varying screens density

74 views Asked by At

I have several strings that need to be shown in a single line according to my app design.

The problem is for lower density screens (especially those lower than 2.0), my texts are overlapping each other. That's why I was thinking if android allows creating different string resources file for different screen densities. So that I would have 2 string resources:

For lower-density screens:

 <string name="valid_until_x">Действ.: %s</string>

and for higher density screens:

 <string name="valid_until_x">Действителен до: %s</string>

I did a little bit of my research and could not find anything related to this. Has Android covered this or it is something that I am going to deep?

If it is too deep, should I be checking screen density with if statements every time and provide much shorter versions of my strings for lower densities? E.g. shortening text "Действителен до: 15.12.2020" to "Действ.: 15.12.2020"

0

There are 0 answers