开发者

Android Preference with long summary (explanation)

开发者 https://www.devze.com 2023-04-12 00:41 出处:网络
I have a preference that represents some complex notion. I\'d like to exp开发者_如何学Golain it, and the explanation is a bit long.

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.

Android Preference with long summary (explanation)

Underneath the label, show the status text of the switch as "On" or "Off.”

Android Preference with long summary (explanation)

Add the switch itself and a longer description to a second screen.

For an example of this, go to Settings -> Accessibility -> Magnification Gestures.

0

精彩评论

暂无评论...
验证码 换一张
取 消