Skip to content

fix(card-browser): search issues#20444

Open
david-allison wants to merge 5 commits intoankidroid:mainfrom
david-allison:fix-search-terms
Open

fix(card-browser): search issues#20444
david-allison wants to merge 5 commits intoankidroid:mainfrom
david-allison:fix-search-terms

Conversation

@david-allison
Copy link
Member

@david-allison david-allison commented Mar 12, 2026

Purpose / Description

Massive thanks to Zorn here.

Two issues:

  1. I messed up and kept a searchTerms variable around
  2. There is an incompatibility with MenuProvider and the Material 2 androidx.appcompat.widget.SearchView
  • State is no longer restored when using MenuProvider, causing keyboard flickers to occur.

Fixes

Approach

  1. Replace searchTerms with a derived value from the new SearchRequest class
  2. Work around this issue, in 1 case by modifying the menu directly, to stop a flicker, in the other, manually close the keyboard after a search

How Has This Been Tested?

API 33 phone emulator

  • Used the Card browser shortcut
  • Typed text into the search bar - no more keyboard flicker

Learning (optional, can help others)

I will be SO glad when we get rid of the old SearchView, it's the cause of so much bad code

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

Previously, searchTerms was populated, but `SearchRequest` should
 have been used

As this was checked in the UI, it caused a hang

Fixes 20440
@david-allison david-allison added this to the 2.24 release milestone Mar 12, 2026
@david-allison david-allison added the Review High Priority Request for high priority review label Mar 12, 2026
MenuProvider no longer restores state, so the keyboard flickers

Caused by incompatibilities with `MenuProvider`
 and the Material 2 `SearchView`

Fixed by special casing this issue. We want to get away from
 SearchView
Caused by incompatibilities with `MenuProvider`
 and the Material 2 `SearchView`

HACK: call `clearFocus`, we're getting rid of the old
 `SearchView`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Review High Priority Request for high priority review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[2.24.0alpha8] Card browser context menu is broken

1 participant