diff --git a/CircleProgressView/src/main/java/at/grabner/circleprogress/CircleProgressView.java b/CircleProgressView/src/main/java/at/grabner/circleprogress/CircleProgressView.java index a1e7848..0bba4f1 100644 --- a/CircleProgressView/src/main/java/at/grabner/circleprogress/CircleProgressView.java +++ b/CircleProgressView/src/main/java/at/grabner/circleprogress/CircleProgressView.java @@ -1790,8 +1790,30 @@ private void drawTextWithUnit(Canvas canvas) { canvas.drawRect(mActualTextBounds, rectPaint); } - - canvas.drawText(text, mActualTextBounds.left - (mTextPaint.getTextSize() * 0.02f), mActualTextBounds.bottom, mTextPaint); + + if(text.contains("\n")){ + String[] texts = text.split("\n"); + float height = mActualTextBounds.bottom; + for (String txt : texts){ + mTextPaint.setTextSize(mTextSize); + mActualTextBounds = calcTextBounds(txt, mTextPaint, mCircleBounds); //center text in circle + canvas.drawText( + txt, + mActualTextBounds.left - mTextPaint.getTextSize() * 0.02f, + height-40, + mTextPaint + ); + + height += mTextPaint.getTextSize(); + } + } else { + canvas.drawText( + text, + mActualTextBounds.left - mTextPaint.getTextSize() * 0.02f, + mActualTextBounds.bottom, + mTextPaint + ); + } if (mShowUnit) { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ba150d7..3bbfb46 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Tue Sep 13 15:53:10 CEST 2016 +#Sat Jun 06 17:10:50 ICT 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip