PinView
PinView copied to clipboard
Enable custom filled background
Feature request: allow to change background of filled item
This is my solution to this: change the method drawCircle(Canvas canvas, int i) like this:
private void drawCircle(Canvas canvas, int i) {
Paint paint = getPaintByIndex(i);
float cx = mItemCenterPoint.x;
float cy = mItemCenterPoint.y;
if (getText().toString().trim().length() > 0) {
paint.setColor(ContextCompat.getColor(getContext(), R.color.filled_color));
} else {
paint.setColor(ContextCompat.getColor(getContext(), R.color.empty_color));
}
canvas.drawPath(mPath, paint);
paint.setColor(ContextCompat.getColor(getContext(), R.color.circle_color));
canvas.drawCircle(cx, cy, paint.getTextSize() / 2, paint);
}