Issue
I'd like to provide different styles for mdpi devices and need a suggestion for the best way of doing this. The problem I'm having is that large dpi devices prioritise mdpi qualifier instead of the default values.
For example, the app has the following resource structure:
res/
values/styles.xml
values-mdpi/styles.xml
The idea here is to provide an alternative style for smaller screen devices. But it looks like Android chooses mdpi styles for larger dpi devices as the qualifier is working on the bases of minimum supported dpi.
Ideally I'd like to avoid providing styles.xml for every possible dpi as I use flavors and adding 4 new styles.xml would be multiplied by the number of flavors so change in one styles.xml would mean a change in a lot of files...
Is there an easier way to provide a specific resource for mdpi devices?
Solution
I think there is no other way for you to provide at least two styles.xml
:
res/
values-mdpi/styles.xml
values-hdpi/styles.xml
The former is for mdpi or smaller dpi. The latter is for hdpi or larger dpi.
Answered By - hata
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.