Closed Avinash-Bhat closed 5 years ago
@aricneto I've opened up a PR for this. Check and let me know.
I will!
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.
the line#8 in
fragment_timer.xml
causes the screen to keep powering down as theandroid:keepScreenOn
flag is kepttrue
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)