owncloud / owncloud/android

[BUG] Confusing loading state in Battery Saver

Open
#4,400 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

  • #4412 by @lakshay6907 — closed without merging
Contributions are welcome
Dominant language
Kotlin
Stars
4.2k
Forks
3.1k
Avg merge
1d 12h
Merged PRs (30d)
7

Description

Actual behaviour

Progress bar appears and animates

Expected behaviour

Nothing or non-animating circle is shown

Steps to reproduce
  1. Enable Battery Saver on e.g Android 8.1
  2. Enter server details, submit

Can this problem be reproduced with the official owncloud server?
(url: https://demo.owncloud.org, user: test, password: test)

Yes

Environment data

Android version: 8.1

Device model: Pixel 7 Emulator

Stock or customized system: Stock

ownCloud app version: 4.2.1

ownCloud server version: -

Additional info

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='com.owncloud.android.ui.preview.FileDownloadFragment$listenForTransferProgress$1$1', lineNumber=222
className='com.owncloud.android.presentation.files.filelist.MainFileListFragment', lineNumber=1333
className='com.owncloud.android.presentation.files.filelist.MainFileListFragment$subscribeToViewModels$10', lineNumber=601)

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 bug in practice:

https://github.com/owncloud/android/assets/165037835/812ef0f0-dd02-431d-a293-7f08ba58afc4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the indeterminate progress-bar call sites in FileDownloadFragment$listenForTransferProgress$1$1 at line 222 and MainFileListFragment at lines 1333 and 601. Reproduce the loading flow with Battery Saver enabled on Android 8.1, then verify that the loading state is represented without relying on animation.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.