There's more elegant solution, at least for PreferenceFragmentCompat, to define the padding in a theme. Assume we have our activity set a android:theme="@style/PreferenceTheme"