Dynamic window background based on plugin state#146
Merged
dinitri merged 2 commits intocapacitor-camera-layeringfrom Mar 24, 2026
Merged
Dynamic window background based on plugin state#146dinitri merged 2 commits intocapacitor-camera-layeringfrom
dinitri merged 2 commits intocapacitor-camera-layeringfrom
Conversation
parveshneedhoo
approved these changes
Mar 18, 2026
dinitri
reviewed
Mar 23, 2026
Comment on lines
+457
to
+465
| if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) { | ||
| WindowInsetsController controller = cordova.getActivity().getWindow().getInsetsController(); | ||
| int nightMode = cordova.getActivity().getResources().getConfiguration().uiMode & android.content.res.Configuration.UI_MODE_NIGHT_MASK; | ||
| if (controller != null) { | ||
| if (nightMode == android.content.res.Configuration.UI_MODE_NIGHT_YES) { | ||
| controller.setSystemBarsAppearance(0, WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS | WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS); | ||
| } else { | ||
| controller.setSystemBarsAppearance(WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS | WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS, WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS | WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS); | ||
| } |
Contributor
Author
There was a problem hiding this comment.
it's used to adjust the color of the status bar and nav bar icons based on the system theme
Member
There was a problem hiding this comment.
yes, but why do we adapt to the system's theme?
Contributor
Author
There was a problem hiding this comment.
The issue: status bar icons are not visible in light mode
Icons must be forced to a light color while the plugin is active since the window background is black. When the plugin is no longer active, the default behavior is restored allowing icon colors to adapt automatically to the system theme.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Force a black window background while the plugin is active and restore the previous background on exit