floatingsearchview
floatingsearchview copied to clipboard
Right clear button jumps when menu is present
As you can see (in the attached gif) the right clear (cross) button jumps (no animation) It looks really wired on a physical device.
My "onFocus" code looks like this
mSearchView.setOnFocusChangeListener(new FloatingSearchView.OnFocusChangeListener() {
@Override
public void onFocus() {
// Demo Suggestions
List<SearchResult> myList = new ArrayList<>();
myList.add(new SearchResult(true, "", "Game"));
myList.add(new SearchResult(true, "", "movie"));
myList.add(new SearchResult(true, "", "Search result"));
myList.add(new SearchResult(true, "", "New result"));
mSearchView.swapSuggestions(myList);
// so the user can edit their last query
if (!TextUtils.isEmpty(mLastQuery)) mSearchView.setSearchText(mLastQuery);
}
});
I found a quick and dirty workaround for this problem. I modified the code in library. In FloatingSearchView.java
there is function called public void hideIfRoomItems(boolean withAnim)
. Now I just added line withAnim = false;
and set it false for all cases. Now this isn't exactly a solution but it's a quick workaround.
Hope this helps.