Theming: charts use theme text colors.

This commit is contained in:
Dennis Guse
2020-09-15 21:29:03 +02:00
parent 9908cc02a2
commit 0b3e447258
3 changed files with 18 additions and 4 deletions
@@ -21,4 +21,20 @@ public class ThemeUtils {
return ContextCompat.getColor(context, typedValue.resourceId);
}
public static int getTextColorPrimary(Context context) {
TypedValue typedValue = new TypedValue();
Resources.Theme theme = context.getTheme();
theme.resolveAttribute(android.R.attr.textColorPrimary, typedValue, true);
return ContextCompat.getColor(context, typedValue.resourceId);
}
public static int getTextColorSecondary(Context context) {
TypedValue typedValue = new TypedValue();
Resources.Theme theme = context.getTheme();
theme.resolveAttribute(android.R.attr.textColorSecondary, typedValue, true);
return ContextCompat.getColor(context, typedValue.resourceId);
}
}