Toolbar theme does not apply to styles (22.1.0)

Prior to appomppat 22.1.0, I was able to define a global style for the apps toolbars in styles.xml.

<item name="toolbarStyle">@style/AppTheme.Widget.Toolbar</item>


My global toolbar style declared a theme attribute for the toolbar:

<style name="AppTheme.Widget.Toolbar" parent="Widget.AppCompat.Toolbar">
       <item name="theme">@style/AppTheme.Widget.Toolbar.ThemeOverlay</item>


After updating to 22.1.0 and changing the theme attribute for the new android attribute : theme theme no longer applies. If I declare this theme in the toolbar in layout.xml it works.

How do I declare a global theme for toolbars with a global style?


source to share

1 answer

This is not a bug as it android:theme

matters more over any style (styles get their values ​​from themes).

This worked in previous versions as a side effect of the implementation. The implementation is now much closer to how it LayoutInflater

works in Android 5.0+.



All Articles