0

I've created resource file with this qualifier "h900dp" assuming min height of screen 900dp.

I have device with this DisplayMetrics:

{density=2.0, width=1200, height=1824, scaledDensity=2.0, xdpi=320.842, ydpi=322.966}

I assume it means height is 912dp.

How comes my resource file is not used then.

Thx

luky
  • 2,263
  • 3
  • 22
  • 40

1 Answers1

8

I assume you've long since got this figured out but I came across this question when searching for myself. I've since learned that the height qualifiers do not count the status bar or the nav bar so it's pretty likely that you were just missing the 900dp height when you subtracted the height of those areas from your total 912dp.

Here is an excerpt from the android dev site for Supporting Multiple Screens:

Note: The sizes that you specify using these qualifiers are not the actual screen sizes. Rather, the sizes are for the width or height in dp units that are available to your activity's window. The Android system might use some of the screen for system UI (such as the system bar at the bottom of the screen or the status bar at the top), so some of the screen might not be available for your layout. Thus, the sizes you declare should be specifically about the sizes needed by your activity—the system accounts for any space used by system UI when declaring how much space it provides for your layout.

pizzapieguy
  • 96
  • 1
  • 4
  • I'm having a similar issue, I have a string in values/strings.xml and values-h650dp/strings.xml but on some devices I'm seeing the default values string, when I print the activity's root view dimensions it's 2.87" x 4.18" via view.getHeight() / getResources().getDisplayMetrics().ydpi – TheHebrewHammer Jun 25 '18 at 18:43