Wondering if anyone has ran in to this.
I have created layout folders with 5 resource qualifiers.
- sw320dp
- sw480dp
- sw600dp
- sw720dp
- sw800dp
I also have 5 drawable folders with resource qualifiers from mdpi through xxxhdpi.
My goal is to have my application function on all devices (minus small) with smallest width of 320 and any density.
I am 90% of the way there and have ran in to an issue which I have been unable to resolve. My guess is that I have an issue with resource qualifier precedence , but that is only a guess.
The issue I am running in to is this. I can double-click on ANY of my layouts in any of the different layout folders and it will bring up the layout using an appropriate device within Android studio designer given the sw<n>dp layout that I selected. For example, if I double-click on my main_activity layout that is in the sw600dp folder, it opens using the 7" tablet and everything is good. This holds true for every layout I have in every layout folder, with the exception of ONE layout within my layout-sw480dp folder.
When this particular layout is opened, it opens up in Portrait mode via the Nexus 4, when it should have launched one of the sw480 devices instead. If we look at the specs of the Nexus 4, it is as follows.
768 x 1280 / hdpi
So, this means that the smallest width of this device would be 768 / 2 = 384, which falls in to the sw320dp bucket.
If I then select one of the sw480dp devices, such as the Nexus 6p, which has the following specs, 1440 x 2560 560dpi which in turn has a smallest screen width of 1440 / 3 = 480, it opens using a layout in the sw320dp folder.
Again, this is the ONLY layout file that is doing this out of ALL of them.
If anybody has any suggestions or has ran across this type behavior in the past, I would love to hear what you did.