parent
963016ef5d
commit
3e9699f57c
1 changed files with 1 additions and 9 deletions
|
@ -9,11 +9,8 @@ import android.graphics.PorterDuff;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Build;
|
|
||||||
|
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.core.graphics.BlendModeColorFilterCompat;
|
|
||||||
import androidx.core.graphics.BlendModeCompat;
|
|
||||||
|
|
||||||
import com.jjoe64.graphview.GraphView;
|
import com.jjoe64.graphview.GraphView;
|
||||||
import com.jjoe64.graphview.series.BaseSeries;
|
import com.jjoe64.graphview.series.BaseSeries;
|
||||||
|
@ -98,7 +95,6 @@ public class PointsWithLabelGraphSeries<E extends DataPointWithLabelInterface> e
|
||||||
* @param canvas canvas to draw on
|
* @param canvas canvas to draw on
|
||||||
* @param isSecondScale whether it is the second scale
|
* @param isSecondScale whether it is the second scale
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({"deprecation"})
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(GraphView graphView, Canvas canvas, boolean isSecondScale) {
|
public void draw(GraphView graphView, Canvas canvas, boolean isSecondScale) {
|
||||||
// Convert the sp to pixels
|
// Convert the sp to pixels
|
||||||
|
@ -250,11 +246,7 @@ public class PointsWithLabelGraphSeries<E extends DataPointWithLabelInterface> e
|
||||||
} else if (value.getShape() == Shape.PROFILE) {
|
} else if (value.getShape() == Shape.PROFILE) {
|
||||||
Drawable drawable = ContextCompat.getDrawable(graphView.getContext(), R.drawable.ic_ribbon_profile);
|
Drawable drawable = ContextCompat.getDrawable(graphView.getContext(), R.drawable.ic_ribbon_profile);
|
||||||
assert drawable != null;
|
assert drawable != null;
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
drawable.setColorFilter(Color.WHITE, PorterDuff.Mode.MULTIPLY);
|
||||||
drawable.setColorFilter (BlendModeColorFilterCompat.createBlendModeColorFilterCompat(Color.WHITE, BlendModeCompat.MULTIPLY));
|
|
||||||
} else {
|
|
||||||
drawable.setColorFilter(Color.WHITE, PorterDuff.Mode.MULTIPLY);
|
|
||||||
}
|
|
||||||
drawable.setBounds(
|
drawable.setBounds(
|
||||||
(int) (endX - drawable.getIntrinsicWidth() / 2),
|
(int) (endX - drawable.getIntrinsicWidth() / 2),
|
||||||
(int) (endY - drawable.getIntrinsicHeight() / 2),
|
(int) (endY - drawable.getIntrinsicHeight() / 2),
|
||||||
|
|
Loading…
Reference in a new issue