An iOS style progress ImageView.
Demo apk download
gradle :
dependencies {
compile 'me.ydcool.lib:progressimageview:latest.integration'
}
in your layout xml:
<me.ydcool.lib.progressimageview.ProgressImageView
android:id="@+id/Main_piv"
android:layout_width="200dp"
android:layout_height="200dp"
android:src="@mipmap/ic_launcher"
app:pi_mask_color="#CC233333"
app:pi_progress="0"
app:pi_radius="60dp"
app:pi_stroke="6dp"/>
setter and getter:
//setter
progressImageView.setProgress(yourProgress);
//getter
int currentProgress = progressImageView.getProgress();
attr | description |
---|---|
pi_mask_color |
mask color.argb will looks better. default is Color.argb(180,0,0,0) |
pi_progress |
the progress ,default is 0. |
pi_radius |
the radius of inner circle. default is 1/4 of the min side. |
pi_stroke |
stroke for the transparent ring.default is 8dp. |
- support for pause and resume