keeping the timer screen on with timer running#508
keeping the timer screen on with timer running#508krugerk wants to merge 1 commit intobeeminder:masterfrom
Conversation
|
|
||
| private var idleTimer: Timer? | ||
| private var defaultBrightnessLevel: CGFloat = UIScreen.main.brightness | ||
| private let dimmedBrightnessLevel: CGFloat = 0.2 |
There was a problem hiding this comment.
Perhaps this should be a function of the default brightness level? If the user has brightness turned low this could end up increasing it, right?
|
|
||
|
|
||
| private var idleTimer: Timer? | ||
| private var defaultBrightnessLevel: CGFloat = UIScreen.main.brightness |
There was a problem hiding this comment.
We should probably capture the current value as late as possible (i.e. just before changing it), to minimize surprising behavior if the user changes brightness while on this screen?
| resetButton.setTitle("Reset", for: .normal) | ||
| } | ||
|
|
||
| override func viewWillDisappear(_ animated: Bool) { |
There was a problem hiding this comment.
In addition to when leaving the screen, should we disable the brightness override when the app is moved to background?
| self.timingSince = nil | ||
| } | ||
|
|
||
| resetIdleTimer() |
There was a problem hiding this comment.
The lifecycle of "when we disable the screen" is a little surprising to me. In particular, we enter "do not sleep" mode when you start the timer, but do not leave it when you stop the timer. I'd suggest either enabling it as soon as the user enters the screen, or disabling it when the timer is not running.
8cb1085 to
91c96c2
Compare
a757ef6 to
e9ad543
Compare
keep screen on, albeit dimmed, with active timer on timer screen
fixes: #268