Skip to content

Commit c212a30

Browse files
committed
[Feature] Make CircularProgressDrawable public; Add and fix documentation.
1 parent 2a841cf commit c212a30

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Material Design `ProgressBar` with consistent appearance on Android 4.0+.
1010
- Correct tinting across platforms.
1111
- Able to remove the intrinsic padding of framework `ProgressBar`.
1212
- Able to hide the progress background of framework horizontal `ProgressBar`.
13+
- Able to show a determinate circular progress.
1314
- Used as a drop-in replacement for framework `ProgressBar`.
1415

1516
## Preview
@@ -69,6 +70,7 @@ Available custom attributes:
6970
- `app:mpb_setBothDrawables`: Whether both determinate and indeterminate drawables should be set on this progress bar. Defaults to `false`.
7071
- `app:mpb_useIntrinsicPadding`: Whether progress drawable should use its intrinsic padding. Defaults to `true`.
7172
- `app:mpb_showProgressBackground`: Whether progress drawable should show a progress background. Defaults to `true` for horizontal progress drawable, `false` otherwise.
73+
- `app:mpb_determinateCircularProgressStyle`: Style of determinate circular progress drawable: normal or dynamic. Defaults to `normal`.
7274

7375
8 tint-related attributes such as `app:mpb_progressTint` and `app:mpb_progressTintMode` are also supported so that they can control the tinting of progress drawables. The default tint color is `?colorControlActivated`, and the default tint mode is `src_in`.
7476

@@ -80,6 +82,7 @@ Three Material Design drawables are backported to Android 4.0 (API 14), so you c
8082

8183
- [`HorizontalProgressDrawable`](library/src/main/java/me/zhanghai/android/materialprogressbar/HorizontalProgressDrawable.java)
8284
- [`IndeterminateHorizontalProgressDrawable`](library/src/main/java/me/zhanghai/android/materialprogressbar/IndeterminateHorizontalProgressDrawable.java)
85+
- [`CircularProgressDrawable`](library/src/main/java/me/zhanghai/android/materialprogressbar/CircularProgressDrawable.java)
8386
- [`IndeterminateCircularProgressDrawable`](library/src/main/java/me/zhanghai/android/materialprogressbar/IndeterminateCircularProgressDrawable.java)
8487

8588
For example, to set a `IndeterminateHorizontalProgressDrawable` on a `ProgressBar`.

library/src/main/java/me/zhanghai/android/materialprogressbar/CircularProgressDrawable.java

+2-5
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,9 @@
1010

1111
/**
1212
* A new {@code Drawable} for determinate circular {@code ProgressBar}.
13-
*
14-
* Package private as this does only work together with MaterialProgressBar and is not suitable
15-
* for another ProgressBar
1613
*/
17-
class CircularProgressDrawable extends BaseProgressLayerDrawable<SingleCircularProgressDrawable,
18-
CircularProgressBackgroundDrawable> {
14+
public class CircularProgressDrawable extends BaseProgressLayerDrawable<
15+
SingleCircularProgressDrawable, CircularProgressBackgroundDrawable> {
1916

2017
/**
2118
* Create a new {@code CircularProgressDrawable}.

library/src/main/res/values/attrs.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<attr name="mpb_showProgressBackground" format="boolean" />
3232

3333
<!--
34-
~ Style of determinate circular progress drawable: static or dynamic. Defaults to static.
34+
~ Style of determinate circular progress drawable: normal or dynamic. Defaults to normal.
3535
-->
3636
<attr name="mpb_determinateCircularProgressStyle" format="enum">
3737
<enum name="normal" value="0" />

0 commit comments

Comments
 (0)