Ravi Parmar
Ravi Parmar

Reputation: 1018

How to add Dimensions for specific screen size in android

There are multiple devices that lie's within the range of xxhdpi From 5.2" - 6.5" Devices. Problem Occurs if this device ranges pick the same size from the xxhdpi dimensions that are mentioned in the dimension file. I have tried multiple ways of specifying dimensions from screen width to dimension ratio but it does not work.

Is there a way to mention the dimension for screen size in android, like if the device is below 5.2" then use this dimension or else use these values with the same xxhdpi resolution? enter image description here

Upvotes: 0

Views: 423

Answers (1)

Bea
Bea

Reputation: 158

I don't think there's anything to filter by screen physical size (in inches or cm) but there are qualifiers for smallest width (which you're already using in the screenshot), available width and available height, all in dp. There's information about them and their order or precedence in this table.

Perhaps you can combine qualifiers as shown here to achieve what you want. For example, putting resources for xxhdpi devices with a smallest width of 600dp or more in a -sw600dp-xxhpdi folder and for other xxhdpi devices in a -xxhdpi folder.

Upvotes: 1

Related Questions