Skip to content

Conversation

@ShaanNarendran
Copy link
Contributor

Purpose / Description

This changes the UI of existing progress dialogs (deprecated in api 26) to newer material ui progress circles.

Fixes

Approach

Created a new compat class ProgressCompat.kt to easily change all the existing progressdialogs to the new ones. We use this class in CoroutineHelpers.kt to change all the withProgress dialogs. The compat class uses regex to check for values like x/y and updates the dialog with a progress circle (defined in a new xml) automatically, if not we use an indeterminate spinner.

How Has This Been Tested?

Screen_recording_20251229_200048.webm
I struggled to test this normally, using one-way sync was the best way I found. If anyone has larger decks, or a better place to test, please let me know.

Learning (optional, can help others)

Referred:
https://developer.android.com/reference/android/app/ProgressDialog
ActionProviderCompat.kt for documentation help
https://m2.material.io/components/progress-indicators/android#circular-progress-indicators : for design (not sure if we want to use m3 since I believe it was still under discussion in the discord)

Checklist

Please, go through these checks before submitting the PR.

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

@ShaanNarendran ShaanNarendran force-pushed the Progress-Bar branch 3 times, most recently from 9ac8ea1 to f94dfb1 Compare December 29, 2025 15:30
}
}

fun setMax(max: Int) = runOnUi { setMaxInternal(max) }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused variable

circularIndicator?.max = max
}

fun setProgress(value: Int) = runOnUi { setProgressInternal(value) }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused variable

}
}

fun incrementProgressBy(diff: Int) = runOnUi { setProgressInternal(progress + diff) }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused variable


fun incrementProgressBy(diff: Int) = runOnUi { setProgressInternal(progress + diff) }

var isIndeterminate: Boolean
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused variable

}
}

private fun dismissDialogIfShowing(dialog: Dialog) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason there's so many unused functions and variables is because I wanted it to be very similar to progressdialog since it is a compat wrapper. I thought this was best practice but if it's better to remove all the unused parts, I can

@ShaanNarendran
Copy link
Contributor Author

I implemented the changes which David had mentioned starting here:
https://discord.com/channels/368267295601983490/701922522836369498/1455239427247837297

I'm not sure if I understood it in the right way, so if I'm wrong do let me know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UX] Show progress in percentage

3 participants