MaterialSearchBar icon indicating copy to clipboard operation
MaterialSearchBar copied to clipboard

Controlling clear button

Open ubedthaheem opened this issue 4 years ago • 1 comments

this is an amazing searchview with multi-functionalities, but there is missing an option for controlling CLEAR button. i've changed .setClearIcon() to search icon but i am unable to control this function. what i want is, when user type more than 3 keywords CLEAR icon should be changed into SEARCH icon and it should be controllable through onButtonClicked() method of setOnSearchActionListener() , so that's why i changed only icon through onTextChanged() .

ubedthaheem avatar Dec 28 '19 11:12 ubedthaheem

when you call onSearchActionListener you control all buttons in this section.

@Override public void onButtonClicked(int buttonCode) { if(buttonCode == MaterialSearchBar.BUTTON_NAVIGATION) { //opening or closing navigation drawer } else if ( buttonCode == MaterialSearchBar.BUTTON_BACK) { materialSearchBar.disableSearch(); } }

LukaLakicevic avatar Jul 05 '20 10:07 LukaLakicevic