1
votes

The previous dev on this project made all of the drawable folders based on large or xlarge. We've refactored layouts and values to utilize the 'sw' folders. how would the drawable folders for large and xlarge map out?

here's the folders in question:

  • drawable
  • drawable-mdpi
  • drawable-hdpi
  • drawable-xhdpi
  • drawable-xxhdpi
  • drawable-xxxhdpi
  • drawable-large
  • drawable-large-hdpi
  • drawable-large-xhdpi
  • drawable-large-xxhdpi
  • drawable-large-xxxhdpi
  • drawable-xlarge

I'd like to keep the handset folders as-is (the ones NOT tagged with large or xlarge) but convert the others to sw folders. Anybody know the correct sw equivalents for those folders?

1

1 Answers

1
votes

From this link, we see that:

hdpi: High-density screens; approximately 240dpi.
xhdpi: Extra-high-density screens; approximately 320dpi. Added in API Level 8

large: Screens that are of similar size to a medium-density VGA screen. The minimum layout size for a large screen is approximately 480x640 dp units. Examples are VGA and WVGA medium-density screens.

As far as smallestWidth or sw, it says the following:

Some values you might use here for common screen sizes:

320, for devices with screen configurations such as:
240x320 ldpi (QVGA handset)
320x480 mdpi (handset)
480x800 hdpi (high-density handset)
480, for screens such as 480x800 mdpi (tablet/handset).
600, for screens such as 600x1024 mdpi (7" tablet).
720, for screens such as 720x1280 mdpi (10" tablet).

Edit:

The order in which a drawable is labeled with suffixes is important. For example:
In this case, drawable-large-hdpi will pick the
large attribute first, meaning that its pixel density approximately 480*640 dp units. Then,
hdpi is approximately 240dpi. Android will use hdpi based on the device dots per inches of the device running.

I believe that 480*640 will translate to layout-sw600dp, screen with smallest width of 600dp. Usually for tablets with screen of 7 inches in diagonal measurement.

For safety measures, you can create a folder under layout-sw600dp-hdpi and layout-sw600dp-xhdpi and test it and see how it runs on hdpi and xhdpi tablets.

Note: Keep in mind that developers who created the previous folders e.g: drawable-large-hdpi may have put whatever they wanted in wherever. So it does not mean that an image within drawable-large-hdpi is surely of 480*640 dimensions and is only for hdpi devices.