圓形圖片 周圍進度條 類似于音樂播放器的進度
圓角顯示圖片 來自CircleImageView 在基礎上修改 讓其可以周邊動態(tài)顯示進度
app:textBgColor 外圍進度的原始背景顏色
app:textColor 外圍進度條的顏色
app:textSize="10dp" 寬度0時不顯示
使用方法
<com.daemon.aroundcircleview.AroundCircleView
android:id="@+id/acv_icon"
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:src="@mipmap/head"
app:textColor="@color/colorAccent"
app:textBgColor="#000000"
app:textSize="10dp" />
直接使用acvIcon.setProgress(progress);即可更新
-
更新進度條 利用Hanlder更新即可
//更新進度條
progress=50;
acvIcon.setProgress(progress);new Thread(new Runnable() { @Override public void run() { while (falg) { if (progress > 100) { progress = 0; } SystemClock.sleep(1000); progress += 5; weakHandler.sendEmptyMessage(1); } } }).start(); @Overridepublic void onDestroy() { super.onDestroy(); falg = false; } WeakHandler weakHandler = new WeakHandler(new Handler.Callback() { @Override public boolean handleMessage(Message msg) { if (msg.what == 1) { acvIcon.setProgress(progress); } return false; }
});
效果如圖
背景虛化也寫過相關的blog
android 圖片 高斯模糊 Blur Android Studio JNI NDK 生成 so 問題匯總
Paste_Image.png
GIF.gif