So what I did to change the style is to change our styles.xml.
<style name="ToolbarTheme"> <item name="android:textColorPrimary">#fff</item> <item name="colorControlNormal">#fff</item> <item name="colorControlHighlight">#3fff</item> <item name="android:listPopupWindowStyle">@style/ToolbarPopupListStyle</item> <item name="listPopupWindowStyle">@style/ToolbarPopupListStyle</item> <item name="android:textAppearanceLargePopupMenu">@style/PopupMenuTextAppearance</item> <item name="textAppearanceLargePopupMenu">@style/PopupMenuTextAppearance</item> </style> <style name="ToolbarStyle"> <item name="android:background">?colorPrimary</item> <item name="android:titleTextAppearance">@style/collapsedToolbarText</item> <item name="titleTextAppearance">@style/collapsedToolbarText</item> </style> <style name="ToolbarPopupListStyle"> <item name="android:popupBackground">#00ff00</item> </style> <style name="PopupMenuTextAppearance" parent="android:TextAppearance.Small"> <item name="android:textColor">#ff0000</item> </style>
Of course, these styles should be specified in the layout file referenced by the toolbar:
<android.support.v7.widget.Toolbar android:id="@+id/toolbar_toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="@android:color/transparent" app:layout_collapseMode="pin" app:theme="@style/ToolbarTheme" style="@style/ToolbarStyle"/>
I have a strange feeling, however, that styles should have a parent style. But it works like that.
Thanks to @Brian who pointed me in the right direction.
Raul pinto
source share