jorgecastilloprz / fabprogresscircle Goto Github PK
View Code? Open in Web Editor NEWMaterial progress circle around any FloatingActionButton. 100% Guidelines.
Material progress circle around any FloatingActionButton. 100% Guidelines.
There is little chance to face this Exception when calling beginFinalAnimation() because uninitialized progressArc (In my case it's DataBinding in onCreate method of ViewPager fragment).
On both genymotion and G4.
new simple layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.github.jorgecastilloprz.FABProgressCircle
android:id="@+id/login"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
app:finalIcon="@drawable/ic_done">
<android.support.design.widget.FloatingActionButton
android:id="@+id/loginFab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</com.github.jorgecastilloprz.FABProgressCircle>
</LinearLayout>
at com.github.jorgecastilloprz.FABProgressCircle.hide(FABProgressCircle.java:166)
As the title, the layout below working fine in relativeLayout but not working in ConstraintLayout after call fab.show()
<com.github.jorgecastilloprz.FABProgressCircle
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:arcColor="@android:color/holo_red_light">
<android.support.design.widget.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_arrow_forward_white_24dp" />
</com.github.jorgecastilloprz.FABProgressCircle>
Hello everyone,
Is that possible to make the animation start and finish of the FloatingActionButton relative to a Volley call in android?
I want to show done icon only if its success, in case of failure show "X" finalIcon
Hi!
Great lib! :)
I wondered if you can add another attribute for the color of the final aspect (currently same as the arcColor)?
Thanks for your answer.
Denis
Maybe is bug.
I called
fabProgressCircle.show();
fabProgressCircle.hide();
its stay show..
xml code :
<com.github.jorgecastilloprz.FABProgressCircle
android:id="@+id/fabProgressCircle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom">
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:tint="@android:color/white"
app:reusable="true"
app:srcCompat="@drawable/ic_arrow_forward_black_24dp" />
</com.github.jorgecastilloprz.FABProgressCircle>
any solution?
There should be an attribute in order to begin the final animation right away without having to wait for the progress to finish the circle.
my xml is like this:
<android.support.design.widget.CoordinatorLayout
android:id="@+id/rootLayout"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="256dp"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsingToolbarLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleMarginStart="@dimen/expanded_toolbar_title_margin_start"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<ImageView
android:id="@+id/ivTripCover"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.7"/>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/rvContentList"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
</android.support.v7.widget.RecyclerView>
<com.github.jorgecastilloprz.FABProgressCircle
android:id="@+id/fabProgressCircle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_anchor="@id/app_bar"
app:layout_anchorGravity="bottom|right|end">
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_sync_play"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:clickable="true"
android:src="@drawable/ic_backup_white_24dp"
app:layout_anchor="@id/app_bar"
app:layout_anchorGravity="bottom|right|end"
/>
</com.github.jorgecastilloprz.FABProgressCircle>
</android.support.design.widget.CoordinatorLayout>
If I don't use FabProgressCircle, the fab will vanish when toolbar layout is collapsing into a small title bar. However, after I use FabProgressCircle like above, the collapsing animation disappear
Is it possible to support?
can we custom when to reset the fabpc?
thank you.
hi,
can you please add the possibilty to use determinate progress ?
ermmmm, i cannot upload image image here.
so this is the image:
http://7qn7lj.com1.z0.glb.clouddn.com/20150617091144.png
while my xml is like this:
<com.github.jorgecastilloprz.FABProgressCircle
android:id="@+id/fab_set_circle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_margin="8dp"
app:arcColor="@color/fab_progress"
app:arcWidth="3dp"
app:reusable="true"
app:roundedStroke="true">
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_set"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:src="@drawable/ic_wallpaper_white_24dp"
app:backgroundTint="@color/fab_back"
app:elevation="6dp"
app:pressedTranslationZ="12dp"
app:rippleColor="#ffffff" />
</com.github.jorgecastilloprz.FABProgressCircle>
Issue:
If the app start to show the progress view, and then stop it immediately, the progress can't not be stopped.
Root Cause:
ProgressArcView.show() method, it will delay the running task 150 ms, so during the time, if the app call the method ProgressArcView.stop(), will cause progress view still in progress.
Solution:
private Runnable animationRunnable = new Runnable() {
public void run() {
ProgressArcView.this.setAlpha(1.0F);
ProgressArcView.this.getDrawable().reset();
}
};
public void show() {
postDelayed(animationRunnable, SHOW_SCALE_ANIM_DELAY);
}
public void stop() {
removeCallbacks(animationRunnable);
getDrawable().stop();
ValueAnimator fadeOutAnim = ObjectAnimator.ofFloat(this, "alpha", 1, 0);
fadeOutAnim.setDuration(100).start();
}
@JorgeCastilloPrz :
Hi, t would be possible to use the module without having to declare xml.
I do not know via java usado the build?
How to reset fab progress circle to initial state after beginFinalAnimation has been called ?
I see a method addCompleteFabView for adding completeFabView but another method for removing it seems to be missing which would reset the view to its initial state.
Regards,
Vihaan
Hi,
the fab does not move up in order to make space for a Snackbar, like intended by the CoordinatorLayout behaviour.
I put a FABProgressCircle in CoordinatorLayout, which is in a Fragment. The parent activity also sets up a TabLayout, also in a CoordinatorLayout. The FABProgressCircle is partially covered by the phone's bottom navigation.
Take a look at this screenshot.
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:title="@string/all_videos"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabGravity="fill"
app:tabMode="fixed" />
</android.support.design.widget.AppBarLayout>
<FrameLayout
android:id="@+id/frame_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</android.support.design.widget.CoordinatorLayout>
<include layout="@layout/mini_controller" />
</RelativeLayout>
<include layout="@layout/phone_navigation_view" />
</android.support.v4.widget.DrawerLayout>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_mediaItems"
android:scrollbars="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<include
layout="@layout/phone_fab_view" />
</android.support.design.widget.CoordinatorLayout>
<com.github.jorgecastilloprz.FABProgressCircle xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/fabProgressCircle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
app:arcColor="@color/accent"
app:arcWidth="7dp"
app:finalIcon="@drawable/ic_check_white_24dp"
app:reusable="true"
app:layout_behavior="org.mythtv.android.presentation.utils.FABProgressCircleBehavior">
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/fab_margin"
android:src="@drawable/ic_autorenew_white_24dp"
app:layout_behavior="org.mythtv.android.presentation.utils.ScrollAwareFABBehavior" />
</com.github.jorgecastilloprz.FABProgressCircle>
How do you control the speed of the animation? When I run this in an emulator, I don't notice this. Mostly on a Google Pixel.
After the animation complete, the FAB changes to orange and I can't turn it back to the original image.
fab.setImageResource() doesn't work
I had to download and modify the library to obtain the results I needed simply because the animation times and delays are hardcoded and not accessible.
It would be a great improvement if it was possible to override the default values.
First of all thank you very much for the great work done!
Would be great to have an opportunity to change the color of arch after final animation. It's important in case when it's necessary to change color of FAB after some operation.
When it fails, I want to wait to the animation to finish the circle before hide()
it.
Is there a way to do that?
Please let me know what am I doing wrong. I am trying below sample example. I do not have coordinator layout in my case, which I think should not be an issue.
<com.github.jorgecastilloprz.FABProgressCircle
android:id="@+id/fabProgressCircle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/address_autocomplete_text_inp_layout"
android:layout_centerHorizontal="true"
android:layout_marginTop="40dp"
app:arcWidth="7dp">
<!-- 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_arrow_forward_white_24dp"
app:borderWidth="0dp"/>
</com.github.jorgecastilloprz.FABProgressCircle>
There is no reason allowBackup="true"
should be set in the AndroidManifest. This will cause the manifest merger build step to fail if an application specifies allowBackup="false"
.
I'm making a music player and a version where I set a max value and it fills it up. Like a rounded progress bar
Will it be possible to add a setter for the reusable attribute?
Here is the stacktrace:
02-04 10:24:40.942 8403-8403/org.mythtv.android E/AndroidRuntime: FATAL EXCEPTION: main
Process: org.mythtv.android, PID: 8403
java.lang.ClassCastException: com.github.jorgecastilloprz.FABProgressCircle cannot be cast to android.support.design.widget.FloatingActionButton
at android.support.design.widget.FloatingActionButton$Behavior.onLayoutChild(FloatingActionButton.java:545)
at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:849)
at android.view.View.layout(View.java:16630)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
at android.view.View.layout(View.java:16630)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.support.design.widget.HeaderScrollingViewBehavior.layoutChild(HeaderScrollingViewBehavior.java:131)
at android.support.design.widget.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:42)
at android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onLayoutChild(AppBarLayout.java:1367)
at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:849)
at android.view.View.layout(View.java:16630)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)
at android.view.View.layout(View.java:16630)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:1193)
at android.view.View.layout(View.java:16630)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
at android.view.View.layout(View.java:16630)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1495)
at android.view.View.layout(View.java:16630)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
at android.view.View.layout(View.java:16630)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1495)
at android.view.View.layout(View.java:16630)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:2678)
at android.view.View.layout(View.java:16630)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2171)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1931)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
at android.view.Choreographer.doCallbacks(Choreographer.java:670)
at android.view.Choreographer.doFrame(Choreographer.java:606)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
res/layout/phone_fab_view.xml (gets included in other layouts):
<com.github.jorgecastilloprz.FABProgressCircle xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/fabProgressCircle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/fab_margin"
android:layout_gravity="end|bottom"
app:layout_behavior="org.mythtv.android.presentation.utils.ScrollAwareFABBehavior">
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_autorenew_white_24dp"
app:rippleColor="@color/white"
app:elevation="6dp"
app:borderWidth="0dp" />
</com.github.jorgecastilloprz.FABProgressCircle>
res/layout/activity_phone_main.xml
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:title="@string/all_videos"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabGravity="fill"
app:tabMode="fixed" />
</android.support.design.widget.AppBarLayout>
<FrameLayout
android:id="@+id/frame_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<!--<include layout="@layout/phone_fab_view" />-->
</android.support.design.widget.CoordinatorLayout>
<include layout="@layout/mini_controller" />
</RelativeLayout>
<include layout="@layout/phone_navigation_view" />
</android.support.v4.widget.DrawerLayout>
res/layout/fragment_media_item_list.xml (includes the fab layout):
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_mediaItems"
android:scrollbars="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<include
layout="@layout/phone_fab_view" />
</android.support.design.widget.CoordinatorLayout>
FABCircleProgress is loaded with ButterKnife
@BindView( R.id.fabProgressCircle )
FABProgressCircle fabProgressCircle;
Adapter is loading the RecyclerView, listener is starting/stopping/hiding the animations like described. For some reason, the FABCircleProgress is trying to be cast as a FloatingActionButton in the Coordinator layout.
Any ideas?
As the tittle says, the elevation attribute of the Google FAB and FABProgressCircle are not working.
If I use the Google FAB alone, the attribute works as expected.
There should be an attribute to set how long the done view should be visible on screen.
<com.github.jorgecastilloprz.FABProgressCircle
android:id="@+id/fabProgressCircle"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_alignParentRight="true"
android:layout_marginRight="@dimen/spacing_normal"
android:layout_marginTop="@dimen/spacing_normal"
app:layout_anchor="@id/appbar"
app:reusable="false"
app:layout_anchorGravity="bottom|right|end"
>
<!--Google FAB-->
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_send"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:backgroundTint="@color/md_amber_500"
app:fabSize="normal"
app:borderWidth="0dp"
app:fab_elevation="@dimen/fab_elevation"
/>
</com.github.jorgecastilloprz.FABProgressCircle>
In Fragment, i saved Progress Loading state
fragment.setRetainInstance(true)
start loading
public void sendComment(long postId, String tag, String content) {
getView().showSendCommentProgress();//int this point, rotating screen
CommentService.getInstance().sendComment(postId, tag, content, new SaveCallback() {
@Override public void done(AVException e) {
if (e == null) {
if (isViewAttached()) {
getView().sendCommentSuccessful();
}
} else {
if (isViewAttached()) {
getView().sendCommentFailure(e);
}
}
}
});
}
@Override public void showSendCommentProgress() {
CommentViewState vs = (CommentViewState) getViewState();
vs.setStateLoadingProgress();
mFabProgressCircle.setEnabled(false);
mFabProgressCircle.show();
}
then rotating screen, call showSendCommentProgress
method again, but addArcView() not invoke again, progressArc is null
private void addArcView() {
this.setClipChildren(false);
this.progressArc = new ProgressArcView(this.getContext(), this.arcColor, this.arcWidth, this.roundedStroke);
this.progressArc.setInternalListener(this);
this.addView(this.progressArc, new LayoutParams(this.getFabDimension() + this.arcWidth, this.getFabDimension() + this.arcWidth, 17));
}
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.github.jorgecastilloprz.progressarc.ProgressArcView.show()' on a null object reference
Running demo app on Android 4.1.2 (API level 16).
Hi.
How about adding some way to set animation speed? In some cases final animation taking too long.
In the following code, if fabProgressCircle.show()
is called outside the Handler (which delays it's excecution for 500 milliseconds), the App crashes with Null Pointer Exception for fabProgressCircle.show(). Why could this happen? Does the fabProgressCircle
needs some time to instantiate?
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_2);
com.melnykov.fab.FloatingActionButton doneButton = (com.melnykov.fab.FloatingActionButton) findViewById(R.id.done2);
com.github.jorgecastilloprz.FABProgressCircle fabProgressCircle = (com.github.jorgecastilloprz.FABProgressCircle) findViewById(R.id.fabProgressCircle );
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
fabProgressCircle .show();
}
}, 500);
}
Hi!
Thank you for an awesome library, it looks amazing and is so easy to implement. I have one issue however, I can't get the finalIcon to display
This is my setup
<com.github.jorgecastilloprz.FABProgressCircle
android:id="@+id/fabProgressCircle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
android:layout_margin="16dp"
app:reusable="true"
app:finalIcon="@drawable/ic_action_accept"
>
<com.melnykov.fab.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_action_accept"
fab:fab_colorNormal="@color/twee_blue_light"
fab:fab_colorPressed="@color/twee_blue_dark"
fab:fab_colorRipple="@color/twee_blue_light" />
</com.github.jorgecastilloprz.FABProgressCircle>
After i run the beginFinalAnimation(); the FAB changes color to orange, but the icon never shows.
I don't know what I'm doing wrong! :/
Please use isInEditMode() method in FABProgressCircle construcors as you se below:
if(!isInEditMode()){
init(context);
}
In the following code snippet, FAB increases to match parent LinearLayout. However, the FABProgressCircle dimensions are not increasing.
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal"
android:gravity="center"
android:padding="24dp"
>
<com.github.jorgecastilloprz.FABProgressCircle
android:id="@+id/fabProgressCircle"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:arcColor="@color/colorAccent"
app:arcWidth="4dp"
>
<android.support.design.widget.FloatingActionButton
android:id="@+id/toggleStreamingButton"
android:src="@drawable/ic_play_arrow_white_48dp"
app:fabSize="auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
app:backgroundTint="@color/colorPrimary"/>
</com.github.jorgecastilloprz.FABProgressCircle>
Hi,
I have to manually call fabProgressCircle.measure(15, 15)
before fabProgressCircle.show()
otherwise I have a NullPointerException
FATAL EXCEPTION: main
java.lang.NullPointerException
at com.github.jorgecastilloprz.FABProgressCircle.show(FABProgressCircle.java:158)
Why?
Can not beginFinalAnimation() in RecyclerView item.
This is my code
<com.github.jorgecastilloprz.FABProgressCircle
android:id="@+id/fabProgressCircle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="15dp"
android:layout_marginTop="150dp"
android:visibility="invisible"
app:arcColor="#ffffff"
app:finalIcon="@drawable/ic_done"
app:arcWidth="2dp">
<com.getbase.floatingactionbutton.FloatingActionButton
android:id="@+id/file_start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
fab:fab_colorNormal="@color/accent"
fab:fab_colorPressed="@color/accentDark"
fab:fab_icon="@drawable/start_lock"
fab:fab_size="normal" />
</com.github.jorgecastilloprz.FABProgressCircle>
When ever I am calling the method, progress.beginAnimation() the entire FAB turns into solid white color. No drawable is put in it to indicate completion.
Can someone please help to solve this?
Hi;
The final image is not showing, neither from custom image resource nor from defaut behaviour !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.