2

I have separate values directories like values-mdpi, values-hdpi, values-xhdpi and values-xxhdpi

But in all screen resolution phones, dimens are picked from values-xxhdpi if I delete values-xxhdpi then it picks up from values-xhdpi

I have tried it on large and xlarge phones

Could be an old and common question but I didn't find any working simple solution

Sreedhu Madhu
  • 2,480
  • 2
  • 30
  • 40

2 Answers2

1

values and values-mdpi are virtually the same. If you want to create a differentiation create values-sw320dp which will be taken into account for mdpi.

You can refer to this SO for more details.

Sagar
  • 23,903
  • 4
  • 62
  • 62
0

I thought I should write down how it started working for me,

First of all values-mdpi, values-hdpi, values-xhdpi, values-xxhdpi are not working as expected those mdpi, hdpi, xhdpi and xxhdpi are working fine with mipmap and drawables.

In case of values, independent of phone resolution it is picking from the highest resolution, in my case values-xxhdpi if I delete it then it picks up from values-xhdpi

I tried it on a mdpi and hdpi phones still it is picking from highest resolution one

As @Sagar mentioned sw320dp seems working for me so I created values-sw320dp, values-sw360dp and values-sw400dp now it started picking dimens from respective directories based on phone's resolution.

Sreedhu Madhu
  • 2,480
  • 2
  • 30
  • 40