I’m trying to change search suggestions to “light theme”. I’m using appcompat-v7:22.2.0 library and read about new feature for customizing search view widget (android.support.v7.widget.SearchView).
FIRST TRY SECTION
Toolbar
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
Main Theme
<style name="Main.Theme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/red</item>
<item name="colorPrimaryDark">@color/red_dark</item>
<item name="searchViewStyle">@style/Main.Theme.SearchView</item>
</style>
SearchView Theme
<style name="Main.Theme.SearchView" parent="Widget.AppCompat.Light.SearchView">
<item name="voiceIcon">@mipmap/test_icon</item>
</style>
This way I'm not able to affect the search view. To test it I'm changing the voice icon in the search view, and it doesn't change from default.
SECOND TRY SECTION
The second try was to override the overlay theme in toolbar:
Overlay Theme
<style name="Main.Theme.Overlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="searchViewStyle">@style/Main.Theme.SearchView</item>
</style>
This way I've some feedback, but I lose "material design", in particular I've the "old" hint icon and it's underlined. My final aim is to change the search suggestion row background:
Suggestion row layout
<item name="suggestionRowLayout">@layout/my_custom_layout</item>
I think that I'm far away to accomplish this...can you help me?


This is how I am using my own search suggestions...
This is my
CountriesFragmentfile that just show all country name in suggestions.The trick here is that I am providing custom View to Suggestion list to show.
here is the
hint_row.xmlSimple menu file having SearchView.
menu.xmlI am getting this beautiful suggestions...