I have a res/layout in the res/layout folder for devices with a standard screen height and width. For example (720 * 1280 and its minimum height is 640dp), but on Nexus devices the control buttons are on the screen and occupy some part of it, so my layouts, for example, on Nexus 4 (768 * 1280), no longer look. To do this, I create a new folder with a qualifier that corresponds to the minimum height of 592dp - layout-h592dp , but Nexus does not see it and takes resources from the standard folder, but if I change the qualifier to layout-h560dp , then Nexus sees it and takes resources from it , but at the same time, it takes resources and a device from which h640dp . It turns out that for Nexus and for ordinary screens I need to create two folders h560dp and h600dp?
I probably missed something, or do wrong, help to understand?
And another question, why, when I measure height in this way:
public static int getShDp(Activity activity){ DisplayMetrics displaymetrics = new DisplayMetrics(); activity.getWindowManager().getDefaultDisplay().getMetrics(displaymetrics); int ht = displaymetrics.heightPixels; int shDp = (int) ScreenHelper.convertPixelsToDp(ht, activity); return shDp; } and then I create a folder with the qualifier equal to shDp = 592dp , then from there the resources are not taken until I drop to h560dp? Is shDp = 592dp the value with or without the system buttons on the screen?