/SearchView

Persistent SearchView Library in Material Design.

Primary LanguageJavaApache License 2.0Apache-2.0

SearchView

Note: Version 1.6 is not compatible with 1.5. And Toolbar version is not done yet.

Persistent SearchView Library with history in Material Design. It supports layout like section My apps in Google Play Store. https://www.google.com/design/spec/patterns/search.html.

Material colors in the project: https://gist.github.com/lapism/3b417142300d9dbde3b4

Sample application on:

Get it on Google Play

Usage

Add the dependencies to your gradle file:

dependencies {
        compile 'com.lapism:searchview:1.6'
        }

![Screenshot 1] (https://github.com/lapism/SearchView/blob/master/images/image_1.png)

In code (Check the Sample project!):

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
        case R.id.action_search: {
            mSearchView.showSearch();
            return true;
        }
        default:
            return super.onOptionsItemSelected(item);
    }
}

In xml (Check the Sample project!):

<com.lapism.searchview.SearchView
    android:id="@+id/search_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />
        
You can find examples of layouts in the Sample project !!!     

Styling SearchView:

app:search_version = "toolbar / menu_item"
app:search_style = "classic / color"
app:search_version = "light / dark"
app:search_divider = "true / false"
app:search_hint = "Hint text"
app:search_hint_size = "16sp"
app:search_voice = "true / false"
app:search_voice_text = "Voice text"
app:search_animation_duration = "360"