Android 5.0 (Lollipop) CheckedTextView causes backlight problems

I have a problem with RecyclerView populated by CheckedTextViews when working on Android 5.0 Lollipop. All versions prior to Lollipop are beautiful and do not demonstrate this problem. Check out the pictures below for a better understanding:

Pre-candy

pre-lollipop screenshot

Lollipop

lollipop screenshot

See how Lollipop only selects selection selections on top of the entire CheckedTextView checkbox? Pre-Lollipop does not have this problem / error and draws a selection selection over the entire width of the view (this is the behavior I want).

Here is the CheckedTextView that I draw in the list:

<?xml version="1.0" encoding="utf-8"?>
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:background="?attr/selectableItemBackground"
    android:checkMark="@drawable/checkbox"
    android:id="@+id/model_checkable_name"
    android:layout_height="48dp"
    android:layout_width="match_parent" />

Any ideas? I have tried several different solutions, such as android:focusable="false", android:duplicateParentState="true", android:duplicateParentState="false"...

Thanks guys!

+4
1

, , Google IO, CheckBoxPreference, , , , Lollipop CheckedTextView.

backgroundselectablebordeless, .

?

EDIT:

framelayout checktextview onClickListener frameelayout, checkcheview . framelayout checkedtextview :

          <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="56dp"
                android:layout_marginEnd="8dp"
                android:layout_marginLeft="8dp"
                android:layout_marginRight="8dp"
                android:layout_marginStart="8dp">

                <FrameLayout
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:layout_alignParentBottom="true"
                    android:layout_marginTop="8dp"
                    android:background="@color/md_divider" />

                <android.support.v7.widget.SwitchCompat
                    android:id="@+id/switchWidget"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_alignParentEnd="true"
                    android:layout_alignParentRight="true"
                    android:layout_centerVertical="true"
                    android:padding="16dp"
                    android:text="Switch Widget Title"
                    android:textAppearance="@style/TextAppearance.AppCompat.Inverse"
                    android:textColor="@color/md_text"
                    android:textSize="16sp" />

                <FrameLayout
                    android:id="@+id/frameLayoutSwitch"
                    android:clickable="true"
                    android:background="?attr/selectableItemBackground"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"/>
            </RelativeLayout>
0

All Articles