Cleanup: use ContextCompat.getColor()

This commit is contained in:
Dennis Guse
2022-08-04 21:56:03 +02:00
parent 9f6ca83f27
commit cdbddabc1b
5 changed files with 11 additions and 8 deletions
@@ -24,6 +24,7 @@ import android.graphics.Paint.Style;
import android.graphics.Path;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import java.text.NumberFormat;
@@ -68,12 +69,12 @@ abstract class ChartValueSeries {
fillPaint = new Paint();
fillPaint.setStyle(Style.FILL);
fillPaint.setColor(context.getResources().getColor(fillColor));
fillPaint.setColor(ContextCompat.getColor(context, fillColor));
fillPaint.setAntiAlias(true);
strokePaint = new Paint();
strokePaint.setStyle(Style.STROKE);
strokePaint.setColor(context.getResources().getColor(strokeColor));
strokePaint.setColor(ContextCompat.getColor(context, strokeColor));
strokePaint.setAntiAlias(true);
// Make copies of the stroke paint with the default thickness