start to resize status bar area based on device dimensions so that devices with nonstandard status bars don't draw the app window

beneath the statusbar.
This commit is contained in:
simonfi 2017-03-23 08:54:06 +13:00
commit 823f0ca856
3 changed files with 24 additions and 0 deletions

View file

@ -135,4 +135,12 @@ public class Util {
}
}
public static int getStatusBarHeight(final Context context) {
int result = 0;
int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resourceId > 0) {
result = context.getResources().getDimensionPixelSize(resourceId);
}
return result;
}
}