Why PreferenceScreen
in AndroidX
not similar to original PreferenceScreen
?
Even in documentation we can see in the image that the screen is shifted right.
I started new project in AndroiX and the items in PreferenceScreen
shifted and I have no dividers.
How to give it the old look without overhead with customization?
That's because the preference automatically give you a space for an icon. You can disable that by disabling the space using app:iconSpaceReserved="false"
. Something like this:
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceCategory
android:title="your_title"
app:iconSpaceReserved="false">
...
</PreferenceCategory>
</PreferenceScreen>