1111import android .animation .ValueAnimator ;
1212import android .content .Context ;
1313import android .graphics .Canvas ;
14- import android .graphics .Color ;
1514import android .graphics .Paint ;
1615import android .graphics .RectF ;
1716import android .graphics .Typeface ;
@@ -30,7 +29,7 @@ public class ResourceGaugeView extends View {
3029 private String centerText = "0%" ;
3130 private String bottomText = "-- / --" ;
3231
33- private int currentColor = Color . parseColor ( "#4CAF50" ) ;
32+ private int currentColor ;
3433
3534 public ResourceGaugeView (Context context , AttributeSet attrs ) {
3635 super (context , attrs );
@@ -40,10 +39,11 @@ public ResourceGaugeView(Context context, AttributeSet attrs) {
4039 private void init (Context context ) {
4140 setLayerType (View .LAYER_TYPE_SOFTWARE , null );
4241 rectF = new RectF ();
42+ currentColor = androidx .core .content .ContextCompat .getColor (context , R .color .status_success );
4343
4444 bgArcPaint = new Paint (Paint .ANTI_ALIAS_FLAG );
4545 bgArcPaint .setStyle (Paint .Style .STROKE );
46- bgArcPaint .setColor (Color . parseColor ( "#333333" ));
46+ bgArcPaint .setColor (androidx . core . content . ContextCompat . getColor ( context , R . color . chart_track ));
4747 bgArcPaint .setStrokeCap (Paint .Cap .ROUND );
4848 bgArcPaint .setPathEffect (null );
4949
@@ -57,16 +57,16 @@ private void init(Context context) {
5757
5858 percentPaint = new Paint (Paint .ANTI_ALIAS_FLAG );
5959 percentPaint .setTextAlign (Paint .Align .CENTER );
60- percentPaint .setColor (androidx .core .content .ContextCompat .getColor (context , R .color .dash_text_inverted ));
60+ percentPaint .setColor (androidx .core .content .ContextCompat .getColor (context , R .color .text_primary ));
6161 percentPaint .setFakeBoldText (true );
6262
6363 valuePaint = new Paint (Paint .ANTI_ALIAS_FLAG );
6464 valuePaint .setTextAlign (Paint .Align .CENTER );
65- valuePaint .setColor (Color . parseColor ( "#AAAAAA" ));
65+ valuePaint .setColor (androidx . core . content . ContextCompat . getColor ( context , R . color . text_secondary ));
6666
6767 titlePaint = new Paint (Paint .ANTI_ALIAS_FLAG );
6868 titlePaint .setTextAlign (Paint .Align .CENTER );
69- titlePaint .setColor (Color . parseColor ( "#CCCCCC" ));
69+ titlePaint .setColor (androidx . core . content . ContextCompat . getColor ( context , R . color . text_secondary ));
7070 titlePaint .setFakeBoldText (true );
7171
7272 // LOAD AND APPLY ORBITRON
0 commit comments