gregkorossy / Android-Support-Preference-V7-Fix

Android androidx.preference support library has some issues, this lib tries to fix them.
https://discord.gg/87NVsSK
Apache License 2.0
497 stars 46 forks source link

Layout problem with SDK 28 #183

Closed RiRomain closed 6 years ago

RiRomain commented 6 years ago

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

RiRomain commented 6 years ago

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.

gregkorossy commented 6 years ago

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