Add dark mode listener support across all Android bootstraps#3306
Open
kengoon wants to merge 2 commits intokivy:developfrom
Open
Add dark mode listener support across all Android bootstraps#3306kengoon wants to merge 2 commits intokivy:developfrom
kengoon wants to merge 2 commits intokivy:developfrom
Conversation
Introduce `DarkModeListener` interface to detect and handle system dark mode changes. Update Java and Python APIs to support listener registration for monitoring and reacting to dark mode state changes. Document usage in APIs.
…nd standardize method signature formatting
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.
This pull request adds support for detecting and responding to system dark mode changes on Android devices in Python-for-Android apps. It introduces a new Python interface for dark mode detection and corresponding Java hooks in all supported bootstraps, along with user documentation.
Dark Mode Detection and Listener Support
android.darkmodethat allows apps to set or remove a listener for system dark mode changes, providing a callback with the current dark mode state.apis.rst) to describe the new dark mode detection API and usage examples for app developers.Java Integration for All Bootstraps
DarkModeListenerinterface and related methods (setDarkModeListener,onConfigurationChanged) toPythonActivity.javain theqt,sdl2,sdl3, andwebviewbootstraps, enabling the Java side to notify Python code of dark mode changes. [1] [2] [3] [4]android.content.res.Configurationin all affectedPythonActivity.javafiles to support configuration change detection for dark mode. [1] [2] [3] [4]Screen_Recording_20260426_204249.mp4