Enable Android "Screen saver" (DreamService) support#16
Open
brad wants to merge 4 commits into
Open
Conversation
…13193880336557798301 Enable Android "Screen saver" (DreamService) support
- Added 'is_dream' flag to Intent in PhotoFrameDreamService - Track isDreamMode in MainActivity and expose via MethodChannel - Implement 'exitApp' native method to finish activity and remove task - Update SlideshowScreen to exit app on center tap when in dream mode - Update localizations for 'Tap to exit' message Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: brad <1614+brad@users.noreply.github.com>
When the app is triggered in dream/screensaver mode, it now automatically pops any active routes (like the settings screen) to ensure the photo slideshow is displayed immediately. Modified lib/ui/screens/slideshow_screen.dart: - Updated _checkDreamMode() to call Navigator.popUntil when dream mode is detected. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: brad <1614+brad@users.noreply.github.com>
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.
Implemented a native Android DreamService (PhotoFrameDreamService) that launches the app's MainActivity when the screen saver is activated. This allows users to select "Open Photo Frame" as their system screen saver. I have nightly releases built by github actions in my clone if you wanna try. I threw this together willy nilly with Jules, and am not an Android developer so I apologize if I didn't do something right. Happy to address any feedback. Thanks for the nice app 👍
Summary of changes:
Created android/app/src/main/res/xml/dream_info.xml for service configuration.
Implemented PhotoFrameDreamService in Kotlin to handle service startup.
Added a dream_label string resource for the screen saver name.
Registered the service in AndroidManifest.xml.
Keep track of whether the app was launched as a dream service and if so
Preview