gregkorossy/Android-Support-Preference-V7-Fix

Layout problem with SDK 28

RiRomain opened this issue · 2 comments

This is not specific to this project, but it seems like the Preference layout is broken with SDK version 28.
There is a margin on the left of the preference:
LeftMarginOnPreferencePreview

Did someone else encounter this behaviour?

(tested on an Android P emulator, Galaxy S8+ Android 8.0.0, Honor 6X Android 7.0)

Here is a complete view of the demo app:
LeftMarginOnPreference

Ok, seems to be a "feature"

https://issuetracker.google.com/issues/111907042#comment6

Status: Won't Fix (Intended Behavior)
Always reserving icon space is intended according to Material design patterns - see https://material.io/design/platform-guidance/android-settings.html

Given that PreferenceThemeOverlay follows Material specifications, if you do not want any icon space reserved the simplest way would be to create your own theme that extends PreferenceThemeOverlay, and sets iconSpaceReserved to false for each relevant Preference type.

Yes, it is the intended behavior. You can set the app:iconSpaceReserved="false" in the preference XML, too, on every Preference.