How to disable ripple effect on long press of a button in lollipop?
Asked Answered
T

2

6

How to disable ripple effect on long press of a button in lollipop?

When using sherlock long press of a button is not showing ripple effect but when i use appcompat it is showing a ripple effect on click and also on long click of a button . I do not want any ripple effect on the press of a button

Thorfinn answered 7/7, 2015 at 8:46 Comment(0)
R
6

If you are using MaterialButton, then set app:rippleColor:

<com.google.android.material.button.MaterialButton
    ...
    app:rippleColor="@android:color/transparent" />

Thanks to this and this answer for their help.

Rabush answered 14/10, 2020 at 9:31 Comment(0)
S
-1

If you have root, have a look at my patch here https://github.com/luv/android5_noripple

My patch simply replaces draw function in android.graphics.drawable.Ripple with a function that does nothing but returns True.

You need to fetch /system/framework/framework.jar from your phone, patch it, and push it back (you need root for this). See the link for step-by-step instructions.

Scop answered 11/1, 2016 at 3:2 Comment(1)
The link is broken, please include excerpts when posting solutions from a remote source. That way the solution will still be available for future readers.Crummy

© 2022 - 2024 — McMap. All rights reserved.