Skip to content

Refactor(MediaCheckDialog): Media check to use ViewModel#17943

Merged
david-allison merged 2 commits intoankidroid:mainfrom
criticalAY:media-dialog-viewmodel
Mar 24, 2025
Merged

Refactor(MediaCheckDialog): Media check to use ViewModel#17943
david-allison merged 2 commits intoankidroid:mainfrom
criticalAY:media-dialog-viewmodel

Conversation

@criticalAY
Copy link
Copy Markdown
Contributor

@criticalAY criticalAY commented Feb 8, 2025

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.

  • 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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 8, 2025

Important

Maintainers: This PR contains Strings changes

  1. Sync Translations before merging this PR and wait for the action to complete
  2. Review and merge the auto-generated PR in order to sync all user-submitted translations
  3. Sync Translations again and merge the PR so the huge automated string changes caused by merging this PR are by themselves and easy to review

@criticalAY criticalAY changed the title Ref(MediaCheckDialog): Media check to use ViewModel Refactor(MediaCheckDialog): Media check to use ViewModel Feb 8, 2025
@criticalAY criticalAY added the Blocked by dependency Currently blocked by some other dependent / related change label Feb 8, 2025
@criticalAY criticalAY force-pushed the media-dialog-viewmodel branch from bc072d9 to 7a503ca Compare February 9, 2025 17:14
@criticalAY criticalAY force-pushed the media-dialog-viewmodel branch 2 times, most recently from 18ef3d5 to 6b62901 Compare February 10, 2025 13:52
@criticalAY criticalAY added Needs Review and removed Blocked by dependency Currently blocked by some other dependent / related change Has Conflicts labels Feb 10, 2025
@criticalAY criticalAY force-pushed the media-dialog-viewmodel branch from 6b62901 to 337a7d4 Compare February 17, 2025 20:42
@criticalAY criticalAY added the Needs Author Reply Waiting for a reply from the original author label Feb 19, 2025
@criticalAY criticalAY force-pushed the media-dialog-viewmodel branch 3 times, most recently from 93508d4 to 124a991 Compare February 19, 2025 23:25
@criticalAY criticalAY removed the Needs Author Reply Waiting for a reply from the original author label Feb 19, 2025
@criticalAY
Copy link
Copy Markdown
Contributor Author

criticalAY commented Feb 19, 2025

  • I have updated the latest test recording

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

@criticalAY criticalAY force-pushed the media-dialog-viewmodel branch 2 times, most recently from 9090d16 to 37301c4 Compare February 19, 2025 23:47
@david-allison david-allison added the Review High Priority Request for high priority review label Feb 20, 2025
Copy link
Copy Markdown
Member

@lukstbit lukstbit left a 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.

@lukstbit lukstbit added the Needs Author Reply Waiting for a reply from the original author label Feb 23, 2025
@criticalAY criticalAY force-pushed the media-dialog-viewmodel branch 2 times, most recently from 6ef3989 to 425ac64 Compare February 24, 2025 09:01
@criticalAY criticalAY force-pushed the media-dialog-viewmodel branch from 1ce4763 to 2500af3 Compare March 19, 2025 18:27
@criticalAY criticalAY removed the Needs Author Reply Waiting for a reply from the original author label Mar 19, 2025
@Arthur-Milchior
Copy link
Copy Markdown
Member

Yeah, fine for me.
I guess I'll need to suggest to update upstream first then.

feat: add media check fragment file
- feat: adapter for media check result
- refactor: confirm media check dialog
- refactor: replace media check result dialog with fragment
- refactor: remove unused parameter in Media.kt
@criticalAY criticalAY force-pushed the media-dialog-viewmodel branch from 6e4bd81 to aafcb92 Compare March 24, 2025 07:01
Copy link
Copy Markdown
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

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

Looks great, cheers!

@david-allison david-allison added Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) and removed Review High Priority Request for high priority review Needs Second Approval Has one approval, one more approval to merge labels Mar 24, 2025
@david-allison david-allison added this pull request to the merge queue Mar 24, 2025
Merged via the queue into ankidroid:main with commit dc37ead Mar 24, 2025
9 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

Maintainers: Please Sync Translations to produce a commit with only the automated changes from this PR.

Read more about updating strings on the wiki,

@github-actions github-actions bot removed the Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) label Mar 24, 2025
@github-actions github-actions bot added this to the 2.21 release milestone Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

App becomes unresponsive after clicking Check media

4 participants