@@ -149,6 +149,7 @@ public class ArcProgressStackView extends View {
149
149
private boolean mIsRounded ;
150
150
private boolean mIsDragged ;
151
151
private boolean mIsModelBgEnabled ;
152
+ private boolean mIsShowProgress ;
152
153
private boolean mIsLeveled ;
153
154
154
155
// Colors
@@ -271,6 +272,11 @@ public ArcProgressStackView(final Context context, final AttributeSet attrs, fin
271
272
R .styleable .ArcProgressStackView_apsv_model_bg_enabled , false
272
273
)
273
274
);
275
+ setShowProgress (
276
+ typedArray .getBoolean (
277
+ R .styleable .ArcProgressStackView_apsv_show_progress , true
278
+ )
279
+ );
274
280
275
281
// Set orientation
276
282
final int orientationOrdinal =
@@ -456,6 +462,15 @@ public void setModelBgEnabled(final boolean modelBgEnabled) {
456
462
postInvalidate ();
457
463
}
458
464
465
+ public boolean isShowProgress () {
466
+ return mIsShowProgress ;
467
+ }
468
+
469
+ public void setShowProgress (final boolean showProgress ) {
470
+ mIsShowProgress = showProgress ;
471
+ postInvalidate ();
472
+ }
473
+
459
474
public boolean isRounded () {
460
475
return mIsRounded ;
461
476
}
@@ -977,12 +992,14 @@ protected void onDraw(final Canvas canvas) {
977
992
// Draw progress value
978
993
canvas .save ();
979
994
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
+ }
986
1003
canvas .restore ();
987
1004
}
988
1005
0 commit comments