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 49 forks source link

PreferenceCategory use "iconSpaceReserved" not work #132

Open tcqq opened 6 years ago

tcqq commented 6 years ago

I tried using "iconSpaceReserved" into "PreferenceCategory", but it did not work.

How to create "PreferenceCategory with picture red box same effect?

image

https://material.io/guidelines/patterns/settings.html#settings-usage

gregkorossy commented 6 years ago

Yeah, it wouldn't work because the categories has no icons. I'll see if the padding can be implemented though.

tcqq commented 6 years ago

Ok.

tcqq commented 6 years ago

Hi, is this problem now supported?

gregkorossy commented 6 years ago

It is automatically supported by the support lib v28.0.0-alpha3 (and thus v28.0.0.0-alpha3 of this lib too).

gregkorossy commented 6 years ago

PreferenceCategory still does not support the iconSpaceReserved attribute properly. Reported the issue to Google: https://issuetracker.google.com/issues/111662669. This library will provide a temporary fix for the AndroidX version in the unreserved-way (meaning that icon space reservation won't be forced on smaller screen devices, thus, only the false value should be used, if needed at all).

gregkorossy commented 6 years ago

The AndroidX version's v1.0.0-alpha2 contains the temporary fix.

gregkorossy commented 5 years ago

The reported issue says it was fixed, however, the official lib v1.0.0 still doesn't contain the fixes, so this lib keeps providing the bug fix.

yccheok commented 5 years ago

@Gericop Thanks for providing the fix. Currently, our app doesn't use AndroidX. But, we do use Android Architecture Component in the following way.

def lifecycle_version = "1.1.1"
// ViewModel and LiveData
implementation "android.arch.lifecycle:extensions:$lifecycle_version"
// alternately - if using Java8, use the following instead of compiler
implementation "android.arch.lifecycle:common-java8:$lifecycle_version"

def room_version = "1.1.1"
implementation "android.arch.persistence.room:runtime:$room_version"
annotationProcessor "android.arch.persistence.room:compiler:$room_version"

def work_version = "1.0.0-alpha09"
implementation "android.arch.work:work-runtime:$work_version" // use -ktx for Kotlin
// optional - Firebase JobDispatcher support
implementation "android.arch.work:work-firebase:$work_version"

Your implementation 'com.takisoft.fix:preference-v7:28.0.0.0' works well for us except Google breaks app:iconSpaceReserved="false" in PreferenceCategory.

Is it suitable for us to use your The AndroidX version's v1.0.0-alpha2 for our case, or can the temporary fix on PreferenceCategory can be carry forward to v7:28.0.0.0?

Thank you very much.

alihasan95 commented 5 years ago

How remove the padding from PreferenceCategory

zhanghai commented 5 years ago

Check out my answer on StackOverflow for overriding a <dimen> to fix this.