Open gxcare opened 8 years ago
Hi. I just add one line in onDraw method before drawing spinner:
triggerReCalcTextSizesAndPositions();
//Draw spinner
if (mAnimationState == Attributes.AnimationState.SPINNING || mAnimationState == Attributes.AnimationState.END_SPINNING) {
drawSpinner(canvas);
if (mShowTextWhileSpinning) {
drawTextWithUnit(canvas);
}
} else if (mAnimationState == Attributes.AnimationState.END_SPINNING_START_ANIMATING) {
//draw spinning arc
drawSpinner(canvas);
if (mDrawBarWhileSpinning) {
drawBar(canvas, degrees);
drawTextWithUnit(canvas);
} else if (mShowTextWhileSpinning) {
drawTextWithUnit(canvas);
}
} else {
drawBar(canvas, degrees);
drawTextWithUnit(canvas);
}
After changing the view size due to a re-layout the text is no longer centered.