marcauberer / simple-settings

⚙️ Simple Settings library for Android
MIT License
44 stars 9 forks source link

How to customize ActionBar color? #360

Open zerorooot opened 1 year ago

zerorooot commented 1 year ago

It seems that the default color is green, but the theme color of my app is black, how to change it?

citrusella commented 1 year ago

I found I was able to do this by using override on a color of the same name (i.e. the strategy employed here)... but I've only gotten it to work in the colors.xml file and not yet in the styles file where my colors are actually defined. (I have multiple styles in the app and would prefer if my settings could match the user-selected theme. I suppose if I have to then I could define colors that should only apply to the settings page that can go with any theme...)

Specifically, the color that seems to define the action bar for the library is colorPrimaryVariant (I think for Android's stock action bar it'd be colorPrimary according to how my app's action bar looks vs the settings with the changed color... huh). If you define a color for colorPrimaryVariant and then override it, it should apply to the library's action bar too.