Scalified / fab

Floating Action Button Library for Android
Apache License 2.0
849 stars 164 forks source link

Can Drag? #43

Closed luckerbai closed 7 years ago

luckerbai commented 8 years ago

I want drag this button, how can I do this ?

vbaidak commented 8 years ago

Hi luckerbai.

Thank you for using ActionButton library.

There are few ways of moving ActionButton depending on what you need to implement. In general, ActionButton extends an Android View class, so it is a simple view, which supports all of the available View class actions.

Answering your question, using an Android Dragging and Scaling way, you can simply override onTouchEvent(MotionEvent) method as follows:

@Override
public boolean onTouchEvent(MotionEvent ev) {
    super.onTouchEvent(ev);
    // your code goes here
}

or move the ActionButton using any of the move methods.