Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

ZhangTitanjum jungletian

💭
I may be slow to respond.
View GitHub Profile
@jungletian
jungletian / getStatusBarHeight
Created Aug 11, 2017
the height of status bar
View getStatusBarHeight
public static int getStatusBarHeight(Context context) {
int statusBarHeight = 0;
int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resourceId > 0) {
statusBarHeight = context.getResources().getDimensionPixelSize(resourceId);
}
return statusBarHeight;
}
You can’t perform that action at this time.