-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor(MediaCheckDialog): Media check to use ViewModel #17943
base: main
Are you sure you want to change the base?
Conversation
Important Maintainers: This PR contains Strings changes
|
bc072d9
to
7a503ca
Compare
18ef3d5
to
6b62901
Compare
AnkiDroid/src/main/java/com/ichi2/anki/dialogs/mediacheck/ConfirmMediaCheckDialog.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/dialogs/mediacheck/MediaCheckResultDialog.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/dialogs/viewmodel/MediaCheckViewModel.kt
Outdated
Show resolved
Hide resolved
6b62901
to
337a7d4
Compare
93508d4
to
124a991
Compare
To resolve the issue in I am migrating the result from dialog to fragment. Why? Because the string builder is taking a lot of time to render strings i.e. 10k or 30k file names etc so its a heavy task for it, I have replicated the Anki behaviour in the fragment i.e. how it closes and how the user can interact with it |
9090d16
to
37301c4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why you introduced the current granularity with the number of commits. Reverting any of the first three commits will render the other two commits useless as the content is tightly tied together. It also makes reviewing harder.
So please squash the first three commits into a single commit.
Requested some changes, the implementation seems fine.
AnkiDroid/src/main/java/com/ichi2/anki/mediacheck/ConfirmMediaCheckDialog.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/mediacheck/MediaCheckAdapter.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/mediacheck/MediaCheckAdapter.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/mediacheck/MediaCheckFragment.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/mediacheck/MediaCheckFragment.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/mediacheck/MediaCheckViewModel.kt
Outdated
Show resolved
Hide resolved
6ef3989
to
425ac64
Compare
425ac64
to
961d458
Compare
text = | ||
TR.mediaCheckDeleteUnused().toSentenceCase( | ||
requireContext(), | ||
R.string.check_media_delete_unused, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This string is used only here. It should be removed from 03-dialogs.xml and added to sentence case xml.
51dc85f
to
ea860b9
Compare
feat: add media check fragment file - feat: adapter for media check result - refactor: confirm media check dialog
ea860b9
to
a54afbf
Compare
- refactor: replace media check result dialog with fragment - refactor: remove unused parameter in Media.kt
a54afbf
to
73ce17e
Compare
Purpose / Description
Migrates the logic of MediaCheck to ViewModel
Split the dialog logic, use different dialog for result and conformation
Fixes
Approach
Use ViewModel to handle the media check dialog and its result
How Has This Been Tested?
Tested on Google emulator API31
Screen_recording_20250220_045658.webm
Checklist
Please, go through these checks before submitting the PR.