OSMDashboard icon indicating copy to clipboard operation
OSMDashboard copied to clipboard

Confusing loading state in Battery Saver

Open graciouselectric opened this issue 9 months ago • 1 comments

Dear developer,

I noticed that when I enable Battery Saver on Android 8.1, the indeterminate ProgressBars in the app are not properly shown. This is a known problem in Android API level <28, see e.g. this StackOverflow question. Battery Saver disables animations, also on progress bars on these versions. This is quite confusing because the loading state is not properly represented. It is fixed in later Android versions, where progress bars do appear and animate.

Looking at the code, indeterminate progress bars are created here:

className='de.storchp.opentracks.osmplugin.DownloadActivity', lineNumber=57
className='de.storchp.opentracks.osmplugin.DownloadActivity', lineNumber=157

To fix this issue, one can check ValueAnimator.areAnimatorsEnabled() and provide a different UI element, such as a text label, when animations are disabled.

I also recorded a video, showing the issue in practice:

https://github.com/OpenTracksApp/OSMDashboard/assets/165037835/ee2efef0-a312-4a37-be83-e3218ad514a0

graciouselectric avatar May 06 '24 13:05 graciouselectric

Thanks for reporting. I've never experienced it, so far. Replacing the progress bar with a text in case of disabled animations feels a bit awkward, but I'll think about it.

pstorch avatar May 06 '24 18:05 pstorch

@graciouselectric the download is changed in the current nightly version to use a Download Manager and the progress bar is not "indeterminate" anymore. Can you test this version?

pstorch avatar Sep 28 '24 19:09 pstorch

@pstorch works for me :)

dennisguse avatar Sep 29 '24 07:09 dennisguse