I was developing a little example to test some things when I came across to implementing a SearchView. After reading the documentation in the Material Design guidelines, I started searching for a third party library to easily implement it. I didn’t find anything useful, so I developed it myself.
What is MaterialSearchView?
MaterialSearchView is a cute library to implement SearchView in a Material Design Approach.
How do I use it?
Add the dependencies to your gradle file:
Add MaterialSearchView to your layout file along with the Toolbar(Add this block at the bottom of your layout, in order to display it over the rest of the view):
Add the search item into the menu file:
Add define it in the onCreateOptionsMenu:
Set the listeners:
Allow/Disable it in the code:
Handle the response:
Define them in the resources as a string-array:
Add them to the object:
Close on backpressed:
Pull requests are more than welcome, help me and others improve this awesome library.
The code is based in the Krishnakapil original concept.
MaterialSearchView is hosted with GitHub. Head to the GitHub repository for downloads, bug reports, and features requests.|