52inc/Scoops

Toolbar remain same color after change theme.

Closed this issue · 6 comments

Hi, how to instantly change toolbar color after change theme? Its work with actionbar but not work with toolbar.

How are you setting the background color for your toolbar? It needs to be set to ?attr/colorPrimary or it won't dynamically apply

See: https://github.com/52inc/Scoops/blob/master/scoops-sample/src/main/res/layout/activity_main.xml

same.... just now already try. I copy it and paste then change theme still the same

Can you post your themes that your are trying to switch between?

Scoop.waffleCone()
.addFlavor("Default", R.style.Theme_Scoop, true)
.addFlavor("Light", R.style.Theme_Scoop_Light)
.addDayNightFlavor("DayNight", R.style.Theme_Scoop_DayNight)
.addFlavor("Alternate 1", R.style.Theme_Scoop_Alt1)
.addFlavor("Alternate 2", R.style.Theme_Scoop_Alt2)
.setSharedPreferences(PreferenceManager.getDefaultSharedPreferences(this))
.initialize();

I tried switch those theme.... toolbar still same color

<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme">

I figure it out.... i put theme in appbarlayout so i remove it, then its work.
Thanks