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 and on a slow network it is unclear what is happening. It is fixed in later Android versions, where progress bars do appear and animate.
Looking at the code, indeterminate progress bars are created here:
To fix this issue, one can check ValueAnimator.areAnimatorsEnabled() and provide a different UI element, such as a text label, when animations are disabled.
To Reproduce
Enable Battery Saver
Run a test
Before the test starts, no animation is shown in the bottom tab
Expected behavior
Before the test starts, an indeterminate progress bar animation is shown in the bottom tab
Screenshots
System information (please complete the following information):
Describe the bug
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 and on a slow network it is unclear what is happening. It is fixed in later Android versions, where progress bars do appear and animate.Looking at the code, indeterminate progress bars are created here:
To fix this issue, one can check ValueAnimator.areAnimatorsEnabled() and provide a different UI element, such as a text label, when animations are disabled.
To Reproduce
Expected behavior
Screenshots
System information (please complete the following information):