ankidroid / Anki-Android

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

Refactored DatabaseErrorDialog to MaterialAlertDialog #16259

Open neeldoshii opened 2 weeks ago

neeldoshii commented 2 weeks ago

Fixes

Screenshots

INCOMPATIBLE_DB_VERSION

Before After
screenshot screenshot

DIALOG_DB_ERROR

Before After
screenshot screenshot

DIALOG_RESTORE_BACKUP

Before After
screenshot screenshot
DIALOG_STORAGE_UNAVAILABLE_AFTER_UNINSTALL Before After
screenshot screenshot

Checklist

Please, go through these checks before submitting the PR.

neeldoshii commented 2 weeks ago

@david-allison Should I create a new PR for this commit 057ea62f5ce3a93f78044000d12a98de9f653300 as this is functional change in refactor PR as well its blocking #16266

neeldoshii commented 1 week ago

I am on break due to university exams, drafting this PR till then. Will open it for review once the requested changes are refactored for review

neeldoshii commented 1 week ago

Screenshots of INCOMPATIBLE_DB_VERSION. Note : Ignore Before's background dim its emulator issue.

I feel the styling may be a little worse in the new version Before After
screenshot screenshot
neeldoshii commented 1 week ago

@david-allison Is this because of my fast commits pushed?

  Received 1440578237 of 1440578237 (100.0%), 85.6 MBs/sec
  Cache restored successfully
  Restored groovy-dsl with key gradle-groovy-dsl-v1-b6176636e15c884e52aa481f4216903e to C:\Users\runneradmin\.gradle\caches\*\groovy-dsl\*/
  Error: The action 'Setup Gradle' has timed out after 5 minutes.
david-allison commented 1 week ago

Don't worry about CI, we're having issues

david-allison commented 1 week ago

My request would be to have side-by-side images for each screen.

A few of them look unusual, and I want to confirm visually there's no regressions.

Once we have a list of 'before' screenshots, they won't need to change

neeldoshii commented 1 week ago

Updated all the screenshots in the PR description for review.

The "incompatible DB version" in "Before" looks incorrect

From the code on main, it looks like it should be using incompatible_database_version_title & incompatible_database_version_summary, can you confirm why this isn't the case?

Its because I did manual trigger for testing at DIALOG_CONFIRM_DATABASE_CHECK so its taking its corresponding title & message rather than incompatible_database_version_title & incompatible_database_version_summary. We are using string message I would have directly added string res but held myself for minimal diff at refactor PR.

            DIALOG_CONFIRM_DATABASE_CHECK -> {
                // Confirmation dialog for database check
                alertDialog.show {
                    title(R.string.check_db_title)
                    message(text = message)
                    positiveButton(R.string.dialog_ok) {
                        (activity as DeckPicker).integrityCheck()
                        dismissAllDialogFragments()
                    }
                    negativeButton(R.string.dialog_cancel)
                }
            }
david-allison commented 1 week ago

Neither the before nor the 'after' screenshots seem correct, can we do better here?

neeldoshii commented 1 week ago

updated the screenshots for review ;)