Commit 173fa50
committed
Begin migration from ProgressDialog to custom DialogFragment
This replaces the deprecated ProgressDialog with a DialogFragment-based implementation.
ProgressDialog was deprecated in API level 26 (Android 8.0) because it:
1. Fails to handle config changes (e.g. screen rotation)
2. Does not follow Material Design guidelines
3. Can cause window-leak errors in some cases
Benefits of the DialogFragment implementation:
1. Handles config changes automatically
2. Material Design compliant via MaterialAlertDialogBuilder
3. Prevents memory leaks via proper lifecycle management
4. Consistent UI on all Android versions
Here, only the usage in Sync.kt has been updated, so that we can test with a limited scope initially. All other ProgressDialog usages will be updated in follow-up pull requests.
Added AndroidManifest.xml in androidTest directory to declare EmptyFragmentActivity required by FragmentScenario.launchFragmentInContainer() used in the new AnkiProgressDialogFragmentTest.
Changed "libs.androidx.fragment.testing.manifest" from debugImplementation to implementation to ensure fragment testing infrastructure is available in all build variants, not just debug builds, since androidTest runs against both debug and release configurations.1 parent 25d8511 commit 173fa50
File tree
11 files changed
+1503
-4
lines changed- AnkiDroid
- src
- androidTest
- java/com/ichi2/anki/dialogs
- main
- java/com/ichi2/anki
- dialogs
- res/layout
- test/java/com/ichi2/anki/dialogs
11 files changed
+1503
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
389 | | - | |
| 389 | + | |
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
0 commit comments