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

Ripple state reset on UP_ACTION outside of FAB #39

Open
fritzsche91 opened this issue Sep 27, 2015 · 8 comments
Open

Ripple state reset on UP_ACTION outside of FAB #39

fritzsche91 opened this issue Sep 27, 2015 · 8 comments

Comments

@fritzsche91
Copy link

In order to reset the ActionButton state on an UP_ACTION outside of the view bounds, I had to include the following workaround:

actionButton.setOnTouchListener(new View.OnTouchListener() {
    @Override
    public boolean onTouch(@NonNull View view, @NonNull MotionEvent event) {
        int action = event.getAction();
        if((action == MotionEvent.ACTION_CANCEL) || (action == MotionEvent.ACTION_UP)) {
            actionButton.setState(ActionButton.State.NORMAL); // fix ripple handling
        }
        return false; // default handling
    }
});
@vbaidak
Copy link
Member

vbaidak commented Sep 28, 2015

Hi fritzsche91,

Could you please provide the case and the issue itself in more details?

As far as I understood you are leaving the view bounds while the ActionButton is pressed?

@fritzsche91
Copy link
Author

Hi,

This is the step-by-step use case:

  • click on ActionButton (within view bounds)
  • move outside the view bounds while touching the screen (movement)
  • stop touching the view (outside view bounds)
    -> ActionButton stays selected (pressed color)

@vbaidak
Copy link
Member

vbaidak commented Sep 28, 2015

Hi,

This issue was fixed in version 1.1.0.

I'm showing this fix in this video:
https://youtu.be/7GHAcX2myh8

What version are you using?

@fritzsche91
Copy link
Author

The version I am using right now is 1.1.2. So it seems, that the mentioned issue has not been fixed for my Nexus 5.

@vbaidak
Copy link
Member

vbaidak commented Sep 30, 2015

The problem is that I can't reproduce it. Is it specific only for Nexus 5?

Could you please try to use demo application from the project to check this?

@fritzsche91
Copy link
Author

The thing is that I tested it only with my Nexus 5 for now. As I have only very limited time the next days, I am not sure if I am able to do more testing on this.

I used your ActionButton with the following configuration:

<com.software.shell.fab.ActionButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:button_color="@color/fab_material_pink_500"
    app:button_colorPressed="@color/fab_material_pink_500"
    app:image="@drawable/ic_thumb_up_white"
    app:rippleEffect_enabled="true" />

@vbaidak
Copy link
Member

vbaidak commented Oct 1, 2015

Good, I'll check it soon (currently my PC is disassembled)

Anyway I can add the code you've sent into the library as a quick fix

@fritzsche91
Copy link
Author

Sounds good to me, because it shouldn't break anything and fixed it for my Nexus 5.

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

No branches or pull requests

2 participants