Material-SearchView
VyacheslavShmakin
29
Visit GitHub RepoSearch Inputs

Material-SearchView

SearchView library based on DialogFragment

Download

Gradle:

compile 'com.github.VyacheslavShmakin.material-searchview:1.1.3'

Maven:

<dependency>
    <groupId>com.github.VyacheslavShmakin</groupId>
    <artifactId>material-searchview</artifactId>
    <version>1.1.3</version>
    <type>aar</type>
</dependency>

Usage

In Code

SearchView searchView = SearchView.getInstance(this);
DataAdapter adapter = new DataAdapter(this, getItems());
searchView.setSuggestionAdapter(adapter);
searchView.setOnVisibilityChangeListener(this);
searchView.setQuery("queryTest", false);

SearchView should be called by using your menu item:

...
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch(item.getItemId()) {
        case R.id.yourItemId:
            return searchView.onOptionsItemSelected(getFragmentManager(), item);
        default:
            return super.onOptionsItemSelected(item);
    }
}
...
Become a better Android Developer
Millions of developers are learning at MindOrks

Online Training Program

Featured Blogs

Our Team

MindOrks is Certainly one of the best online blog to stay on top of all the Android development news, coding and design patterns. Finally a blog I can count on to keep myself updated with latest and greatest things happening in Android world.

Vipul Shah
Android Developer
Microsoft

Become Pro in Android by watching videos

OUR LEARNERS WORK AT