Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Recent Query Suggestions #495

Open
AEFeinstein opened this issue Nov 13, 2019 · 2 comments
Open

Add Recent Query Suggestions #495

AEFeinstein opened this issue Nov 13, 2019 · 2 comments

Comments

@AEFeinstein
Copy link
Owner

Modify CardSearchProvider to return a cursor with recent queries when a search is performed. I think this requires creating a new database table for recent queries and returning a cursor to that table's columns when there is no text to suggest with yet.

It also requires saving queries to that table whenever a search by name is performed from anywhere.

Android documentation: https://developer.android.com/guide/topics/search/adding-recent-query-suggestions.html

@ivancea
Copy link
Contributor

ivancea commented Jan 17, 2020

The name AutoCompleteTextView is already showing matching card names.
How do you want to also add recent queries? Maybe show like the last 2 queries and below the cards to autocomplete? Any idea about that?

@AEFeinstein
Copy link
Owner Author

The idea isn't to show the recent and autocomplete options at the same time. The string to match is in selectionArgs[0] and if that's two or fewer characters long, instead of returning the cursor from getCardsByNamePrefix() (or null) you'd return a cursor of recent search terms. That cursor just needs a column called KEY_NAME.

To populate that database, you need to save the name from where SearchViewFragment creates ResultListFragments and case Intent.ACTION_SEARCH in FamiliarActivity. I think those are the only locations searches are done from.

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

No branches or pull requests

2 participants