Note that there are some explanatory texts on larger screens.

plurals
  1. POChange generated action bar theme from Android Asset Studio
    text
    copied!<p>I have used Android Asset Studio to generate action bar style, however i woul like to do some changes, which I was unable to do in Studio, so I edited generated theme but lot of things was just ignored, and I just can't figure out how things work. There is example: `</p> <pre><code>&lt;style name="Theme.Myactionbar" parent="@style/Theme.AppCompat.Light"&gt; &lt;item name="actionBarItemBackground"&gt;@drawable/selectable_background_myactionbar&lt;/item&gt; &lt;item name="popupMenuStyle"&gt;@style/PopupMenu.Myactionbar&lt;/item&gt; &lt;item name="dropDownListViewStyle"&gt;@style/DropDownListView.Myactionbar&lt;/item&gt; &lt;item name="actionBarTabStyle"&gt;@style/ActionBarTabStyle.Myactionbar&lt;/item&gt; &lt;item name="actionDropDownStyle"&gt;@style/DropDownNav.Myactionbar&lt;/item&gt; &lt;item name="actionBarStyle"&gt;@style/ActionBar.Solid.Myactionbar&lt;/item&gt; &lt;item name="actionModeBackground"&gt;@drawable/cab_background_top_myactionbar&lt;/item&gt; &lt;item name="actionModeSplitBackground"&gt;@drawable/cab_background_bottom_myactionbar&lt;/item&gt; &lt;item name="actionModeCloseButtonStyle"&gt;@style/ActionButton.CloseMode.Myactionbar&lt;/item&gt; &lt;/style&gt; &lt;style name="ActionBar.Solid.Myactionbar" parent="@style/Widget.AppCompat.Light.ActionBar.Solid"&gt; &lt;item name="background"&gt;@drawable/ab_solid_myactionbar&lt;/item&gt; //THIS IS GREEN &lt;item name="backgroundStacked"&gt;@drawable/ab_solid_myactionbar&lt;/item&gt;//THIS IS GREEN &lt;item name="backgroundSplit"&gt;@drawable/ab_bottom_solid_myactionbar&lt;/item&gt;//THIS IS GREEN &lt;item name="progressBarStyle"&gt;@style/ProgressBar.Myactionbar&lt;/item&gt; &lt;/style&gt; &lt;style name="ActionBar.Transparent.Myactionbar" parent="@style/Widget.AppCompat.Light.ActionBar"&gt; &lt;item name="background"&gt;@drawable/ab_transparent_myactionbar&lt;/item&gt; &lt;item name="progressBarStyle"&gt;@style/ProgressBar.Myactionbar&lt;/item&gt; &lt;/style&gt; &lt;style name="PopupMenu.Myactionbar" parent="@style/Widget.AppCompat.Light.PopupMenu"&gt; &lt;item name="android:popupBackground"&gt;@drawable/menu_dropdown_panel_example &lt;/item&gt; &lt;/style&gt; &lt;style name="DropDownListView.Myactionbar" parent="@style/Widget.AppCompat.Light.ListView.DropDown"&gt; &lt;item name="android:listSelector"&gt;@drawable/selectable_background_myactionbar&lt;/item&gt; &lt;/style&gt; &lt;style name="ActionBarTabStyle.Myactionbar" parent="@style/Widget.AppCompat.Light.ActionBar.TabView"&gt; &lt;item name="android:background"&gt;@drawable/tab_indicator_ab_myactionbar&lt;/item&gt; &lt;/style&gt; &lt;style name="DropDownNav.Myactionbar" parent="@style/Widget.AppCompat.Light.Spinner.DropDown.ActionBar"&gt; &lt;item name="android:background"&gt;@drawable/spinner_background_ab_myactionbar&lt;/item&gt; &lt;item name="android:popupBackground"&gt;@drawable/menu_dropdown_panel_myactionbar&lt;/item&gt; &lt;item name="android:dropDownSelector"&gt;@drawable/selectable_background_myactionbar&lt;/item&gt; &lt;/style&gt; &lt;style name="ProgressBar.Myactionbar" parent="@style/Widget.AppCompat.ProgressBar.Horizontal"&gt; &lt;item name="android:progressDrawable"&gt;@drawable/progress_horizontal_myactionbar&lt;/item&gt; &lt;/style&gt; &lt;style name="ActionButton.CloseMode.Myactionbar" parent="@style/Widget.AppCompat.Light.ActionButton.CloseMode"&gt; &lt;item name="android:background"&gt;@drawable/btn_cab_done_myactionbar&lt;/item&gt; &lt;/style&gt; &lt;!-- this style is only referenced in a Light.DarkActionBar based theme --&gt; &lt;style name="Theme.Myactionbar.Widget" parent="@style/Theme.AppCompat"&gt; &lt;item name="popupMenuStyle"&gt;@style/PopupMenu.Myactionbar&lt;/item&gt; &lt;item name="dropDownListViewStyle"&gt;@style/DropDownListView.Myactionbar&lt;/item&gt; &lt;/style&gt; </code></pre> <p></p> <p>Everything was like in generator, but then i tried the simplest change, that is the color, so I edited style name=ActionBar.Solid.Myactionbar and put there som other drawables from other generated style. It looked like this :</p> <pre><code> &lt;style name="Theme.Myactionbar" parent="@style/Theme.AppCompat.Light"&gt; &lt;item name="actionBarItemBackground"&gt;@drawable/selectable_background_myactionbar&lt;/item&gt; &lt;item name="popupMenuStyle"&gt;@style/PopupMenu.Myactionbar&lt;/item&gt; &lt;item name="dropDownListViewStyle"&gt;@style/DropDownListView.Myactionbar&lt;/item&gt; &lt;item name="actionBarTabStyle"&gt;@style/ActionBarTabStyle.Myactionbar&lt;/item&gt; &lt;item name="actionDropDownStyle"&gt;@style/DropDownNav.Myactionbar&lt;/item&gt; &lt;item name="actionBarStyle"&gt;@style/ActionBar.Solid.Myactionbar&lt;/item&gt; &lt;item name="actionModeBackground"&gt;@drawable/cab_background_top_myactionbar&lt;/item&gt; &lt;item name="actionModeSplitBackground"&gt;@drawable/cab_background_bottom_myactionbar&lt;/item&gt; &lt;item name="actionModeCloseButtonStyle"&gt;@style/ActionButton.CloseMode.Myactionbar&lt;/item&gt; &lt;/style&gt; &lt;style name="ActionBar.Solid.Myactionbar" parent="@style/Widget.AppCompat.Light.ActionBar.Solid"&gt; &lt;item name="background"&gt;@drawable/ab_solid_example&lt;/item&gt; &lt;item name="backgroundStacked"&gt;@drawable/ab_stacked_solid_example&lt;/item&gt; &lt;item name="backgroundSplit"&gt;@drawable/ab_bottom_solid_myactionbar&lt;/item&gt; &lt;item name="progressBarStyle"&gt;@style/ProgressBar.Myactionbar&lt;/item&gt; &lt;/style&gt; </code></pre> <p>but nothing happend, and changed drawables supposed to be gray. I was wandering if anybody did this before and why this isnt working? Thank you</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload