Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't keep the screen on when the timer is not running #56

Closed
Avinash-Bhat opened this issue Nov 7, 2016 · 3 comments
Closed

Don't keep the screen on when the timer is not running #56

Avinash-Bhat opened this issue Nov 7, 2016 · 3 comments
Labels

Comments

@Avinash-Bhat
Copy link

the line#8 in fragment_timer.xml causes the screen to keep powering down as the android:keepScreenOn flag is kept true throughout the fragment lifecycle.

The same can be done programatically using getWindow().addFlag(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) when the timer is started and clearing the flag later when the timer is stopped. This keeps the device from going to sleep only when the timer is running.

This behavior is consistent from other time keeping apps (e.g., the default alarm app on android)

@Avinash-Bhat
Copy link
Author

@aricneto I've opened up a PR for this. Check and let me know.

@aricneto
Copy link
Owner

I will!

@aricneto
Copy link
Owner

This may not be the best solution since puzzles with long scramble sequences (like the 7x7) take some time to scramble, and if the user has the system sleep timer set too low the phone will likely turn off before he has finished scrambling. Ideally this should be a setting I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants