Remove ripple effect from RadioButton, android?

I have a custom RadioButton style for adding a radio block image on the right side

<RadioButton
                android:layout_margin="20dp"
                android:drawableRight="@drawable/custom_btn_radio"
                android:button="@null"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="Invite Only"/> 

custom_btn_radio.xml

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/check_box" android:state_checked="false"/>
    <item android:drawable="@drawable/close_btn" android:state_checked="true"/>
</selector>

but the ripple effect of the radio object also increased. How can I remove the ripple effect from RadioButton? as well as how to adjust the ripple effect?

Thanks in advance.

+4
source share
2 answers

Make Transparent RadioButton Background

android:background="#ffffffff"

or

android:background="@android:color/transparent"

Tank you @ Harry

+19
source
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
    android:color="@android:color/transparent"> <!-- ripple color -->

    <item android:drawable="your color"/> <!-- normal color -->

</ripple>
0
source

All Articles