1

I have problem with RadioButton ripple effect. I want get this: I have ripple in full background of list item

but I have this: I have ripple only around mark

How can I implement this?

Zain
  • 37,492
  • 7
  • 60
  • 84

3 Answers3

0

Apply click listener on itemView and in that listener check radio button as true or false. Change the backgroundTint to required color of radio button.

Umer Iqbal
  • 18
  • 6
0

Ripple effect is available for API-level 21+ you can apply it to Radio buttons with android:background="?android:attr/selectableItemBackground" for each individual button

<RadioGroup
    android:id="@+id/radiogroup"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

    <RadioButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="?android:attr/selectableItemBackground"
        android:text="Option number one" />

    <RadioButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="?android:attr/selectableItemBackground"
        android:text="Option number two" />
</RadioGroup>
Zain
  • 37,492
  • 7
  • 60
  • 84
0

Use CheckedTextView in ListView with SINGLE_CHOICE_MODE parameter.