ankidroid / Anki-Android

AnkiDroid: Anki flashcards on Android. Your secret trick to achieve superhuman information retention.
GNU General Public License v3.0
8.44k stars 2.19k forks source link

Fix ProgressDialog deprecation #12140

Open BrayanDSO opened 2 years ago

BrayanDSO commented 2 years ago

There isn't a Material Progress Dialog. Perhaps for the same reason they deprecated progress dialog on Android O.

This class was deprecated in API level 26. ProgressDialog is a modal dialog, which prevents the user from interacting with the app. Instead of using this class, you should use a progress indicator like ProgressBar, which can be embedded in your app's UI. Alternatively, you can use a notification to inform the user of the task's progress.

(https://developer.android.com/reference/android/app/ProgressDialog)

We use ProgressDialog on other places of the code and would be nice to have an issue to discuss what to do on each case

_Originally posted by @BrayanDSO in https://github.com/ankidroid/Anki-Android/pull/12137#discussion_r953150673_

BrayanDSO commented 2 years ago

I think we're going to need a general purpose progress notification (media sync...) as a task, but some things will still need interaction-blocking progress like database check and media check. those would go into UI I guess, an updating screen that is sort of like what the dialog is now if you flattened the dialog into the screen itself, so those would become fragments or something I guess?

Maybe a common fragment activity that can take dialog-like inputs: title, description, okay/cancel, and a facility for a runnable with progress listener and text area to post. None of this is ground-breaking (or concrete enough from just this brainstorming) - definitely needs a real issue and an accounting with plan per item

_Originally posted by @mikehardy in https://github.com/ankidroid/Anki-Android/pull/12137#discussion_r953163133_

BrayanDSO commented 2 years ago

+1 for progress notification on media sync (my most wanted feature after the new backend and probably the first thing I'll do after GSoC if nobody beats me first)

github-actions[bot] commented 1 year ago

Hello 👋, this issue has been opened for more than 2 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