Skip to content

Instantly share code, notes, and snippets.

@joujiahe
Created August 22, 2012 07:41
Show Gist options
  • Save joujiahe/3423472 to your computer and use it in GitHub Desktop.
Save joujiahe/3423472 to your computer and use it in GitHub Desktop.
Android system ui definitions.
// SystemUI (status bar) layout policy
int shortSizeDp = shortSize
* DisplayMetrics.DENSITY_DEFAULT
/ DisplayMetrics.DENSITY_DEVICE;
if (shortSizeDp < 600) {
// 0-599dp: "phone" UI with a separate status & navigation bar
mHasSystemNavBar = false;
mNavigationBarCanMove = true;
} else if (shortSizeDp < 720) {
// 600-719dp: "phone" UI with modifications for larger screens
mHasSystemNavBar = false;
mNavigationBarCanMove = false;
} else {
// 720dp: "tablet" UI with a single combined status & navigation bar
mHasSystemNavBar = true;
mNavigationBarCanMove = false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment