xxxcucus / planes

Variant of battleships game
MIT License
30 stars 9 forks source link

Confusing loading state in Battery Saver #48

Closed graciouselectric closed 2 months ago

graciouselectric commented 4 months ago

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 and the icon shown resembles a 'reload' indicator. 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='com.planes.android.LoaderActivity', lineNumber=45
className='com.planes.android.MainActivity', lineNumber=73

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 two videos, showing the issue in practice:

https://github.com/xxxcucus/planes/assets/165037835/891b7aef-4eea-42cd-9ddf-f93f992b08ab https://github.com/xxxcucus/planes/assets/165037835/25abed47-3466-4215-ba70-5f4ccd53d64f

xxxcucus commented 3 months ago

Hi, thank you for this issue. I am preparing the version 0.4.3.1 so I am hopefully going to integrate the fix into this version.

xxxcucus commented 3 months ago

So I corrected this. When the phone is in batery saving mode the loaders are not displayed anymore. Instead a static label is displayed in the left lower corner of the screen. You can download the new version 0.4.3.1 from the releases page. Let me know if it works for you like that.

xxxcucus commented 2 months ago

Implemented in 0.4.3.1