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

Not able to disable clicks #76

Open
shahimclt opened this issue Jan 26, 2017 · 6 comments
Open

Not able to disable clicks #76

shahimclt opened this issue Jan 26, 2017 · 6 comments

Comments

@shahimclt
Copy link

I Applied MRL on a LinearLayout. I want to disable/enable clicks on that view using view.setClickable(boolean). but the MRL seems to ignore that. So is there any way to enable/disable the ripple and click action?

@shahimclt shahimclt changed the title Not enable to disable clicks Not able to disable clicks Jan 26, 2017
@Hitexroid
Copy link

Hitexroid commented Mar 25, 2017

set rippleAlpha to 0

@SirWellington
Copy link

I am also having this problem, and setting the alpha to 0 did not help.

@SirWellington
Copy link

SirWellington commented Jun 28, 2017

Worked around this problem by using my own boolean flag to prevent multiple firings.

if (inFlight)
  return

inFlight = true
//some code...
inFlight = false

@akashk1992
Copy link

akashk1992 commented Aug 10, 2017

@shahimclt
you have to customise the library>>
Write below public method in MaterialRippleLayout class
public void setEnableRipple(boolean enable) { this.rippleEnable = enable;//Default Value Should be set to 'true' at class level }

And in onTouch:
@Override public boolean onTouchEvent(MotionEvent event) { boolean superOnTouchEvent = super.onTouchEvent(event); if (!rippleEnable) return superOnTouchEvent; ..... ..... }

Usage :
materialRippleLayout.setEnableRipple(false);

That's it..

@Hitexroid
Copy link

Works for me .

rippleLayout.setRippleOverlay(false);
rippleLayout.setDefaultRippleAlpha(0);

@M0N3
Copy link

M0N3 commented Mar 9, 2020

set rippleAlpha to 0

then set it's value to 51 in clickListener

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

5 participants