Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Circular Progress with a floating action button [closed]

Tags:

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

like image 417
Marco Souza Avatar asked Sep 18 '14 01:09

Marco Souza


People also ask

How do you stop the circular progress indicator in flutter?

AlwaysStoppedAnimation<Color> will always stop the animation of CircularProgressIndicator if the value parameter is a specific value, not null.

What does a floating action button do?

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.

How do I make a custom circular progress bar?

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.


2 Answers

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> ... 
like image 147
kunmi Avatar answered Sep 18 '22 08:09

kunmi


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> 
like image 39
Dmitry Avatar answered Sep 21 '22 08:09

Dmitry