I`m studing the new material design and I'm having some problems.
I would like to know if some of you know how can I do a progress bar with the floating action button like this https://dribbble.com/shots/1644982-Animated-circle-loader-FAB-with-integration-gif
Is there any api on Android L for this?
Thanks
AlwaysStoppedAnimation<Color> will always stop the animation of CircularProgressIndicator if the value parameter is a specific value, not null.
A floating action button (FAB) is a circular button that triggers the primary action in your app's UI. This page shows you how to add the FAB to your layout, customize some of its appearance, and respond to button taps.
This example demonstrates how do I make circle custom progress bar in android. Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main. xml.
This worked for me, I used a Relative-layout and fitted both in the center of the Relative-Layout.
... <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|right" android:layout_margin="16dp" app:layout_anchor="@id/my_recycler_view" app:layout_anchorGravity="bottom|right|end" > <ProgressBar android:id="@+id/fabProgress" style="?android:attr/progressBarStyleLarge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_centerInParent="true" android:indeterminateTint="@color/colorPrimary" /> <android.support.design.widget.FloatingActionButton android:id="@+id/newReportButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@android:drawable/ic_dialog_email" app:fabSize="normal" android:layout_centerInParent="true" /> </RelativeLayout> ...
You can use it: https://github.com/DmitryMalkovich/circular-with-floating-action-button to integrate circular progress with floating action button. The solution is not a custom fab, it is only a simple container for your our fab, so you can style as before!
<com.dmitrymalkovich.android.ProgressFloatingActionButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="@dimen/fab_margin" android:clickable="true"> <android.support.design.widget.FloatingActionButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_backup_black_24dp" /> <ProgressBar style="@style/Widget.AppCompat.ProgressBar" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </com.dmitrymalkovich.android.ProgressFloatingActionButton>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With