WAI
Status Update
Comments
ko...@gmail.com <ko...@gmail.com> #2
You can use the app:iconSpaceReserved attribute to remove the extra space if you don't need it. It's slightly related to https://issuetracker.google.com/issues/111662669 in a way that PreferenceCategory doesn't (it has been fixed but not released) respect this attribute.
lb...@gmail.com <lb...@gmail.com> #3
@2 Seems to work, but:
1. As you wrote, doesn't work for PreferenceCategory yet.
2. Needs setting of each of the preferences ? Is there a way to do it for all? Maybe please consider adding an attribute to the parent of the preferences, to apply to all its descendants ? Something similar to "gravity" for layouts (but deeper if needed).
3. Any way to have the spacing for all, but only if at least one preference has an icon? This way, it would make a bit sense to have the space, so that all will be aligned...
1. As you wrote, doesn't work for PreferenceCategory yet.
2. Needs setting of each of the preferences ? Is there a way to do it for all? Maybe please consider adding an attribute to the parent of the preferences, to apply to all its descendants ? Something similar to "gravity" for layouts (but deeper if needed).
3. Any way to have the spacing for all, but only if at least one preference has an icon? This way, it would make a bit sense to have the space, so that all will be aligned...
lb...@gmail.com <lb...@gmail.com> #4
@2 Also, I've tried to set isIconSpaceReserved via code, so that it will be applied automatically for all preferences (on onBindViewHolder) , but since it calls "notifyChanged" , it causes a crash.
Really wish for an easier way to set it all autmatically.
Really wish for an easier way to set it all autmatically.
ad...@google.com <ad...@google.com>
ad...@google.com <ad...@google.com> #5
We have passed this to the development team and will update this issue with more information as it becomes available.
ad...@google.com <ad...@google.com> #6
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.
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.
lb...@gmail.com <lb...@gmail.com> #7
@6 Doesn't seem like the guidelines say what you wrote, and it also doesn't seem like they have an example of what looks nice when there are no icons.
It doesn't make sense to use so much vertical space from devices that are mainly vertical, when there is no content to show there.
Even Google doesn't have this behavior on its apps, and there are even settings screens on Android P itself that don't have this spacing.
You can see my screenshots attached here as examples for this. In fact, I can't find even one app of Google that has this useless spacing.
I can send you more screenshots if you wish. Those with numbers are from the settings screens. The rest are of the apps.
There should be a proper way to overcome this globally for the entire PreferenceFragmentCompat, by setting some kind of style.
Can you please show how to do it? This topic is very new and there is almost nothing to read on the docs about it.
It doesn't make sense to use so much vertical space from devices that are mainly vertical, when there is no content to show there.
Even Google doesn't have this behavior on its apps, and there are even settings screens on Android P itself that don't have this spacing.
You can see my screenshots attached here as examples for this. In fact, I can't find even one app of Google that has this useless spacing.
I can send you more screenshots if you wish. Those with numbers are from the settings screens. The rest are of the apps.
There should be a proper way to overcome this globally for the entire PreferenceFragmentCompat, by setting some kind of style.
Can you please show how to do it? This topic is very new and there is almost nothing to read on the docs about it.
ar...@gmail.com <ar...@gmail.com> #9
Fraud
Description
Version used:
implementation 'androidx.appcompat:appcompat:1.0.0-beta01'
implementation 'androidx.preference:preference:1.0.0-beta01'
Theme used:
Devices/Android versions reproduced on:
Pixel 2 with Android P DP 4
- Relevant code to trigger the issue.
You can find it here:
Based on this sample:
The bug is that there is no reason to save so much space for preferences, if they don't have an icon, especially if none of the preferences have an icon.
If this is intended, please give us the ability to avoid this behavior, and add extra space for the icon only if it exists, as was done before (see attached sample project).
Maybe add a style boolean attribute that will make it work so that whenever there is an icon, it will have space for it, and when it doesn't, avoid the extra space.
- A screenrecord or screenshots showing the issue (if UI related).
Attached before, and after.
For now, the only workaround I've found is by using the adapter and changing the views it binds to:
Attached video and sample project to also show how it could work instead, after I've applied my workaround.