Skip to content

fix(change-note-type): add touch listener to the note type name area in the "To" card - #22659

Open
snowtimeglass wants to merge 1 commit into
ankidroid:mainfrom
snowtimeglass:make-text-in-To_card-clicable
Open

snowtimeglass wants to merge 1 commit into
ankidroid:mainfrom
snowtimeglass:make-text-in-To_card-clicable

Conversation

@snowtimeglass

Copy link
Copy Markdown
Contributor

Note

Assisted-by: Gemini 3.5 Flash Lite

Purpose / Description

Enable users to open the dropdown menu by tapping the note type name displayed in the "To" card.

Fixes

Approach

Adds an OnTouchListener to the CheckedTextView

  • Sets the ripple hot spot on the "To" card
  • Clicks the "To" card if the text area is tapped
  • Ignores long-press

How Has This Been Tested?

Checked on Emulator (API 37.0)

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

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Snapshot diff report: Previous regressions were resolved by the latest commit.

@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.

This seems complicated, are you sure there's not a simpler way?

@snowtimeglass

snowtimeglass commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor Author

I'm not entirely sure about it, but other simpler approaches I tried didn't work.
For example, I tried an approach using isClickable = false to disable clicking on the checkedTextView and pass touch events directly to the parent card, but it didn't work.

@david-allison

This comment was marked as resolved.

@david-allison david-allison added the Needs Author Reply Waiting for a reply from the original author label Oct 21, 2026
@snowtimeglass

Copy link
Copy Markdown
Contributor Author

Thank you, but it doesn't quite seem to do enough. For now, I expect that touching the selected note type area triggers a ripple, just like touching other area of the "To" card.

@david-allison david-allison removed the Needs Author Reply Waiting for a reply from the original author label Oct 22, 2026
@david-allison

This comment was marked as resolved.

@snowtimeglass

Copy link
Copy Markdown
Contributor Author

Thank you, but I'm not sure whether setting the tooltip on the entire "To" card (rather than just the selected note type name area) would be a desirable change in terms of UI. It might be a bit excessive. What do you think?

image

@david-allison

Copy link
Copy Markdown
Member

I feel it's fine personally. @ZornHadNoChoice ?

@ZornHadNoChoice

ZornHadNoChoice commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Tapping anywhere within the blue box should open the drop down menu in my opinion.

Also, the weird black tooltip shouldn't be visible, obviously. [Edit: I realized now that it's the note type's name and it appears on long pressing. I don't care about it then.]

@snowtimeglass

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback. I'll go with that, then.

To keep things consistent, I'm going to set the tooltip on the entire "From" card as well.

 private fun setupNoteTypeSpinner(binding: DialogChangeNoteTypeBinding) {
+         binding.fromCard.setTooltipTextCompat(viewModel.inputNoteType.name)
          binding.CardEditorModelText.text = BidiFormatter.getInstance().unicodeWrap(viewModel.inputNoteType.name)
-         binding.CardEditorModelText.setTooltipTextCompat(viewModel.inputNoteType.name)
image

@david-allison david-allison added the Needs Author Reply Waiting for a reply from the original author label Oct 24, 2026
@snowtimeglass
snowtimeglass force-pushed the make-text-in-To_card-clicable branch from cd3a18c to 191f6ae Compare October 25, 2026 10:57

@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.

Cheers!

@david-allison david-allison added Needs Second Approval Has one approval, one more approval to merge and removed Needs Author Reply Waiting for a reply from the original author Needs Review labels Oct 25, 2026

@mikehardy mikehardy 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.

Assisted-by: grok-4.7-medium

Thanks for the change-note-type touch target work.

No local prep run this pass — required GitHub Actions unit matrix legs failed before prep (JUnit Tests (ubuntu run 1) and JUnit Tests (windows run 1)).

Please get those required unit jobs green on the current tip; I will re-run full local prep once CI is passing.

@mikehardy mikehardy added the Needs Author Reply Waiting for a reply from the original author label Oct 27, 2026
- Adds OnTouchListener to destNoteTypeSpinner, which enables users
to open the dropdown menu by tapping the note type name displayed
in the "To" card.

- Adds unit tests covering tap, drag-cancel, long-press, and tooltip
behavior for the "To" card.

- Adds tooltip to the "From" card for consistency

Co-authored-by: David Allison <62114487+david-allison@users.noreply.github.com>
Assisted-by: GPT-6 Astra xhigh (David's)
@david-allison
david-allison force-pushed the make-text-in-To_card-clicable branch from 191f6ae to 72781f1 Compare October 27, 2026 13:47
@david-allison

Copy link
Copy Markdown
Member

Rebased on main; should fix the tests

@david-allison david-allison removed the Needs Author Reply Waiting for a reply from the original author label Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Has Conflicts Needs Second Approval Has one approval, one more approval to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In "Change note type" screen, tapping the text of the selected note type in the "To" card doesn't open the selection list

4 participants