@@ -149,6 +149,7 @@ public class ArcProgressStackView extends View {
149149 private boolean mIsRounded ;
150150 private boolean mIsDragged ;
151151 private boolean mIsModelBgEnabled ;
152+ private boolean mIsShowProgress ;
152153 private boolean mIsLeveled ;
153154
154155 // Colors
@@ -271,6 +272,11 @@ public ArcProgressStackView(final Context context, final AttributeSet attrs, fin
271272 R .styleable .ArcProgressStackView_apsv_model_bg_enabled , false
272273 )
273274 );
275+ setShowProgress (
276+ typedArray .getBoolean (
277+ R .styleable .ArcProgressStackView_apsv_show_progress , true
278+ )
279+ );
274280
275281 // Set orientation
276282 final int orientationOrdinal =
@@ -456,6 +462,15 @@ public void setModelBgEnabled(final boolean modelBgEnabled) {
456462 postInvalidate ();
457463 }
458464
465+ public boolean isShowProgress () {
466+ return mIsShowProgress ;
467+ }
468+
469+ public void setShowProgress (final boolean showProgress ) {
470+ mIsShowProgress = showProgress ;
471+ postInvalidate ();
472+ }
473+
459474 public boolean isRounded () {
460475 return mIsRounded ;
461476 }
@@ -977,12 +992,14 @@ protected void onDraw(final Canvas canvas) {
977992 // Draw progress value
978993 canvas .save ();
979994 canvas .rotate (indicatorProgressAngle , model .mPos [0 ], model .mPos [1 ]);
980- canvas .drawText (
981- percentProgress ,
982- model .mPos [0 ] - model .mTextBounds .exactCenterX (),
983- model .mPos [1 ] - model .mTextBounds .exactCenterY (),
984- mTextPaint
985- );
995+ if (mIsShowProgress ) {
996+ canvas .drawText (
997+ percentProgress ,
998+ model .mPos [0 ] - model .mTextBounds .exactCenterX (),
999+ model .mPos [1 ] - model .mTextBounds .exactCenterY (),
1000+ mTextPaint
1001+ );
1002+ }
9861003 canvas .restore ();
9871004 }
9881005
0 commit comments