Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>To allow preference divider padding</strong></p> <p><strong>first</strong> : add this line to your preference activity which lead to transparency of android default divider </p> <pre><code>list.setDivider(new ColorDrawable(0x00000000)); </code></pre> <p><strong>second</strong> : create folder named drawable in res , then create on it divider.xml which will be as below :</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;shape xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;solid android:color="#B22222" /&gt; &lt;/shape&gt; </code></pre> <p><strong>third</strong> :</p> <p>add View to your mylayout.xml so it will be as below :</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="?android:attr/listPreferredItemHeight" android:gravity="center_vertical" android:paddingRight="?android:attr/scrollbarSize"&gt; &lt;LinearLayout android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center" android:minWidth="@dimen/preference_icon_minWidth" android:orientation="horizontal"&gt; &lt;ImageView android:id="@+android:id/icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" /&gt; &lt;/LinearLayout&gt; &lt;RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="16dip" android:layout_marginRight="8dip" android:layout_marginTop="6dip" android:layout_marginBottom="6dip" android:layout_weight="1"&gt; &lt;TextView android:id="@+android:id/title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceMedium" android:fadingEdge="horizontal" /&gt; &lt;TextView android:id="@+android:id/summary" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@android:id/title" android:layout_alignLeft="@android:id/title" android:textAppearance="?android:attr/textAppearanceSmall" android:textColor="?android:attr/textColorSecondary" android:maxLines="4" /&gt; &lt;View android:id="@+id/divider" android:background="@drawable/divider" android:layout_width="match_parent" android:layout_marginLeft="30dp" android:layout_marginRight="30dp" android:layout_height="5dp" android:layout_below="@+android:id/summary"/&gt; &lt;/RelativeLayout&gt; &lt;!-- Preference should place its actual preference widget here. --&gt; &lt;LinearLayout android:id="@+android:id/widget_frame" android:layout_width="wrap_content" android:layout_height="match_parent" android:minWidth="@dimen/preference_widget_width" android:gravity="center" android:orientation="vertical" /&gt; </code></pre> <p></p> <p>the point here you add View bellow your texts and refer that view to divider shape in drawable res so finally you will get an custom divider which it can be customized as you need.</p> <p>hope that help you .</p> <p>the output will be as below:</p> <p><img src="https://i.stack.imgur.com/QrEhj.jpg" alt="enter image description here"></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.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    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