Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controlling clear button #126

Open
ubedthaheem opened this issue Dec 28, 2019 · 1 comment
Open

Controlling clear button #126

ubedthaheem opened this issue Dec 28, 2019 · 1 comment

Comments

@ubedthaheem
Copy link

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() .

@LukaLakicevic
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants