Skip to content

Commit

Permalink
remove the 50dp limit while calling getStatusbarHeight(Context). #258
Browse files Browse the repository at this point in the history
  • Loading branch information
cgspine committed May 3, 2018
1 parent 81e3f88 commit 3107098
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,7 @@ private static void initStatusBarHeight(Context context) {
//状态栏高度大于25dp的平板,状态栏通常在下方
sStatusbarHeight = 0;
} else {
if (sStatusbarHeight <= 0
|| sStatusbarHeight > QMUIDisplayHelper.dp2px(context, STATUS_BAR_DEFAULT_HEIGHT_DP * 2)) {
//安卓默认状态栏高度为25dp,如果获取的状态高度大于2倍25dp的话,这个数值可能有问题,用回桌面定义的值从新获取。出现这种可能性较低,只有小部分手机出现
if (sStatusbarHeight <= 0) {
if (sVirtualDensity == -1) {
sStatusbarHeight = QMUIDisplayHelper.dp2px(context, STATUS_BAR_DEFAULT_HEIGHT_DP);
} else {
Expand Down

0 comments on commit 3107098

Please sign in to comment.