Search code examples
androidandroid-layoutandroid-search

Android SearchView customisation


im new to android and i got stucked on something that i think it's simple but i got confused.. I need to make a custom searchView not in the actionbar/toolbar but in my Relativelayout. The problem is that i don't know hot to customise the background , textinput color , the search icon color in XML , or just the attributes of them . At the moment im on my phone and can't show my code . Does anyone tell me how i can customise it ? Maybe showing me any tutorial i can follow ? Thanks in advance !!!!


Solution

  • I suggest you to look at my answer I gave here to style your own SearchBar.

    I can't get the reason but I couldn't style Google's default SearchBar so I had to create my own Search bar.

    Here's how I did:

    Styling Search View on Android (min21)

    If you want to implement an InstantSearch algorithm follow this great author and his project (look at the accepted answer):

    How to filter a RecyclerView with a SearchView

    If you need further help just leave a comment. If the answer helped also upvote my answer :P

    UPDATE: Here's Google's implementation of the Search View, just to give you more information: https://developer.android.com/guide/topics/search/search-dialog.html

    Have a nice day :)