@@ -30,8 +30,7 @@ public static void transparencyBar(Activity activity){
3030 window .addFlags (WindowManager .LayoutParams .FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS );
3131 window .setStatusBarColor (Color .TRANSPARENT );
3232
33- } else
34- if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .KITKAT ) {
33+ } else {
3534 Window window =activity .getWindow ();
3635 window .setFlags (WindowManager .LayoutParams .FLAG_TRANSLUCENT_STATUS ,
3736 WindowManager .LayoutParams .FLAG_TRANSLUCENT_STATUS );
@@ -67,15 +66,13 @@ public static void setStatusBarColor(Activity activity,int colorId) {
6766 */
6867 public static int StatusBarLightMode (Activity activity ){
6968 int result =0 ;
70- if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .KITKAT ) {
71- if (MIUISetStatusBarLightMode (activity , true )){
72- result =1 ;
73- }else if (FlymeSetStatusBarLightMode (activity .getWindow (), true )){
74- result =2 ;
75- }else if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .M ) {
76- activity .getWindow ().getDecorView ().setSystemUiVisibility ( View .SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |View .SYSTEM_UI_FLAG_LIGHT_STATUS_BAR );
77- result =3 ;
78- }
69+ if (MIUISetStatusBarLightMode (activity , true )){
70+ result =1 ;
71+ }else if (FlymeSetStatusBarLightMode (activity .getWindow (), true )){
72+ result =2 ;
73+ }else if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .M ) {
74+ activity .getWindow ().getDecorView ().setSystemUiVisibility ( View .SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |View .SYSTEM_UI_FLAG_LIGHT_STATUS_BAR );
75+ result =3 ;
7976 }
8077 return result ;
8178 }
@@ -182,7 +179,7 @@ public static boolean MIUISetStatusBarLightMode(Activity activity, boolean dark)
182179 }
183180 }
184181 }catch (Exception e ){
185-
182+ e . printStackTrace ();
186183 }
187184 }
188185 return result ;
0 commit comments