GithubHelp home page GithubHelp logo

fabprogresscircle's Introduction

fabprogresscircle's People

Contributors

jorgecastilloprz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fabprogresscircle's Issues

Null Pointer Exception when calling show() function

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

Make a progress version

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

Different arcColor for the final aspect

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

Api 10

Is it possible to support?

Can't increase size of progress circle

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>

Animation is very fast

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.

Finish animation speed

Hi.
How about adding some way to set animation speed? In some cases final animation taking too long.

Complete animation immediatly

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.

call show and hide in row

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?

Customizable Animation Times

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.

NullPointer exception on show

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?

beginFinalAnimation() NullPointerException

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).

isInEditMode()

Please use isInEditMode() method in FABProgressCircle construcors as you se below:
if(!isInEditMode()){
init(context);
}

The progress circle is getting cut-off/clipped. It's never a smooth circle for me.

fab-ss1
fab-ss2

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>

Final view duration

There should be an attribute to set how long the done view should be visible on screen.

Strange error trying to cast FABProgessCircle as FloatingActionButton

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?

Final image not showing

Hi;

The final image is not showing, neither from custom image resource nor from defaut behaviour !

Remove "allowBackup" from AndroidManifest

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".

Final icon is not shown correctly

img
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>

NullPointerException

 <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

Clipping Problems <= 4.2.2

Hey, thanks for your awesome work!

I have experienced some clipping problems in 4.2.2 and lower, do you have any idea to solve this problem?

screen shot 2015-08-01 at 12 02 51

finalIcon is never displayed

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! :/

how to reset fab progress circle to initial state

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

Not show animation in ConstraintLayout

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>

FabProgressCircle cannot collaps if fab is in a CoordinatorLayout

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

after upgrade to 1.01 the FABCircle looks like this

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>

BeginAnimation turns FAB into white

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?

ProgressArcView stop method can not work

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

Elevation attribute not working

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.

FABPC + CoordinatorLayout in Fragment + TabLayout = Wrong Placement

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.
screenshot_20170208-205233

activity layout:

<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>

fragment 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>

fab layout

<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>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.