diff --git a/README.md b/README.md index 5b26aa0..48fb72c 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,16 @@ Present your progress bars in arc mode with information and total control. You can check the sample app [here](https://github.com/DevLight-Mobile-Agency/ArcProgressStackView/tree/master/app). +Warn +==== +``` +This library is not more supported. +If you want to add new feature or fix a bug, grab source code and do it. +If you think your fix or feature would be useful to other developers, +I can add link of your repository to this README file. +Thank you for using our libraries. +``` + Download ======== @@ -159,7 +169,7 @@ Other methods check out in sample. And `XML` init: ```xml -< - - - diff --git a/arcprogressstackview/src/main/java/devlight/io/library/ArcProgressStackView.java b/arcprogressstackview/src/main/java/devlight/io/library/ArcProgressStackView.java index 16a2c65..ed8f464 100644 --- a/arcprogressstackview/src/main/java/devlight/io/library/ArcProgressStackView.java +++ b/arcprogressstackview/src/main/java/devlight/io/library/ArcProgressStackView.java @@ -149,6 +149,7 @@ public class ArcProgressStackView extends View { private boolean mIsRounded; private boolean mIsDragged; private boolean mIsModelBgEnabled; + private boolean mIsShowProgress; private boolean mIsLeveled; // Colors @@ -271,6 +272,11 @@ public ArcProgressStackView(final Context context, final AttributeSet attrs, fin R.styleable.ArcProgressStackView_apsv_model_bg_enabled, false ) ); + setShowProgress( + typedArray.getBoolean( + R.styleable.ArcProgressStackView_apsv_show_progress, true + ) + ); // Set orientation final int orientationOrdinal = @@ -456,6 +462,15 @@ public void setModelBgEnabled(final boolean modelBgEnabled) { postInvalidate(); } + public boolean isShowProgress() { + return mIsShowProgress; + } + + public void setShowProgress(final boolean showProgress) { + mIsShowProgress = showProgress; + postInvalidate(); + } + public boolean isRounded() { return mIsRounded; } @@ -911,7 +926,7 @@ protected void onDraw(final Canvas canvas) { (float) (Math.PI / 180.0F) * progress * model.mBounds.width() * 0.5F; final String title = (String) TextUtils.ellipsize( model.getTitle(), mTextPaint, - progressLength - titleHorizontalOffset * 2, TextUtils.TruncateAt.END + progressLength - titleHorizontalOffset * (mIsRounded ? 0 : 2), TextUtils.TruncateAt.END ); canvas.drawTextOnPath( title, @@ -977,12 +992,14 @@ protected void onDraw(final Canvas canvas) { // Draw progress value canvas.save(); canvas.rotate(indicatorProgressAngle, model.mPos[0], model.mPos[1]); - canvas.drawText( - percentProgress, - model.mPos[0] - model.mTextBounds.exactCenterX(), - model.mPos[1] - model.mTextBounds.exactCenterY(), - mTextPaint - ); + if (mIsShowProgress) { + canvas.drawText( + percentProgress, + model.mPos[0] - model.mTextBounds.exactCenterX(), + model.mPos[1] - model.mTextBounds.exactCenterY(), + mTextPaint + ); + } canvas.restore(); } diff --git a/arcprogressstackview/src/main/res/values/attrs.xml b/arcprogressstackview/src/main/res/values/attrs.xml index b3c5266..b2d6ae1 100644 --- a/arcprogressstackview/src/main/res/values/attrs.xml +++ b/arcprogressstackview/src/main/res/values/attrs.xml @@ -35,6 +35,7 @@ limitations under the License. + @@ -46,4 +47,4 @@ limitations under the License. - \ No newline at end of file +