How to determine the folder name for multiple screens (conflict between Nexus 10 and Galaxy Tab 10)?

The following folder structure works fine for the specified devices and permissions:

  • drawable-hdpi - for 480x800
  • drawable-ldpi - empty
  • drawable-mdpi - for 320x480 and 240x320 (mdpi device)
  • drawable-sw600dp-tvdpi - for Nexus 7 2012 tvdpi
  • drawable-sw600dp-xhdpi - for Nexus 7 2013 xhdpi

The problem is Nexus 10 and Samsung Galaxy Tab 10 (tab with Android 4.0 and mdpi). For processing both devices, I added two separate folders:

  • drawable-sw800dp-xhdpi - for Nexus 10 (put 2560x1600 resolution images in this folder)
  • drawable-sw800dp-mdpi - for Samsung Galaxy Tab 10 (place images with a resolution of 1280x800 in this folder)

However, both the Nexus 10 and Samsung Galaxy Tab 10 use images with drawable-sw800dp-xhdpi .

What else have I tried?

  • drawable-sw720dp-xhdpi - for Nexus 10
  • drawable-sw720dp-mdpi - for the Samsung Galaxy 10 tab

Same result: Nexus 10 and Samsung Galaxy Tab 10 use images with drawable-sw720dp-xhdpi.

I also tried using drawable-xlarge-mdpi and drawable-xlarge-xhdpi (remove drawable-sw800dp-mdpi and drawable-sw800dp-xhdpi) to handle the Samsung Galaxy Tab 10, but the Tab with Android 4.0 and xlarge structure is deprecated. Thus, it accepts according to the new directory structure (i.e. Drawable-sw600dp-xhdpi).

Other related things

In the Eclipse graphics editor, the correct images (from drawable-sw800dp-mdpi) are displayed after selecting 10.1 "WXGA (Tablet), which is similar to the Samsung Galaxy Tab 10. However, when I test the same thing in a device or emulator, showing images from drawable -sw800dp-xhdpi.

Manifrest:

 <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="21" /> 

Markup:

 layout 

values:

 values values-sw320dp values-sw600dp values-sw800dp 
  • A separate folder with the ability to copy is required, as some images may not be converted to 9 patch images.
  • Please, my question is not about conflicts between nexus 7 and nexus 10 or not between Samsung Galaxy Tab 7 and Samsung Galaxy Tab 10 '.

Question

So what should be the available folders for the Nexus 10 and Samsung Galaxy Tab 10?

+6
source share
7 answers

You can use the available folders in this format:

 drawable-480x320 drawable-1280x800 drawable-2560x1600 ... 

etc.

+8
source

To solve the problem of loading the mdpi tablet with the inf "drawable-sw720dp-xhdpi" resource, use this method:

Selectable names "R.drawable. Ic_xxx ";

drawable-xhdpi place your Nexus 10 file named ic_xxx_720.png;

drawable-mdpi put your Samsung Galaxy Tab 10 pic named as ic_xxx_720.png;

then in values-sw720dp enter the resource alias:

 <item name="ic_xxx" type="drawable">ic_xxx_720.png</item> 
+2
source

If you are using Android studio, you can right-click the resource folder New-> Android resource folder. You will see all the available conditions for the available folders, including screen size. You can also select several conditions. It will probably be for Eclipse, but I have not tested this.

+1
source

One thing that can work is to use the smallest width (assuming they are different for 10 "and 10.1" devices).

To do this, use the application to get the exact smallest width, for example: https://play.google.com/store/apps/details?id=com.jotabout.screeninfo

If they are different, you can simply use them as the -swxxxdp qualifier.

Please note that the minimum width determinant should not be a round number, it can be anything: sw800dp, sw801dp, sw802dp, ...

0
source

You must clear the project after renaming the resource folders , otherwise the R object will not be restored, which will force your application to use the old links.

What you did here goes in the right direction:

I also tried using drawable-xlarge-mdpi and drawable-xlarge-xhdpi (removed drawable-sw800dp-mhdpi and drawable-sw800dp-xhdpi)

(I hope you do not write "mhdpi" as you did in your post, though)

0
source

A set of six generalized densities: ldpi (low) ~ 120dpi mdpi (medium) ~ 160dpi hdpi (high) ~ 240dpi xhdpi (extra-high) ~ 320dpi xxhdpi (extra-extra-high) ~ 480dpi xxxhdpi (extra-extra-extra- high) ~ 640dpi

and

xlarge screens at least 960dp x 720dp large screens at least 640dp x 480dp normal screens at least 470dp x 320dp small screens at least 426dp x 320dp

Please contact

http://developer.android.com/guide/practices/screens_support.html

0
source

Try using configuration identifiers for your available resource folder for the tablet version.

drawable-sw600dp (for 7-inch devices)
drawable-sw720dp (for 10-inch devices)
drawable-sw600dp-land (for 7-inch devices with landscape mode) drawable-sw720dp-land (for 7-inch devices with landscape mode)

0
source

Source: https://habr.com/ru/post/981963/


All Articles