Closed VuHongKy closed 8 years ago
Same with cross that erases text
Hi, @VuHongKy, @TheRishka
To clarify, the "showSearchKey"
attribute is for setting if you want to see the search button in the SoftKeyboard
or not, it has nothing to do with the EditText
clearing the text. Now, the query should indeed stay in the search bar when the search gains focus, but there is a minor bug that causes it to reset.
A temporary workaround would be to use https://github.com/arimorty/floatingsearchview/blob/master/library/src/main/java/com/arlib/floatingsearchview/FloatingSearchView.java#L1114 when the focus clears, like this:
mSearchView.setOnFocusChangeListener(new FloatingSearchView.OnFocusChangeListener() {
@Override
public void onFocus() {
//grab the query mSearchView.getQuery() and swapSuggestions accordingly
}
@Override
public void onFocusCleared() {
mSearchView.setSearchText(mSearchView.getQuery());
}
});
Thanks, @arimorty I tried to setOnFocusChangeListener() before, but I don't know how to set search query. Thanks for your guide. I'm trying now.
Hi @arimorty I set query when focus search bar, but in that case, query != null, but clear button doesn't show. ??? What can i do now? Thanks.
@VuHongKy a fix for "but clear button doesn't show" which is also mentioned in #91 is in develop and will be part of the next release.
Thanks,
Hi guy, I set "showSearchKey" attr = "true". But it only effects on first typing, but when I clicked search action button, seem it back to "false". Because I found that when I focus on edit-text, current typing text was not shown and back to empty. Why not? I want to set showSearchKey attr always effect. Why can I do that? Please help.