I have a preference that represents some complex notion. I'd like to exp开发者_如何学Golain it, and the explanation is a bit long. When I add the explanation to the summary of the preference it gets cut off. Is there a standard for Android having long summary/description/explanation? Thank you.
You could create your own preference widget: http://developer.android.com/reference/android/preference/Preference.html#attr_android:widgetLayout
I couldn't find any standard for long settings explanations.
My solution
I set the summary to be the value chosen by the preference and added a dialog with a long message to explain the chosen setting when it is chosen.
This kind of keeps the settings UI standard without the need to custom the standard preference layouts.
Material design says that you should make the preference open a separate screen that includes the description:
Settings that require longer explanations may add a description on a second screen.
Underneath the label, show the status text of the switch as "On" or "Off.”
Add the switch itself and a longer description to a second screen.
For an example of this, go to Settings -> Accessibility -> Magnification Gestures.
精彩评论