围绕FloatingActionButton的环形Material进度条:FABProgressCircle

jopen 9年前

一个Android库提供了一个围绕FloatingActionButton的环形Material进度条。这个组兼容任何现有的FAB

Demo Screenshot

Demo Screenshot2

如何使用

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();    }  });

项目主页:http://www.open-open.com/lib/view/home/1433818246801