Note that there are some explanatory texts on larger screens.

plurals
  1. POCheckBoxPreference with own layout
    primarykey
    data
    text
    <p>I have PreferenceScreen with some PreferenceCheckBoxes. I want to change the textColor and textSize for title and summary and the images for the CheckBox checked and uncheckes. So I am using <code>android:layout</code> to change this attributes.</p> <p>My ChceckBoxPreference:</p> <pre><code>&lt;CheckBoxPreference android:layout="@layout/preference_checkbox" android:key="temp" android:title="@string/title" android:summary="@string/summary" android:defaultValue="true" /&gt; </code></pre> <p>When I use <code>android:widgetLayout</code> it looks strange. And this is my preference_checkbox.xml:</p> <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="10dp" &gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentLeft="true" android:layout_marginLeft="10dp" &gt; &lt;TextView android:id="@+android:id/title" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textColor="@color/gray" android:textSize="20sp" /&gt; &lt;TextView android:id="@+android:id/summary" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textColor="@color/gray" android:textSize="14sp" /&gt; &lt;/LinearLayout&gt; &lt;CheckBox android:id="@+android:id/checkbox" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentRight="true" android:layout_marginRight="10dp" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p>Title with id <code>@+android:id/title</code> and summary with <code>@+android:id/summary</code> are showing correct values. However the checkbox despite of default value and id <code>@+android:id/checkbox</code> is not working properly. It isn't showing correct value and I can't change the value kept in preferences. Without using any layout, I can change value of checkbox by touch at the whole CheckBoxPreference. But now (with my layout) I can change value of checkbox only by touch on this checkbox. How can I make layout for CheckBoxPreference in properly way with all the functionalities?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload