Scalified/fab

Request - Circular ProgressBar

TurKurT656 opened this issue · 9 comments

Hi
Can u add a circular progressBar around the FAB like this lib:
https://github.com/ckurtm/FabButton

Hi,

Useful feature. I will add it to the features queue.
I can't provide any estimations now about it cause there are a lot of other more critical features to implement

So check for updates

You Are only developer that answers my issues so quickly.
ThnQ Very Much

Thanks)

I'm available the times when not sleeping)

JV-TM commented

Hi,
I would appreciate ANY progressBar visualization as well.

Another (possibly cooler) way to do so could be to use whole button animation. Let say "disable" button (gray) and rotate it with icon inside.
And the most cool way would be to make it really simple ((-: E.g.: To set this fab:progressAnimation="@anim/fab_progress_rotate" in XML and than just programically call "actionButton.startProgress() / stopProgress()"

What do you think ?

Hi!

I'm ok with it.
Currently I'm finishing 1.1.0 version and will release it soon. I also have some plans to implement menu in Action Button. So it will take some time

If you have time and wish you can try to implement it (after 1.1.0 release) and send me the pull request

Thanks for contribution

JV-TM commented

Meanwhile I played with this (beware 15 min test - just a test)...
put progressbar behind FAB, change progressBar color programically, rotate FAB and start progressbar, then stop it when finished

<com.software.shell.fab.ActionButton
    android:id="@+id/createOrder_button"
    xmlns:fab="http://schemas.android.com/apk/res-auto"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignBottom="@+id/createOrder_layout"
    android:layout_alignParentRight="true"
    android:layout_marginBottom="-32dp"
    android:layout_marginRight="@dimen/padding20"
    android:elevation="@dimen/elevation_high"
    android:visibility="invisible"
    fab:button_color="@color/green"
    fab:button_colorPressed="@color/darkGreen"
    fab:image="@drawable/ic_send_white_24dp"
    fab:show_animation="@anim/fab_fade_in"
    tools:visibility="visible"
    />

progressBar = (ProgressBar) view.findViewById(R.id.createOrder_progressBar);
progressBar.getIndeterminateDrawable().setColorFilter(getResources().getColor(R.color.green), android.graphics.PorterDuff.Mode.MULTIPLY);

actionButton = (ActionButton) view.findViewById(R.id.createOrder_button);
actionButton.setOnClickListener(new View.OnClickListener() {
@OverRide
public void onClick(View v) {
// Progress like animation
actionButton.startAnimation(AnimationUtils.loadAnimation(getActivity(), R.anim.rotate));
progressBar.setVisibility(View.VISIBLE);
actionButton.setClickable(false);
actionButton.setButtonColor(Color.LTGRAY);

    doCreateOrder(v);

}
});
// Initial animation
actionButton.postDelayed(new Runnable() {
@OverRide
public void run() {
actionButton.show();
}
}, 250);

// FINISH operation
progressBar.setVisibility(View.GONE);
actionButton.setClickable(true);
actionButton.setButtonColor(getResources().getColor(R.color.green));
actionButton.clearAnimation();

fab1
fab2
fab3

Idea is good. However I think it would be better to draw the progress instead of using the android's ones. This is what actually differs Action Button from another libraries. All elements in this library are indeed drawn in 2D instead of using an existing implementation

We can extend the ActionButton class, override the onDraw(Canvas canvas) method and add additional ones.

JV-TM commented

Any progress? Thanks...

In plans, however I can't answer now how much time will it take. I'm planning a great refactoring + new features in the nearest time