Fixed
Status Update
Comments
ad...@google.com <ad...@google.com> #2
We have passed this to the development team and will update this issue with more information as it becomes available.
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit b237a242be6144b18126f8a3b45908fa8234597b
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Tue Jul 24 15:51:33 2018
Fixes iconSpaceReserved not working with PreferenceCategory
Also restructures layout to be similar to preference_material
Bug: b/111442564
Bug: b/111662669
Test: Manually verified
Change-Id: I058a35efe3ead697fee0e6bceda2e531aaebb8c3
M preference/res/layout-v17/preference_category_material.xml
M preference/res/layout-v21/preference_category_material.xml
M preference/res/layout/preference_category_material.xml
D preference/res/values-sw360dp/dimens.xml
M preference/res/values/dimens.xml
https://android-review.googlesource.com/720970
https://goto.google.com/android-sha1/b237a242be6144b18126f8a3b45908fa8234597b
Branch: androidx-master-dev
commit b237a242be6144b18126f8a3b45908fa8234597b
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Tue Jul 24 15:51:33 2018
Fixes iconSpaceReserved not working with PreferenceCategory
Also restructures layout to be similar to preference_material
Bug:
Bug:
Test: Manually verified
Change-Id: I058a35efe3ead697fee0e6bceda2e531aaebb8c3
M preference/res/layout-v17/preference_category_material.xml
M preference/res/layout-v21/preference_category_material.xml
M preference/res/layout/preference_category_material.xml
D preference/res/values-sw360dp/dimens.xml
M preference/res/values/dimens.xml
ad...@google.com <ad...@google.com> #4
The development team has fixed the issue that you have reported and it will be available in a future build.
be...@gmail.com <be...@gmail.com> #5
The issue marked as fixed after 1.0.0-alpha1 in July but can still be reproduced in final 1.0.0 release in September. Should we reopen the ticket as not fixed or the changes have not been merged into the release yet?
hd...@icloud.com <hd...@icloud.com> #6
Same in 1.0.0.
re...@gmail.com <re...@gmail.com> #7
It does not works for me too in 1.0.0
bc...@gmail.com <bc...@gmail.com> #8
Not fixed
vl...@gmail.com <vl...@gmail.com> #9
The issue is still present in 1.0.0 for me.
ra...@gmail.com <ra...@gmail.com> #10
The issue is still in v1.0.0.
to...@gmail.com <to...@gmail.com> #11
I'm facing the same issue in androidx.legacy:legacy-preference-v14:1.0.0 too (while this ticket refers to androidx.preference:preference:1.0.0)
ha...@gmail.com <ha...@gmail.com> #12
Unfortunately, the issue is still in androidx.preference v1.0.0
lp...@google.com <lp...@google.com> #13
Hi all,
This unfortunately missed 1.0.0, but will available in a future release.
This unfortunately missed 1.0.0, but will available in a future release.
hr...@web.de <hr...@web.de> #14
Is there a date for it? It would be good to know if investing time for a workaround is worth it. Thanks in advance e fir a reply!
pa...@gmail.com <pa...@gmail.com> #15
The app:iconSpaceReserved="false" do not works in PreferenceCategory title .Is there any alternate method .
gi...@gmail.com <gi...@gmail.com> #16
I have implemented a solution similar to the one in https://stackoverflow.com/a/52573593/1180091 and it is working as a temporary workaround.
eb...@gmail.com <eb...@gmail.com> #17
not working for me as well, style: Base.Theme.AppCompat.Light.DarkActionBar
lb...@gmail.com <lb...@gmail.com> #18
@13 Is the fix available now?
lp...@google.com <lp...@google.com> #19
lb...@gmail.com <lb...@gmail.com> #20
@19 Thank you. Now can you please add an option to set it for the whole PreferenceFragment without any tricks on our side?
lb...@gmail.com <lb...@gmail.com> #21
@19 Correction: PreferenceFragmentCompat
kr...@gmail.com <kr...@gmail.com> #23
This is not working for me in 1.1.0-alpha04
lp...@google.com <lp...@google.com> #24
Could you clarify please? What isn't working?
kr...@gmail.com <kr...@gmail.com> #25
Sorry, app:iconSpaceReserved="false" doesn't seem to be recognized. This my code:
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android "
xmlns:app="http://schemas.android.com/apk/res-auto ">
<PreferenceCategory android:key="display_settings" android:title="@string/settings_podcasts_settings_title_display" app:iconSpaceReserved="false">
<ListPreference
android:key="pref_theme"
android:title="Title"
android:entries="@array/theme_options_text"
android:entryValues="@array/theme_options_values"
android:defaultValue="0"
android:icon="@drawable/ic_setting_dropdown_indicator"
android:foreground="?android:attr/selectableItemBackground"
app:iconSpaceReserved="false"
/>
<ListPreference
android:key="pref_header_color"
android:title="Color"
android:entries="@array/header_color_text"
android:entryValues="@array/header_color_values"
android:icon="@drawable/ic_setting_dropdown_indicator"
android:defaultValue="10"
app:iconSpaceReserved="false"
/>
</PreferenceCategory>
</androidx.preference.PreferenceScreen>
As you can see, there is a huge amount of space between the image and text. Setting app:iconSpaceReserved to true or removing doesn't change anything. I do have a style set on the activity to add padding to the entire preference:
<style name="Theme.PrefSettings" parent="Main">
<item name="android:paddingLeft">5dp</item>
<item name="android:paddingRight">5dp</item>
</style>
Manifest entry:
<activity android:name=".Settings.SettingsPodcastsDisplayActivity" android:theme="@style/Theme.PrefSettings" />
My app is for WearOs so I can't afford to have that much space between the icon and text if the space is by design. If it is supposed to be there we need some kind of wearable preference because WearOS apps don't have the screen size luxury of phone apps.
<androidx.preference.PreferenceScreen xmlns:android="
xmlns:app="
<PreferenceCategory android:key="display_settings" android:title="@string/settings_podcasts_settings_title_display" app:iconSpaceReserved="false">
<ListPreference
android:key="pref_theme"
android:title="Title"
android:entries="@array/theme_options_text"
android:entryValues="@array/theme_options_values"
android:defaultValue="0"
android:icon="@drawable/ic_setting_dropdown_indicator"
android:foreground="?android:attr/selectableItemBackground"
app:iconSpaceReserved="false"
/>
<ListPreference
android:key="pref_header_color"
android:title="Color"
android:entries="@array/header_color_text"
android:entryValues="@array/header_color_values"
android:icon="@drawable/ic_setting_dropdown_indicator"
android:defaultValue="10"
app:iconSpaceReserved="false"
/>
</PreferenceCategory>
</androidx.preference.PreferenceScreen>
As you can see, there is a huge amount of space between the image and text. Setting app:iconSpaceReserved to true or removing doesn't change anything. I do have a style set on the activity to add padding to the entire preference:
<style name="Theme.PrefSettings" parent="Main">
<item name="android:paddingLeft">5dp</item>
<item name="android:paddingRight">5dp</item>
</style>
Manifest entry:
<activity android:name=".Settings.SettingsPodcastsDisplayActivity" android:theme="@style/Theme.PrefSettings" />
My app is for WearOs so I can't afford to have that much space between the icon and text if the space is by design. If it is supposed to be there we need some kind of wearable preference because WearOS apps don't have the screen size luxury of phone apps.
lp...@google.com <lp...@google.com> #26
This is a separate issue - there isn't a Wear OS specific theme / support in AndroidX. Could you add this comment to issue 73628225 ?
kr...@gmail.com <kr...@gmail.com> #27
Man, Google really treats WearOS like a second class citizen.
I'm getting an "Access denied" error on the issue you linked.
I'm getting an "Access denied" error on the issue you linked.
lp...@google.com <lp...@google.com> #28
Apologies, should be issue 73183201 instead
kr...@gmail.com <kr...@gmail.com> #29
I just converted all of my preferences over to AndroidX only to find out WearOS isn't supported yet and I've just spent the last hour reverting all my changes.
kr...@gmail.com <kr...@gmail.com> #30
Sorry ignore this, I mean to write it on the other issue
sh...@gmail.com <sh...@gmail.com> #31
Unfortunately, in the official version of 1.1.0, the issue of iconSpaceReserved still exists.
lp...@google.com <lp...@google.com> #32
Could you clarify exactly what issue you are facing?
je...@gmail.com <je...@gmail.com> #33
#31 it is sovled, u need add app:iconSpaceReserved="false"
[Deleted User] <[Deleted User]> #34
I have finally gotten around to removing the workaround, only to find the issue to still be there...
The PreferenceCategory
still ignores the iconSpaceReserved
attribute.
Can someone refer me to the part of the release notes where this issue was marked as fixed?
[Deleted User] <[Deleted User]> #35
Ignore the last comment, my mistake.
Didn't catch we were importing legacy-preference-v14
.
The issue is fixed in androidx.preference:preference
.
Description
Version used: 1.0.0-beta01
Theme used: Theme.MaterialComponents.Light.NoActionBar
Devices/Android versions reproduced on: all Android versions
PreferenceCategory does not respect the iconSpaceReserved attribute. Whether it's set to true or false, the layout doesn't change and on most devices the icon space is reserved (small screen devices doesn't do it).
Sample XML:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="
xmlns:app="
<PreferenceCategory
android:title="Icon space not reserved category"
app:iconSpaceReserved="false">
<Preference
android:persistent="false"
android:summary="This is just a preference with its icon space unreserved"
android:title="Preference (unreserved)"
app:iconSpaceReserved="false" />
</PreferenceCategory>
</PreferenceScreen>
Attached screenshots for API 15 (480x800, hdpi), API 17 (1080x1920, xxhdpi), and API 26 (1080x1920, 420dpi) emulators.