本文整理汇总了Java中android.preference.CheckBoxPreference.setSummaryOff方法的典型用法代码示例。如果您正苦于以下问题:Java CheckBoxPreference.setSummaryOff方法的具体用法?Java CheckBoxPreference.setSummaryOff怎么用?Java CheckBoxPreference.setSummaryOff使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.preference.CheckBoxPreference
的用法示例。
在下文中一共展示了CheckBoxPreference.setSummaryOff方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addCheckBox
import android.preference.CheckBoxPreference; //导入方法依赖的package包/类
private CheckBoxPreference addCheckBox(String title, PreferenceCategory category, String key, Drawable icon, String onText, String offText, boolean defaultValue, Context context) {
CheckBoxPreference c = new CheckBoxPreference(context);
c.setTitle(title);
c.setKey(key);
if (null != icon) c.setIcon(icon);
if (offText.equals(null) || onText.equals(null)) {
if (offText.equals(null)) {
c.setSummary(onText);
} else if (onText.equals(null)) {
c.setSummary(offText);
}
} else {
c.setSummaryOn(onText);
c.setSummaryOff(offText);
}
c.setDefaultValue(defaultValue);
c.setChecked(KRFAM.sharedPreferences.getBoolean(key, defaultValue));
category.addPreference(c);
return c;
}
示例2: update_nfc_expiry_preferences
import android.preference.CheckBoxPreference; //导入方法依赖的package包/类
private void update_nfc_expiry_preferences(Boolean show_age) {
try {
;
final PreferenceScreen nfcScreen = (PreferenceScreen) findPreference("xdrip_plus_nfc_settings");
final String nfc_expiry_days_string = AllPrefsFragment.this.prefs.getString("nfc_expiry_days", "14.5");
final CheckBoxPreference nfc_show_age = (CheckBoxPreference) findPreference("nfc_show_age");
nfc_show_age.setSummaryOff("Show the sensor expiry time based on " + nfc_expiry_days_string + " days");
if (show_age == null) show_age = nfc_show_age.isChecked();
if (show_age) {
nfcScreen.removePreference(nfc_expiry_days);
} else {
nfc_expiry_days.setOrder(3);
nfcScreen.addPreference(nfc_expiry_days);
}
} catch (NullPointerException e) {
//
}
}
示例3: createPreferenceScreen
import android.preference.CheckBoxPreference; //导入方法依赖的package包/类
private PreferenceScreen createPreferenceScreen() {
// Root
PreferenceScreen root = getPreferenceManager().createPreferenceScreen(this);
// Units preference
CheckBoxPreference isMetric = new CheckBoxPreference(this);
isMetric.setDefaultValue(PreferenceStore.isMetricLocale());
isMetric.setKey(PreferenceStore.PREFS_METRIC);
isMetric.setTitle(R.string.metric_title);
isMetric.setSummaryOff(R.string.metric_use_english);
isMetric.setSummaryOn(R.string.metric_use_metric);
root.addPreference(isMetric);
// Multitouch preference, aka "pinch zoom"
if (InertiaScroller.isMultitouchAvailable()) {
CheckBoxPreference useMultitouch = new CheckBoxPreference(this);
useMultitouch.setDefaultValue(Boolean.TRUE);
useMultitouch.setKey(PreferenceStore.PREFS_MULTITOUCH);
useMultitouch.setTitle(R.string.multitouch_title);
useMultitouch.setSummaryOff(R.string.multitouch_disable_pinch);
useMultitouch.setSummaryOn(R.string.multitouch_enable_pinch);
root.addPreference(useMultitouch);
}
// Display distance to center of screen
CheckBoxPreference distanceDisplay = new CheckBoxPreference(this);
distanceDisplay.setDefaultValue(false);
distanceDisplay.setKey(PreferenceStore.PREFS_SHOW_DISTANCE);
distanceDisplay.setTitle(R.string.distance_title);
distanceDisplay.setSummaryOn(R.string.distance_show);
distanceDisplay.setSummaryOff(R.string.distance_hide);
root.addPreference(distanceDisplay);
CheckBoxPreference headingDisplay = new CheckBoxPreference(this);
headingDisplay.setDefaultValue(false);
headingDisplay.setKey(PreferenceStore.PREFS_SHOW_HEADING);
headingDisplay.setTitle(R.string.heading_title);
headingDisplay.setSummaryOn(R.string.heading_show);
headingDisplay.setSummaryOff(R.string.heading_hide);
root.addPreference(headingDisplay);
// Display safety reminder when map is changed preference
CheckBoxPreference safetyReminder = new CheckBoxPreference(this);
safetyReminder.setDefaultValue(true);
safetyReminder.setKey(PreferenceStore.PREFS_SHOW_REMINDER);
safetyReminder.setTitle(R.string.safety_reminder_title);
safetyReminder.setSummaryOn(R.string.safety_reminder_show);
safetyReminder.setSummaryOff(R.string.safety_reminder_hide);
root.addPreference(safetyReminder);
// Display language selection option
Preference language = createLanguagePreference();
root.addPreference(language);
// About dialog
Preference about = createAboutPreference();
if (about != null) {
root.addPreference(about);
}
// Maximum image size info
Preference imageSizeInfo = createImageSizeInfo();
if (imageSizeInfo != null) {
root.addPreference(imageSizeInfo);
}
return root;
}