andreluizreis
10/2/2017 - 2:31 AM

Custom layout for the preferenceCategory

//  custom layout for the preferenceCategory
// From: https://stackoverflow.com/questions/11607302/how-to-change-text-color-of-preference-category-in-android

// An easy way to do this is to set the custom layout for the preferenceCategory here:
<PreferenceCategory
    android:layout="@layout/preferences_category"
    android:title="Privacy" />
  
  // Then set your code inside your preferences_category.xml layout file:
  <?xml version="1.0" encoding="utf-8"?>
<TextView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/title"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingEnd="15dp"
    android:paddingLeft="15dp"
    android:paddingRight="15dp"
    android:paddingStart="15dp"
    android:paddingTop="15dp"
    android:textColor="@color/colorPrimary"
    android:textSize="15sp"
    android:textStyle="bold"/>