Closed alexandrucene closed 4 years ago
You can re-compile the source yourself, after changing the import of the DialogPreference to use one from the support library. You should only need to change the import here, I think:
Thank you for the fast response. Is there any chance this would be included in a future update?
I wasn't planning to. I don't use the support preference in the app I wrote it for.
I would love if this would be supported in the future!
What min SDK are you using? And what preference features do you need that aren't available using the standard android.preference.Preference etc.? I'm not aware of a reason to use the support preferences these days.
In my case, the app has a min SDK of 9. I can make also 11, but the problem is another. I have an AppCompatActivity in which I load a PreferenceFragmentCompat, so that the theme of the settings will be material design.
In this scenario, I cannot use a normal Preference.
I am also using the support library activities, but I'm successfully using an ordinary PreferenceFragment and ordinary Preference and it is Material-styled and working fine. Maybe you're trying to use getSupportFragmentManager() instead of getFragmentManager() in your activity.
Thanks Martin, I will try your suggestion to see if it's working.
In my case, it was easier porting this library for the Support Library PreferenceFragmentCompat than trying to switch my existing preferences screen to the ordinary PreferencesFragment. The change is not as trivial as just switching out imports, but not too hard either. Created a PR for it: #35
PreferenceFragment is deprecated: https://developer.android.com/reference/android/preference/PreferenceFragment
Also when using a MaterialComponents theme to use MaterialComponents from support library 28 you will run into problems with PreferenceFragment (perhaps the reason why they deprecated it with SDK level 28)
would really love to see @kustra 's PR to be merged
As @ligi said, PreferenceFragment has been depreciated. I love this library, but unless it's ported to use the AndroidX preferences, it's unusable.
I'm planning to have a look at this soon.
I have now published version 3.0.0 to jcenter and this switches over completely to using the support library preferences. Please try this out and let me know how it goes. Source changes are currently on a feature branch, and 2.4.2 will remain the official version until you guys report that 3.0.0 is working as you expect.
Note that the support preferences require extra code in your app to show the color picker dialog. See the branch readme or demo app for detals.
Now merged to master.
Hello,
I am using com.android.support:preference-v7:23.4.0 to implement the preferences screen in my app. Even if I'll set the min SDK to 11, I'll get an error when trying to use your Color Picker: com.rarepebble.colorpicker.ColorPreference cannot be cast to android.support.v7.preference.Preference
Is there anything I can do to use it in my app?
Thanks!