Skip to content

Repository files navigation

SearchView

Persistent SearchView Library like Play Store.
Check sample project very thoroughly !!!
Features: Material Design, Toolbar / Menu item version, History, Styling.
Google Material Design Pattern:
https://www.google.com/design/spec/patterns/search.html
Version history here:
https://bintray.com/lapism/maven/searchview/view
Material colors in the project:
https://gist.github.com/lapism/3b417142300d9dbde3b4
Sample application on:
Get it on Google Play

Because I have done firstly this library as a private project, I would like to know if someone of you use my library in your application. If yes, please send me a name of your app and link to Play Store and I will promote your app in Readme.

Apps using this library:

Service Notes
Business Card Reader
Toiletto


Usage

Add the dependencies to your gradle file:

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

![Screenshot 1] (https://github.com/lapism/SearchView/blob/master/images/image_1.png)![Screenshot2] (https://github.com/lapism/SearchView/blob/master/images/image_2.png)![Screenshot 3] (https://github.com/lapism/SearchView/blob/master/images/image_3.png)![Screenshot 4] (https://github.com/lapism/SearchView/blob/master/images/image_4.png)![Screenshot 5] (https://github.com/lapism/SearchView/blob/master/images/image_5.png)![Screenshot 6] (https://github.com/lapism/SearchView/blob/master/images/image_6.png)

Code:

@OverridepublicbooleanonOptionsItemSelected(MenuItemitem) {
switch (item.getItemId()) {
caseR.id.action_search: {
mSearchView.show(true/false); // animate, ONLY FOR MENU ITEMreturntrue;
}
default:
returnsuper.onOptionsItemSelected(item);
}
}

XML:

<com.lapism.searchview.SearchView
android:id="@+id/searchView"android:layout_width="match_parent"android:layout_height="match_parent" />

Styling SearchView:

 <attrname="search_version"format="enum">
<enumname="toolbar"value="1000" />
<enumname="toolbar_icon"value="1001" />
<enumname="menu_item"value="1002" />
</attr>
<attrname="search_version_margins"format="enum">
<enumname="toolbar_small"value="2000" />
<enumname="toolbar_big"value="2001" />
<enumname="menu_item"value="2002" />
</attr>
<attrname="search_theme"format="enum">
<enumname="light"value="3000" />
<enumname="dark"value="3001" />
</attr>
<attrname="search_navigation_icon"format="integer" />
<attrname="search_icon_color"format="color" />
<attrname="search_background_color"format="color" />
<attrname="search_text"format="string" />
<attrname="search_text_color"format="color" />
<attrname="search_text_highlight_color"format="color" />
<attrname="search_text_size"format="dimension" />
<attrname="search_text_style"format="enum">
<enumname="normal"value="0" />
<enumname="bold"value="1" />
<enumname="italic"value="2" />
<enumname="bold_italic"value="3" />
</attr>
<attrname="search_hint"format="string" />
<attrname="search_hint_color"format="color" />
<attrname="search_divider"format="boolean" />
<attrname="search_voice"format="boolean" />
<attrname="search_voice_text"format="string" />
<attrname="search_animation_duration"format="integer" />
<attrname="search_shadow"format="boolean" />
<attrname="search_shadow_color"format="boolean" />
<attrname="search_elevation"format="dimension" />
<attrname="search_clear_on_close"format="boolean" />
<attrname="search_clear_on_open"format="boolean" />

About

Persistent SearchView Library in Material Design.

Resources

Stars

0 stars

Watchers

10 watching

Forks

Releases

Packages

Contributors

Languages