mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-04 18:43:07 +02:00
Theming: charts use theme text colors.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user