Anki-Android icon indicating copy to clipboard operation
Anki-Android copied to clipboard

[UX] Show progress bars

Open user1823 opened this issue 1 year ago • 17 comments

Some progress dialogs can show very large numbers, which makes it difficult to estimate the progress at a quick glance. Examples include

  • Full sync dialog

  • Check Database

I propose replacing these progress dialogs with percentage-based ones.

Anki Desktop shows the progress with a progress bar, which is also clearer than raw numbers.

Related:

  • https://github.com/ankidroid/Anki-Android/pull/18341

I remember David suggesting something similar before, but I couldn't find any issue.

user1823 avatar Aug 12 '25 13:08 user1823

Instead of the progress bar, I suggest replacing the looping circle with a circular progress bar.

ZornHadNoChoice avatar Aug 12 '25 16:08 ZornHadNoChoice

I’d like to work on this. Please assign me. I’ll switch number-only dialogs to percentage-based determinate progress bars when totals exist, and use an indeterminate circular indicator otherwise. ETA: 3–5 days. Related: #18341. Could a maintainer assign me? @user1823

bavi404 avatar Aug 13 '25 09:08 bavi404

Hi 👋, great issue! I’d love to help with showing progress as a percentage in dialogs.

What I’d do:

  1. Replace numeric progress counts with percentage-based display

    • Compute: int percent = (current / (float) total) * 100
    • Use this instead of raw numbers in progress dialogs.
  2. Update UI components accordingly

    • In ProgressDialogFragment (or equivalent), change dialog text to: “Loading… 42%” rather than “Loading item 42/100”
    • Optionally add/enable a visual ProgressBar (determinate style) reflecting the percentage.
  3. Fallback for unknown totals

    • If total items aren’t available (indeterminate loading), keep an indeterminate spinner and skip percentage.
  4. Ensure localization-ready formatting

    • Use String.format(Locale.getDefault(), "%d%%", percent) or Android string resources with %d%% placeholder.
  5. Testing plan

    • Check cases with known total vs unknown total.
    • Cover dialogs like deck import, media sync, backup/restore, etc.

Happy to implement a first draft and share screenshots for feedback, or help with UX details like adding the proper progress bar style and localization. Let me know where I should begin, or if there’s a preferred dialog class to start with. Thanks!

anurag-sinha04 avatar Aug 13 '25 14:08 anurag-sinha04

Hi @BrayanDSO , I’d like to take this up if @bavi404 is not able to work on it. I’m interested in addressing the issue and implement percentage-based progress bars. If no one else is actively working on it, I can get started.

vikasp07 avatar Sep 18 '25 09:09 vikasp07

Hi @BrayanDSO , I’d like to take this up if @bavi404 is not able to work on it. I’m interested in addressing the issue and implement percentage-based progress bars. If no one else is actively working on it, I can get started.

  • hey, I have been working on it as well, only that I'm not quite satisfied with the result yet. I think I'd be able to finish it soon (unfortunately took longer than expected) but yeah if you have a better, quicker solution it would be cool too.

bavi404 avatar Sep 18 '25 09:09 bavi404

@david-allison ,Is this issue open to work?

gurnoorpannu avatar Nov 05 '25 19:11 gurnoorpannu

Sure, cheers!

david-allison avatar Nov 05 '25 23:11 david-allison

Hey @david-allison , I’ve completed most of the implementation and I’m now in the testing phase. I’m trying to ensure full coverage , could you please point me to all the places in the app where progress dialogs appear, so I can verify the new implementation thoroughly?

gurnoorpannu avatar Nov 11 '25 16:11 gurnoorpannu

A brief search for withProgress shows hundreds. Could you push your progress to a branch?

david-allison avatar Nov 11 '25 16:11 david-allison

is this issue still being worked on, it's been 1 and a half months? @gurnoorpannu If not, I'd like to take the issue up

ShaanNarendran avatar Dec 28 '25 14:12 ShaanNarendran

is this issue still being worked on, it's been 1 and a half months? @gurnoorpannu If not, I'd like to take the issue up

sure! go ahead

gurnoorpannu avatar Dec 28 '25 15:12 gurnoorpannu

Just wanted to show a mock UI, if we are fine with this I'll proceed but the concept i'm going for is to make a helper class that can be used in the withProgressDialog function in CoroutineHelpers.kt, this should allow for pretty much any progress counter, having a fixed end, to be changed into the progress circle. I'm open to any other ideas, but since we are using withProgress in so many areas, I thought this would be best. (The below is implemented using a test function which I slotted into onResume so that won't be there later on ofc)

https://github.com/user-attachments/assets/0614cd2c-3a43-4444-9bdb-8564e5a8d0cb

ShaanNarendran avatar Dec 29 '25 01:12 ShaanNarendran

Hello 👋, this issue has been opened for more than 3 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

github-actions[bot] avatar Mar 29 '26 02:03 github-actions[bot]

The following PR moved this into 'X MB/XY MB' progress. I looked into showing a percentage and it's possible, but means we'd need to recode ProgressDialog, which is more work.

  • As far as I recall, we have a loading step before a percentage step, and the dialog can't change between an indeterminate and determinate progress spinner once shown (and it's a deprecated class)

@Arthur-Milchior - pinging on a review, so we can pick which PR to merge

  • https://github.com/ankidroid/Anki-Android/pull/18341#issuecomment-4020251089
  • https://github.com/david-allison/Anki-Android/pull/49

david-allison avatar Mar 29 '26 03:03 david-allison

Sorry for not being of much help here, was supposed to get back to it in the coming month but glad it was resolved You can unsassign me on this one since we are merging a fix

ShaanNarendran avatar Mar 29 '26 07:03 ShaanNarendran

My fix displays progress textually, but it does not include a 'progress bar'

We have an 'Amount' abstraction: https://github.com/ankidroid/Anki-Android/pull/20671/changes#diff-ab2a7a47110cd7660b276c059e8612c4586f636533d31b36f631808c6558cc73R543

If we recode ProgressDialog so the progress style can be set after the dialog is shown, we can then provide Amount to this, and get a better progress experience.

This is to be enabled on a case-by-case basis as some operations appear to not contain a 'global' progress indicator (computeMemory):

  • https://github.com/ankidroid/Anki-Android/pull/20909

david-allison avatar Apr 30 '26 19:04 david-allison

Hello 👋, this issue has been opened for more than 3 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

github-actions[bot] avatar Aug 12 '26 09:08 github-actions[bot]