In Mirakel we are using now a ThemeManager to obtain the colors. Maybe you could use a similar approach too:
public static int getAccentThemeColor() {
return getColor(R.attr.colorAccent);
}
public static int getColor(int attrId) {
// The attributes you want retrieved
final int[] attrs = {attrId};
// Parse MyCustomStyle, using Context.obtainStyledAttributes()
final TypedArray ta = context.obtainStyledAttributes(themeResId, attrs);
// Fetching the colors defined in your style
final int color = ta.getColor(0, Color.BLACK);
// OH, and don't forget to recycle the TypedArray
ta.recycle();
return color;
}
Thank you for all of your great work!
Accoding to http://www.google.co.uk/design/spec/components/buttons.html:
Buttons should be designed in accordance with your app’s color theme.
You should use
?android:attr/colorAccent
as the main color instead of the hard coded blue. (According to https://developer.android.com/training/material/theme.html)In Mirakel we are using now a ThemeManager to obtain the colors. Maybe you could use a similar approach too: