Open arnaudbarbe opened 9 years ago
try this in ProgressWheel.java
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
//Draw the inner circle
canvas.drawArc(innerCircleBounds, 360, 360, false, circlePaint);
//Draw the rim
canvas.drawArc(circleBounds, 360, 360, false, rimPaint);
canvas.drawArc(circleOuterContour, 360, 360, false, contourPaint);
//canvas.drawArc(circleInnerContour, 360, 360, false, contourPaint);
//Draw the bar
if (isSpinning) {
canvas.drawArc(circleBounds, progress - 90, barLength, false, barPaint);
} else {
canvas.drawArc(circleBounds, -90, progress, false, barPaint);
}
//Draw the text (attempts to center it horizontally and vertically)
float textHeight = textPaint.descent() - textPaint.ascent();
float startingOffset = (textHeight * splitText.length) / 2 - (textHeight / 4);
for (int i = (splitText.length - 1) ; i >=0 ; i--) {
float horizontalTextOffset = textPaint.measureText(splitText[i]) / 2;
canvas.drawText(
splitText[i],
this.getWidth() / 2 - horizontalTextOffset,
this.getHeight() / 2 + startingOffset,
textPaint);
startingOffset = startingOffset - textHeight;
}
if (isSpinning) {
scheduleRedraw();
}
}
I believe this is related to 57b1075.
have you solved this problem?
i did not get any official support from team. i created custom view with progresswheel it has worked for me check that code here https://pastebin.com/FZ0YSxSe
create an ProgressWheel and setText with \n lines overlap