-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[Bug]: Confusing loading state in Battery Saver on older versions of Android #5710
Comments
Are we sure this is specific to API levels < 28? I remember seeing this reload icon even on an Android 12 device. I don't have that device now to confirm if it still happens, but it would be good to validate for all the cases. |
That interesting, I've never seen it on more recent versions. Building a toy project just now on the Android 12 emulator, I can't reproduce the bug there. |
I used to test a lot with different battery saver conditions on my Android 8.1 device, never saw this reload icon. I tested again, the progress bar still appears normal on that device. Turning animations off from the developer options does make it appear like a reload icon, though. Also, I managed to get this icon on an Android 14 device by turning animations off. So, it's possible that I turned it off while running UI tests on that Android 12 device too (with the battery saver turned on, hence the confusion). |
Aha. On many (most?) devices BS turns off animations too, but I guess this depends on OEM implementation. I'm emulating a Pixel 7. Alas, the |
I'll check this for both the devices and share my observations :) |
Hi @RitikaPahwa4444, have you had time to look at this already? Happy to help out if I can be of use |
Summary
Dear developers,
I noticed that, when I enable Battery Saver on Android 8.1, the indeterminate
ProgressBar
s 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, among other places:
To fix this issue, one can check ValueAnimator.areAnimatorsEnabled() and provide a different UI element, such as a text label, when animations are disabled.
Steps to reproduce
Expected behaviour
Progress bar animates
Actual behaviour
A 'reload' icon is shown
Device name
No response
Android version
Android 8.1
Commons app version
4.2.1
Device logs
No response
Screen-shots
fr.free.nrw.commons.mov
Would you like to work on the issue?
None
The text was updated successfully, but these errors were encountered: