圍繞FloatingActionButton的環形Material進度條:FABProgressCircle
一個Android庫提供了一個圍繞FloatingActionButton的環形Material進度條。這個組兼容任何現有的FAB。
如何使用
You can use theFABProgressCircleto wrap any existent FAB. Here you have an example wrapping the Google FloatingActionButton from the brand new Design Support Library.
<com.github.jorgecastilloprz.FABProgressCircle
android:id="@+id/fabProgressCircle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<!-- You can change it with the fab from the library you want to use -->
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_upload"
app:rippleColor="@color/fab_ripple"
app:elevation="@dimen/fab_elevation"
app:borderWidth="0dp"
/>
</com.github.jorgecastilloprz.FABProgressCircle>To show the progress circle, call theshow()method into the normal click/touch listener of your fab:
fabView.setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View view) {
fabProgressCircle.show();
startYourAsynchronousJob();
}
}); 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!

