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.
Brief summary
This PR scales the sleep timer display by the playback speed when using the End of Chapter timer on Android.
Which issue is fixed?
Fixes #1399 (first 3 commits)
Fixes #1268 and fixes #1200 (4th commit)
In-depth Description
This PR updates the
SleepTimerManager.kt
in 3 commits. The first commit is just applying the autoformatting and adding function comments so it is easier to see what is going on.The second commit simplifies the Increase and Decrease time functions by using built in functions to select max/min of values.
The third commit (which actually fixes the issue) adds scaling to time remaining functions when the "end time" for the chapter is used instead of "time remaining" for the fixed length.
The fourth commit cleans up general function calls to reduce code duplication and simplify the logic.
How have you tested this?
Built and tested on Android 15, Pixel 6a.
This was repeated for various playback speeds, fixed lengths, and different chapters.
Screenshots