Skip to content

Improve deck selection dialog code#20889

Open
lukstbit wants to merge 4 commits intoankidroid:mainfrom
lukstbit:refactor_deckSelectionDialogCode
Open

Improve deck selection dialog code#20889
lukstbit wants to merge 4 commits intoankidroid:mainfrom
lukstbit:refactor_deckSelectionDialogCode

Conversation

@lukstbit
Copy link
Copy Markdown
Member

Purpose / Description

Improves and simplifies the code in DeckSelectionDialog for further changes.

Note: most of the changes are simple, the only change that is more complex was done in CardBrowser/CardBrowserFragment because we have multiple actions that can be done in response to a deck being selected.

Fixes

How Has This Been Tested?

Ran the tests, verified deck selection where it was used.

Checklist

  • 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

@lukstbit lukstbit added Needs Review Next version Changes to be merged in the next version, to keep the current release stable. labels Apr 29, 2026
@lukstbit lukstbit marked this pull request as draft April 29, 2026 16:17
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.

One bug, LGTM in general. I strongly dislike this selector, thank you!!!

Comment thread AnkiDroid/src/main/java/com/ichi2/anki/dialogs/DeckSelectionDialog.kt Outdated
Comment thread AnkiDroid/src/main/java/com/ichi2/anki/dialogs/DeckSelectionDialog.kt Outdated
Comment thread AnkiDroid/src/main/java/com/ichi2/anki/CardBrowser.kt Outdated
@lukstbit lukstbit force-pushed the refactor_deckSelectionDialogCode branch from 7a7fdfb to 71e7d55 Compare May 2, 2026 13:50
@lukstbit lukstbit marked this pull request as ready for review May 2, 2026 14:03
lukstbit added 4 commits May 6, 2026 12:23
Identical behavior with BundleCompat.getParcelable().
Due to the formatter using BundleCompat.getParcelable is verbose and
this extension simplifies call sites a bit.
Adds all the parameters that will be used by the dialog.
Also simplifies the call sites by using default parameters.

"summary" and "restore default" arguments were combined into a single
string property, it's only used by CardTemplateEditor and one implies
the other.
@lukstbit lukstbit force-pushed the refactor_deckSelectionDialogCode branch from 71e7d55 to b12e05c Compare May 6, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Next version Changes to be merged in the next version, to keep the current release stable.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants