1

I am trying to mimic the indigo pink and white colored style, as specified by Google here.

If I choose the parent theme as android:Theme.Material, then the background will be dark and text will be white. That led me to choose the parent app theme to be android:Theme.Material.Light.

However, now the items in ActionBar are colored black. I was able to style the text color back to white by

<style name="AppTheme" parent="android:Theme.Material.Light"> ... <item name="android:actionBarStyle">@style/AppTheme.MyActionBar</item> ... </style> <style name="AppTheme.MyActionBar" parent="@android:style/Widget.Material.ActionBar"> ... <item name="android:titleTextStyle">@style/AppTheme.MyActionBar.TitleTextStyle</item> ... </style> <style name="AppTheme.MyActionBar.TitleTextStyle" parent="@android:style/TextAppearance.Material.Widget.ActionBar.Title"> <item name="android:textColor">@android:color/white</item> </style> 

Now I need to override the color of the back button.

Unfortunately, specifying the parent of MyActionBar style as @android:style/Widget.Material.ActionBar (rather than @android:style/Widget.Material.Light.ActionBar) does not do the job.

This discussion How to customize the back button on ActionBar tells how to specify a resource via @drawable. Yet, I would like to use the back button from the dark theme using approach similar to styling text.

Is it possible to change the color of an ActionBar back button by somehow inheriting pre-existing style?

Thank you for your attention. enter image description here enter image description here

2 Answers 2

1

Use android:Theme.Material.Light.DarkActionBar - this optimizes for a dark action bar - automatically giving you white icons and text.

Sign up to request clarification or add additional context in comments.

Comments

0

You can try this one:

<style name="Theme.MyFancyTheme" parent="android:Theme.Holo"> <item name="android:homeAsUpIndicator">@drawable/my_fancy_up_indicator</item> </style> 

6 Comments

Thank you, but as I wrote, I am explicitly trying to avoid bringing external drawable resources to the project
So try to change @drawable/my_fancy_up_indicator to @color/whatevercolor
It will result in a square colored with whatevercolor, which is not what I want.
@user2551017 try @drawable/abc_ic_ab_back_mtrl_am_alpha which should be already available in android. so you wont be using external resource
since you are extending theme.material.light, this should mean light background, dark foreground. Which is your back button, overflow menu button should be black. So you need to overwrite it or change parent of your theme
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.