File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
status-bar/android/src/main/java/com/capacitorjs/plugins/statusbar Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -70,10 +70,14 @@ public void setBackgroundColor(int color) {
7070 window .addFlags (WindowManager .LayoutParams .FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS );
7171 setStatusBarColorDeprecated (color );
7272 currentStatusBarColor = color ;
73- // determine if the color is light or dark using luminance and set icon color
74- boolean isLightColor = ColorUtils .calculateLuminance (color ) > 0.5 ;
75- WindowInsetsControllerCompat insetsController = WindowCompat .getInsetsController (window , window .getDecorView ());
76- insetsController .setAppearanceLightStatusBars (isLightColor );
73+
74+ // only set foreground color if style is default
75+ if (currentStyle .equals ("DEFAULT" )) {
76+ // determine if the color is light or dark using luminance and set icon color
77+ boolean isLightColor = ColorUtils .calculateLuminance (color ) > 0.5 ;
78+ WindowInsetsControllerCompat insetsController = WindowCompat .getInsetsController (window , window .getDecorView ());
79+ insetsController .setAppearanceLightStatusBars (isLightColor );
80+ }
7781 }
7882 }
7983
You can’t perform that action at this time.
0 commit comments