Skip to content

Commit

Permalink
1.小更新
Browse files Browse the repository at this point in the history
  • Loading branch information
Jlanglang committed Jan 6, 2020
1 parent 859ddef commit 233a105
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/src/main/java/com/baozi/mvp/base/BaseActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ protected void initStatusBar() {
}
int statusBarDrawable = getStatusBarDrawable();
if (statusBarView != null) {
statusBarView.setBackgroundDrawable(null);
statusBarView.setBackgroundResource(statusBarDrawable);
}
}
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/java/com/baozi/mvp/utils/StatusBarUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ public void setStatusBar(Activity activity,
int statusId = activity.getResources().getIdentifier("statusBarBackground", "id", "android");
View statusBarView = window.findViewById(statusId);
if (statusBarView != null) {
if (isLight) {
statusBarView.setBackgroundDrawable(null);
}
statusBarView.setBackgroundResource(statusBarDrawable);
}
//5.0以下不允许修改字体颜色
Expand All @@ -61,6 +64,7 @@ public void setStatusBar(Activity activity,
statusBarView.setBackgroundResource(normalRes);
}
}

StatusBarUtil.setStatusBarLightMode(window, isLight);
}

Expand Down

0 comments on commit 233a105

Please sign in to comment.