Android idle / long resource id not working

I currently have the following resource folders:
1. layout-sw600dp
2. layout-sw600dp-notlong

The idea is that we have 3 types of devices, and devices should use resources from the correct folder accordingly. Devices:
1. Samsung Galaxy Tab 10.1, 1280 X 800 mdpi. 16/10
2. Asus Transformer TFT 101, 1280 X 800 mdpi. 16/10.
3. General tablet, 800 X 600 ldpi. 4/3.

The problem is that all 3 devices use resources from layout-sw600dp-notlong. In my understanding, 4/3 is classified as inoperative devices.

Is there something wrong with my ID usage? Or is there an error for the identifier?

Thanks in advance.

+8
android screen ratio
Aug 01 '12 at 4:00
source share
3 answers

The identifier "notlong" is for devices that are similar in aspect ratio to the basic devices (see http://developer.android.com/guide/practices/screens_support.html ). While documents are insufficient for basic devices, the typical resolution of Android devices is 1.5 ~ 1.6. So what you see is correct.

Although there is a long identifier for devices whose length is longer than the base ones, it seems that you cannot force resources for devices that are shorter (for example, 800x600).

+6
Aug 01 2018-12-12T00:
source share

According to the source code. (Framework / Basic / Basic / Java / Android / Content / RES / Configuration.java)

// Is this a long screen? if (((longSizeDp*3)/5) >= (shortSizeDp-1)) { // Anything wider than WVGA (5:3) is considering to be long. screenLayoutLong = true; } else { screenLayoutLong = false; } 

So, if the aspect ratio is wider than 3: 5 (or 1.677), it will be considered as a long screen.

+18
Jul 29 '13 at 23:30
source share
0
Aug 01 2018-12-12T00:
source share



All Articles