Skip to content

Add optional keep screen on functionality#35

Merged
UmerCodez merged 5 commits intoUmerCodez:mainfrom
Neznak:main
Nov 20, 2025
Merged

Add optional keep screen on functionality#35
UmerCodez merged 5 commits intoUmerCodez:mainfrom
Neznak:main

Conversation

@Neznak
Copy link
Copy Markdown
Contributor

@Neznak Neznak commented Nov 5, 2025

Doesn't keep the screen on on any screen other than ControlPadPlayScreen.

Releases the screen on flag once exited.

Setting is in the preferences with others as shown:
screenshot of settings

@UmerCodez
Copy link
Copy Markdown
Owner

I’m currently down with dengue fever, so I’m unable to test this at the moment. I’ll run the tests and follow up once I’m feeling better. Thanks

@Neznak
Copy link
Copy Markdown
Contributor Author

Neznak commented Nov 6, 2025

No problem, this can wait. Get some rest, hope you feel better soon!

@UmerCodez
Copy link
Copy Markdown
Owner

I am testing it

The `enableKeepScreenOn` call has been moved into a `LaunchedEffect`.

This ensures that the screen is kept on only once when the composable enters the composition, rather than on every recomposition.
The `window` parameter has been removed from the `ControlPadPlayScreen` composable. The window is now obtained directly from the `LocalActivity` composition local.
The `FLAG_KEEP_SCREEN_ON` is now set when entering the `ControlPadPlayScreen` and cleared upon exit.

This removes the need to pass the `window` object down through the `NavScreen` and `ControlPadsScreen`, simplifying the composable signatures.
@UmerCodez UmerCodez merged commit dfd228b into UmerCodez:main Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants