本文整理匯總了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;
}