floatingsearchview icon indicating copy to clipboard operation
floatingsearchview copied to clipboard

Right clear button jumps when menu is present

Open shifatul-i opened this issue 6 years ago • 1 comments

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);
    }
});

test

shifatul-i avatar Aug 03 '17 04:08 shifatul-i

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.

jbhv12 avatar Sep 20 '17 14:09 jbhv12