/**
* Tries to get the status bar height for this device. Even if the value returned is larger than 0, that does not mean the status bar is visible.
*
* @param context A context to use to find the status bar height
* @return Height of the status bar on the running device, in pixels
*/
@IntRange(from = 0)
public static int getStatusBarHeight(@NonNull 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;
}
SillyAndroid.java 文件源码
java
阅读 35
收藏 0
点赞 0
评论 0
项目:silly-android
作者:
评论列表
文章目录