29

I have a ListView with item contains a checkbox and some other elements. The problem is when I click on the list item on Android 5+ device I have it looks like this:

enter image description here

I don't want to have ripple effect around the checkbox. How can I acheive that?

Item XML code:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:orientation="horizontal"
          android:layout_width="match_parent"
          android:layout_height="@dimen/list_item_height"
          android:gravity="center_vertical"
          android:paddingLeft="@dimen/activity_horizontal_margin"
          android:paddingRight="@dimen/activity_horizontal_margin">

    <CheckBox
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/item_check"
        android:checked="false"
        android:focusable="false"
        android:layout_marginRight="32dp"
        android:clickable="false"/>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/item_title"
        android:textAppearance="@android:style/TextAppearance.Medium"
        android:maxLines="1"
        android:lines="1"/>

</LinearLayout>
udenfox
  • 1,594
  • 1
  • 15
  • 25

1 Answers1

55

Try setting Background as Transparent to Checkbox

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

Hope it helps.Thanks

Jagjit Singh
  • 1,909
  • 1
  • 14
  • 19