Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request - Circular ProgressBar #13

Open
TurKurT656 opened this issue Mar 4, 2015 · 9 comments
Open

Request - Circular ProgressBar #13

TurKurT656 opened this issue Mar 4, 2015 · 9 comments
Assignees

Comments

@TurKurT656
Copy link

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

@vbaidak
Copy link
Member

vbaidak commented Mar 4, 2015

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

@TurKurT656
Copy link
Author

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

@vbaidak
Copy link
Member

vbaidak commented Mar 4, 2015

Thanks)

I'm available the times when not sleeping)

@JV-TM
Copy link

JV-TM commented Apr 15, 2015

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 ?

@vbaidak
Copy link
Member

vbaidak commented Apr 15, 2015

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

JV-TM commented Apr 15, 2015

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

@vbaidak
Copy link
Member

vbaidak commented Apr 15, 2015

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.

@vbaidak vbaidak self-assigned this May 28, 2015
@JV-TM
Copy link

JV-TM commented Sep 8, 2015

Any progress? Thanks...

@vbaidak
Copy link
Member

vbaidak commented Sep 8, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants