title: How to get Android system preferences look?
body: <p>The android system preferences screen on lollipop appears to be using a layout that resembles the "card layout".</p>
  
  <p><a href="https://i.stack.imgur.com/EyacM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EyacM.png" alt="enter image description here"></a></p>
  
  <p>I'm trying to get the same look for my app, but can't see how they achieved it with the default <code>PreferenceFragment</code>. Can anyone explain to me, how I can achieve the same effect without having to write my own preferences?</p>
  
  <hr>
  
  <p>Note that I have seen and read these questions, but they don't provide a suitable answer:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/34372517/how-to-achieve-preference-category-cards-like-android-system-settings">How to achieve preference category cards like Android System Settings</a> (Answer simply shows how to create a layout that looks similar. Has nothing to do with <code>PreferenceFragment</code>)</li>
  <li><a href="https://stackoverflow.com/questions/31318222/android-lollipop-sections-separator-divider">Android Lollipop Sections Separator/Divider</a> (Refers to preferences screenshot, but OP doesn't seem to want to apply it to <code>PreferenceFragment</code>)</li>
  </ul>
  
  <hr>
  
  <p>If it's of interest, my current preferences xml looks like this:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
                    xmlns:custom="http://schemas.android.com/apk/res-auto"&gt;
  
      &lt;PreferenceCategory android:title="@string/preferences_title_general"&gt;
          &lt;Preference
              android:key="Prefs.Delete.Row.Token"
              android:summary="@string/preferences_delete_row_token_summary"
              android:title="@string/preferences_delete_row_token_title"/&gt;
          &lt;Preference
              android:key="Prefs.Delete.Cell.Token"
              android:summary="@string/preferences_delete_cell_token_summary"
              android:title="@string/preferences_delete_cell_token_title"/&gt;
          &lt;Preference
              android:key="Prefs.Null.Token"
              android:summary="@string/preferences_null_token_summary"
              android:title="@string/preferences_null_token_title"/&gt;
      &lt;/PreferenceCategory&gt;
      &lt;PreferenceCategory android:title="@string/preferences_title_appearance"&gt;
          &lt;SwitchPreference
              android:dialogTitle="@string/preferences_theme_title"
              android:key="Prefs.Appearance.Theme"
              android:summaryOff="@string/preferences_theme_summary_off"
              android:summaryOn="@string/preferences_theme_summary_on"
              android:switchTextOff="@string/general_no"
              android:switchTextOn="@string/general_yes"
              android:title="@string/preferences_theme_title"/&gt;
      &lt;/PreferenceCategory&gt;
      &lt;PreferenceCategory android:title="@string/preferences_title_misc"&gt;
          &lt;SwitchPreference
              android:dialogTitle="@string/preferences_read_back_title"
              android:key="Prefs.Voice.Feedback"
              android:switchTextOff="@string/general_no"
              android:switchTextOn="@string/general_yes"
              android:title="@string/preferences_read_back_title"/&gt;
          &lt;Preference
              android:key="Prefs.Export.Barcode.Properties"
              android:title="@string/preferences_export_title"
              android:summary="@string/preferences_export_summary"/&gt;
          &lt;Preference
              android:key="Prefs.Show.Eula"
              android:title="@string/preferences_eula_title"
              android:summary="@string/preferences_eula_summary"/&gt;
      &lt;/PreferenceCategory&gt;
  
  &lt;/PreferenceScreen&gt;
  </code></pre>
  
  <p>And I extend <code>PreferenceFragment</code> and load the xml via</p>
  
  <pre class="lang-java prettyprint-override"><code>addPreferencesFromResource(R.xml.prefs);
  </code></pre>