-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request for additional preference types #87
Comments
|
@DreaminginCodeZH |
Maybe a |
Isn't it the |
@Gericop No:
Simple Menu - Material Design Guidelines It's runtime effect is just as in the spec. I've seen the author using it in one of his apps. |
Well, the DatePickerPreference and TimePickerPreference are almost done, I had to port the entire framework version of the picker dialogs to show material themed pickers (I know about the separate datetimepicker project of AOSP, but that uses the first (=old) version of the material pickers, and had to solve some problems related to date and time formatting on older APIs (mainly 17 and under). It's only in a Github repo for the time being, but soon it's gonna be released to jCenter, too. |
The 3 new preference types are now available on jCenter. compile 'com.takisoft.fix:preference-v7-ringtone:26.0.2.0'
compile 'com.takisoft.fix:preference-v7-datetimepicker:26.0.2.0' |
@Gericop Is the |
@DreaminginCodeZH I'll look into it. I'm finishing the |
The funny thing is that |
Would it be possible to support any custom preference that extends from I have a need for a |
@opus1269 Yeah, it is currently undocumented, but you can add custom public class YourCustomPreference extends DialogPreference {
static {
PreferenceFragmentCompat.addDialogPreference(YourCustomPreference.class, YourCustomPreferenceDialogFragmentCompat.class);
}
// ...
} The lib's
|
Can you make the |
Is there any particular reason why you don't want to extend |
A use case of this is wrapping the LicensesDialog library, where the dialog is informative and dialog content is independent of parent preference attributes. |
I know that but why wouldn't you want a key for a preference? What's the use case? |
Please see edit on my last comment. |
I see. Well, it can be done for sure. I'll probably release a new version later today with this, the colliding attribute names fixed, and some other fixes. |
Updating now the README.md so it can be released. |
Released v26.1.0.3. |
Hi, I just checked out 26.1.0.3 and found that the second argument is still requiring a |
That wouldn't make sense semantically since a
This will add the P.S.: There's a |
I think API design should not prevent developer from accomplish certain task even if it introduces likelyhood of error - error-prone developers won't try to understand why the limitation is there and will work around it in some other ugly way, while people with true need of an API will be forced to hack. Intead, this should be the work of documentation. As for semantics - My Or at least, please consider adding a P.S: I think the stock ringtone picker is more reliable and may present user additions or modifications from the ROM, so I wrote the implementation based on Activity. |
You can do what I suggested in the 3-steps thingy. It's essentially the same what you want but prevents people from accidentally adding any kind of I chose not to use the ringtone picker |
Using a headless And just to stay consistent with support library, it didn't put restriction on the developer to extend So can you be so kind to at least add a deprecated overload, so that a stupid artifact just adding one method call won't ever be needed on maven? It can be like this: /**
* @deprecated Most users should add a {@link DialogPreference} with a
* {@link PreferenceDialogFragmentCompat}. If you are using this overload, make sure you remove
* your fragment once work is done.
*/
public static void addDialogPreference(Class<? extends Preference> preferenceClass,
Class<? extends Fragment> fragmentClass) {
... I acknowledge that the custom ringtone picker approach has its advantages, but its disadvantages concerns me and I'd like to have the freedom for an alternative. |
Technically yes, there's no restriction on I know headless fragments and I wouldn't call this a headless but a dangling one because it just does not belong anywhere. It's basically used for hacking the system and starting an As I said, I'm not changing this right now because I feel like this is a bad approach (beside the fact that this is clearly meant to be for internal use only, at least for the time being) and will investigate what better options would be available. Be patient... |
Here's a possible approach:
This removes the burden from the dev having to create a separate fragment and ensures that no dangling fragments are left behind upon returning from the target |
It's not a hack but a representation of a dialog that is displayed by an external activity. The second proposed approach is also what I have considered before, and I think it burdens developers by taking away one specific request code from them and forcing them to write the callback logic in every preference fragment they use the preference. So I took the On the contrary, using a fragment to represent the existence of a dialog activity and track its state is semantically correct, and leverages support library's implementation of Neither |
The second approach does not take anything away. Since the preference receives a This lib is technically not restricting anything. Yes, it (still an internal use only method, for the time being) requires a If you still insist, sure, I can make it happen to add a |
Yes, I agree the approach you proposed is totally viable and do has its advantages, but still I prefer a more flexible So maybe can you just make it happen? (Accepting |
@DreaminginCodeZH |
Thanks! |
Sorry to bother again, but can you call And since I'm bothering again, the naming of |
Yeah, I think |
New preference types are added occasionally to a separate artifact:
compile 'com.takisoft.fix:preference-v7-extras:26.1.0.0'
Current and planned extra preference types:
RingtonePreference
(available since26.0.2.0
)DatePickerPreference
(available since26.0.2.0
)TimePickerPreference
(available since26.0.2.0
)ColorPickerPreference
(available since26.1.0.0
)SimpleMenuPreference
(available since27.0.2.0
)AutoCompleteEditTextPreference
If you have any requests about new preference types, add them here
The text was updated successfully, but these errors were encountered: