Closed yangli1120 closed 8 years ago
look at https://github.com/ayaseruri/floatingsearchview
I changed :
void onSearchAction() ==> onSearchAction(String query)
void onFocus() ==> onFocus(String query)
those can help you to handle search event better;
i also add 'floatingSearch_setQueryAsTitle' attributable, the search edittext will not clean the edittext while search if you set the attributable 'true';
@YoungLeeForeverBoy You can make use of the following to achieve what you want:
First, keep track of your current text in your code and then use the methods below. mSearchView.setSearchBarTitle() - to set the text in the input, but the text will clear once the search gains focus mSearchView.setSearchText(); - to set the text in the input, and the text will NOT clear once the search gains focus
thank you:)
@ayaseruri Your idea works, thanks.
Hi, I see this code: mSearchInput.setOnKeyListener(new OnKeyListener() {
the EditText will clear text at "setSearchFocusedInternal(false);", and I can't get the query string at onSearchAction(), because I want toggle a search action when user click the search action key at keyboard :(