Created
December 8, 2015 02:25
-
-
Save ryancford/23dffa81ce289345cb56 to your computer and use it in GitHub Desktop.
Returns the height of the status bar in pixels.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static int getStatusBarHeight() { | |
int result = 0; | |
int resourceId = mContext.getResources().getIdentifier("status_bar_height", "dimen", "android"); | |
if (resourceId > 0) { | |
result = mContext.getResources().getDimensionPixelSize(resourceId); | |
} | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment