How to use the resource qualifier system in Android to indicate that I want the resource to be applied only if the width is less than a certain value?
To develop, suppose I want to provide one layout when the current available width is up to 320dp, and another layout for all other cases. This is what comes to mind:
layout-w320dp/mylayout.xml
layout/mylayout.xml
However, according to my understanding of the resource matching algorithm , even a large device (say, a tablet in the landscape) qualifies as w320dp- because, well, the available width will be more than 320dp.
Thus, the resource from layout-w320dpwill always be selected - even for larger phones and tablets. The only time a default resource is selected from a folder layoutif the available width is less than 320 dp.
So, how can I express the less relationship using the Android resource mapping system?
source
share