Skip to content

Fix: restore keyboard/D-pad control of deck picker FAB menu#21201

Open
criticalAY wants to merge 1 commit into
ankidroid:mainfrom
criticalAY:fix-action-fab
Open

Fix: restore keyboard/D-pad control of deck picker FAB menu#21201
criticalAY wants to merge 1 commit into
ankidroid:mainfrom
criticalAY:fix-action-fab

Conversation

@criticalAY
Copy link
Copy Markdown
Contributor

@criticalAY criticalAY commented Jun 2, 2026

Note

Assisted-by: Claude Opus 4.8

Purpose / Description

Fixes

Approach

See commit

How Has This Been Tested?

tests and manually tested on emulator

Learning (optional, can help others)

NA

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

@criticalAY criticalAY added the Blocked by dependency Currently blocked by some other dependent / related change label Jun 2, 2026
The main FAB registered two OnKeyListeners in init. A View keeps only
the last one, so the second registration silently overwrote the first,
dropping ENTER/DPAD_CENTER opening the menu when closed and ESCAPE
closing it when open.
Consolidate into a single OnKeyListener and remove the duplicate, keeping
behavior consistent with fabMainClickListener. Add regression tests for
the ENTER and ESCAPE paths.
@criticalAY criticalAY removed Blocked by dependency Currently blocked by some other dependent / related change Has Conflicts labels Jun 4, 2026
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 missing annotation as a blocker, rest LGTM, cheers!

assertThat("FAB menu opens on click", floatingActionMenu.isFABOpen, equalTo(true))
}

fun `FAB menu opens on ENTER key`() =
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.

Suggested change
fun `FAB menu opens on ENTER key`() =
@Test
fun `FAB menu opens on ENTER key`() =

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think i missed it when i was resolving conflicts thanks

Comment thread AnkiDroid/src/test/java/com/ichi2/anki/DeckPickerTest.kt
@david-allison david-allison added the Needs Author Reply Waiting for a reply from the original author label Jun 4, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add FAB menu can't be opened/closed with a hardware keyboard

2 participants