Skip to content

fix(controls): improve post-assignment dialog - #21571

Open
Sanjeev-Narang wants to merge 1 commit into
ankidroid:mainfrom
Sanjeev-Narang:fix/improve-post-assignment-dialog
Open

fix(controls): improve post-assignment dialog#21571
Sanjeev-Narang wants to merge 1 commit into
ankidroid:mainfrom
Sanjeev-Narang:fix/improve-post-assignment-dialog

Conversation

@Sanjeev-Narang

Copy link
Copy Markdown

Purpose / Description

The 'Only answer' option is supposed to remove the binding from 'Show answer' but it was not doing that. The dialog's appearance was not consistent with the previous subsequent dialogs in controls. Also need to implement option 3 mentioned in the issue.

Fixes

Approach

  1. Update the preference resource file Strings according to the option 3.
  2. In Fragment, replace the items list and logic, with a question message and consistent buttons
  3. Correct the 'No' ( previously 'only answer') logic.

Before:
image

After:
image

How Has This Been Tested?

Unit test, API36

Learning (optional, can help others)

Learnt about controls setting and the issue related codebase of AnkiDroid

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

@welcome

welcome Bot commented Aug 20, 2026

Copy link
Copy Markdown

First PR! 🚀 We sincerely appreciate that you have taken the time to propose a change to AnkiDroid! Please have patience with us as we are all volunteers - we will get to this as soon as possible.

@github-actions

Copy link
Copy Markdown
Contributor

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

@david-allison david-allison left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Handle the case where the binding is already assigned to 'Show answer': - 'No' will remove it without confirmation.

I'd question using yes/no over more descriptive strings. Material design used to discourage yes/no.

@manocormen FYI - I'll defer to your thoughts here

Comment on lines 244 to 248
val items =
arrayOf(
getString(R.string.only_answer),
getString(R.string.flip_and_answer),
getString(R.string.dialog_yes),
getString(R.string.dialog_no),
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: inline this, we're no longer calling setItems(items)

@david-allison david-allison added Needs Author Reply Waiting for a reply from the original author Needs reviewer reply Waiting for a reply from another reviewer labels Aug 21, 2026
@manocormen

Copy link
Copy Markdown
Contributor

Material 3 seem to still discourage yes/no, so instead we could use:

  • Positive case: "Assign it".
  • Negative case: "Don't assign it", and when it's already assigned, "Unassign it", to make the removal explicit.

@Sanjeev-Narang

Sanjeev-Narang commented Aug 23, 2026

Copy link
Copy Markdown
Author

@manocormen since we are discussing a more descriptive alert dialog, perhaps you could reconsider my earlier implementation:
#20759 (comment)

@david-allison Happy to update the PR once changes are decided.

@manocormen

Copy link
Copy Markdown
Contributor

@Sanjeev-Narang In your earlier design, I liked the concision of "Keep" / "Remove", but I found the dialog at tad confusing in context: we've just assigned a gesture to action1, and now we're told "The gesture is already assigned to action2": to me, it makes it sound like a conflict, so I'd favor Zorn's simpler design (but with descriptive buttons).

@david-allison I'm not sure this is on the table, but we could also simplify: remove the secondary dialog altogether.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Author Reply Waiting for a reply from the original author Needs Review Needs reviewer reply Waiting for a reply from another reviewer New contributor Strings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve post-assignment dialog for Answer actions in Controls

3 participants