Scalified / fab

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

Update ActionButton.java #14

Closed uriel-frankel closed 9 years ago

uriel-frankel commented 9 years ago

I put the button on a list that is part of pager, and if i click on the button and make swipe the button remains pressed. So on default make it normal again

vbaidak commented 9 years ago

We could rework it to as follows:

When user swypes on a pressed Action Button and leaves the view without taking the finger - change the state to NORMAL, but do not change the state if swype happens within the Action Button.

What do you think?

uriel-frankel commented 9 years ago

Sounds good, but what about default behavior? On Mar 4, 2015 4:31 PM, "Shell Software" notifications@github.com wrote:

We could rework it to as follows:

When user swypes on a pressed Action Button and leaves the view without taking the finger - change the state to NORMAL, but do not change the state if swype happens within the Action Button.

What do you think?

— Reply to this email directly or view it on GitHub https://github.com/shell-software/fab/pull/14#issuecomment-77167163.

vbaidak commented 9 years ago

Actually we do not care about case default, because in this case onTouchEvent(MotionEvent) returns false, which means that this touch event is not processed.

I think we need to make changes for the case MotionEvent.ACTION_MOVE, where we should check whether action is inside the button or not. This will cover the situation, which you described.

I have already a method isPointInsideCircle(float pointX, float pointY) in branch 1.1.0, which checks whether action happens inside the main circle. You can check it here

uriel-frankel commented 9 years ago

Another issue:

public boolean isHidden() {

return getVisibility() == INVISIBLE;

}

should be:

public boolean isHidden() {

return getVisibility() != VISIBLE;

}

because there is gone

On Fri, Mar 6, 2015 at 9:05 PM, Shell Software notifications@github.com wrote:

Closed #14 https://github.com/shell-software/fab/pull/14.

— Reply to this email directly or view it on GitHub https://github.com/shell-software/fab/pull/14#event-247710454.

vbaidak commented 9 years ago

Not sure about this.

As I see it isHidden() shows whether view's visibility is set to INVISIBLE rather than not VISIBLE For other cases like GONE we could have isGone() method

Could you please tell me whether this affects you somehow?

Thank you