void update_record_capture_screen(boolean isenabled){ record_capture_screen.setSummary(isenabled?"Screen Capture":"Camera Capture"); }
void update_record_audio_enable(boolean isenabled){ record_audio_enable.setSummary(isenabled?"audio ON":"audio OFF"); record_audioBitrate.setEnabled(isenabled); //record_audioChannels.setEnabled(isenabled); //record_audioSampling.setEnabled(isenabled); }
@Override public void setSummary(CharSequence summary) { super.setSummary(RefString.resolve(getContext(), summary)); }
String cameraSummary = getString(mDPM.getCameraDisabled(mDeviceAdminSample) ? R.string.camera_disabled : R.string.camera_enabled); mDisableCameraCheckbox.setSummary(cameraSummary); (disabled & DevicePolicyManager.KEYGUARD_DISABLE_WIDGETS_ALL) != 0 ? R.string.keyguard_widgets_disabled : R.string.keyguard_widgets_enabled); mDisableKeyguardWidgetsCheckbox.setSummary(keyguardWidgetSummary); mDisableKeyguardSecureCameraCheckbox.setSummary(keyguardSecureCameraSummary); R.string.keyguard_secure_notifications_disabled : R.string.keyguard_secure_notifications_enabled); mDisableKeyguardNotificationCheckbox.setSummary(keyguardSecureNotificationsSummary); ? R.string.keyguard_unredacted_notifications_disabled : R.string.keyguard_unredacted_notifications_enabled); mDisableKeyguardUnredactedCheckbox.setSummary(keyguardUnredactedSummary); R.string.keyguard_trust_agents_disabled : R.string.keyguard_trust_agents_enabled); mDisableKeyguardTrustAgentCheckbox.setSummary(keyguardEnableTrustAgentSummary);
private void updateDebugMode() { if (mDebugMode == null) { return; } boolean isDebugMode = mDebugMode.isChecked(); String version = ""; try { PackageInfo info = getPackageManager().getPackageInfo(getPackageName(), 0); version = "Version " + info.versionName; } catch (NameNotFoundException e) { Log.e(TAG, "Could not find version info."); } if (!isDebugMode) { mDebugMode.setTitle(version); mDebugMode.setSummary(""); } else { mDebugMode.setTitle(getResources().getString(R.string.prefs_debug_mode)); mDebugMode.setSummary(version); } } }
private void createAOCPreference() { also_on_complete = new CheckBoxPreference(OptionsActivity.this); category.addPreference(also_on_complete); also_on_complete .setTitle(R.string.advanced_options_also_on_complete_title); also_on_complete .setSummary(R.string.advanced_options_also_on_complete_summary); }
private void populatePreferenceScreen(Set<String> activeCalendars) { Cursor cursor = createLoadedCursor(); if (cursor == null) { return; } for (int i = 0; i < cursor.getCount(); i++) { cursor.moveToPosition(i); CheckBoxPreference checkboxPref = new CheckBoxPreference(getActivity()); checkboxPref.setTitle(cursor.getString(1)); checkboxPref.setSummary(cursor.getString(3)); checkboxPref.setIcon(createDrawable(cursor.getInt(2))); int calendarId = cursor.getInt(0); checkboxPref.getExtras().putInt(CALENDAR_ID, calendarId); checkboxPref.setChecked(activeCalendars.isEmpty() || activeCalendars.contains(String.valueOf(calendarId))); getPreferenceScreen().addPreference(checkboxPref); } }
private void showLockTimeZone(boolean setAlso) { CheckBoxPreference preference = (CheckBoxPreference) findPreference(ApplicationPreferences.PREF_LOCK_TIME_ZONE); if (preference != null) { boolean isChecked = setAlso ? ApplicationPreferences.isTimeZoneLocked(getActivity()) : preference.isChecked(); if (setAlso && preference.isChecked() != isChecked) { preference.setChecked(isChecked); } DateTimeZone timeZone = DateTimeZone.forID(DateUtil.validatedTimeZoneId(isChecked ? ApplicationPreferences.getLockedTimeZoneId(getActivity()) : TimeZone.getDefault().getID())); preference.setSummary(String.format( getText(isChecked ? R.string.lock_time_zone_on_desc : R.string.lock_time_zone_off_desc).toString(), timeZone.getName(DateUtil.now(timeZone).getMillis())) ); } }
String cameraSummary = getString(mDPM.getCameraDisabled(mDeviceAdminSample) ? R.string.camera_disabled : R.string.camera_enabled); mDisableCameraCheckbox.setSummary(cameraSummary); (disabled & DevicePolicyManager.KEYGUARD_DISABLE_WIDGETS_ALL) != 0 ? R.string.keyguard_widgets_disabled : R.string.keyguard_widgets_enabled); mDisableKeyguardWidgetsCheckbox.setSummary(keyguardWidgetSummary); mDisableKeyguardSecureCameraCheckbox.setSummary(keyguardSecureCameraSummary); R.string.keyguard_secure_notifications_disabled : R.string.keyguard_secure_notifications_enabled); mDisableKeyguardNotificationCheckbox.setSummary(keyguardSecureNotificationsSummary); ? R.string.keyguard_unredacted_notifications_disabled : R.string.keyguard_unredacted_notifications_enabled); mDisableKeyguardUnredactedCheckbox.setSummary(keyguardUnredactedSummary); R.string.keyguard_trust_agents_disabled : R.string.keyguard_trust_agents_enabled); mDisableKeyguardTrustAgentCheckbox.setSummary(keyguardEnableTrustAgentSummary);
@Override protected void onCreate(Bundle icicle) { // Get the settings preferences SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this); Design.updateTheme(this, sp); super.onCreate(icicle); addPreferencesFromResource(R.xml.language_prefs); mSelectedLanguages = sp.getString(KP2AKeyboard.PREF_SELECTED_LANGUAGES, ""); String[] languageList = mSelectedLanguages.split(","); //first try to get the unique locales in a strict mode (filtering most redundant layouts like English (Jamaica) etc.) mAvailableLanguages = getUniqueLocales(true); //sometimes the strict check returns only EN_US, EN_GB and ES_US. Accept more in these cases: if (mAvailableLanguages.size() < 5) { mAvailableLanguages = getUniqueLocales(false); } PreferenceGroup parent = getPreferenceScreen(); for (int i = 0; i < mAvailableLanguages.size(); i++) { CheckBoxPreference pref = new CheckBoxPreference(this); Locale locale = mAvailableLanguages.get(i).locale; pref.setTitle(LanguageSwitcher.toTitleCase(locale.getDisplayName(locale), locale)); boolean checked = isLocaleIn(locale, languageList); pref.setChecked(checked); if (hasDictionary(locale, this)) { pref.setSummary(R.string.has_dictionary); } parent.addPreference(pref); } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.apple_music_options); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); } notificationListeningCbp = (CheckBoxPreference) findPreference("apple_notification_listening"); repeatsCbp = (CheckBoxPreference) findPreference("apple_enable_repeat"); if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.LOLLIPOP_MR1) { notificationListeningCbp.setEnabled(false); notificationListeningCbp.setSummary("Unfortunately your current version of android does not support this feature"); } settings = new AppSettings(this); }
String eitherKey = "either"; String orKey = "or"; CheckBoxPreference either = new CheckBoxPreference(this); either.setKey(eitherKey); either.setTitle("Either"); either.setSummary("It is either one or"); either.setDefaultValue(false); either.setDisableDependentsState(true); inlinePrefCat.addPreference(either); try { //Crossfade Time CheckBoxPreference or = new CheckBoxPreference(this); or.setKey(orKey); or.setTitle("Or"); or.setSummary("the other"); inlinePrefCat.addPreference(or); or.setDependency(eitherKey); } catch (Exception e) { }
@Override protected void onResume() { super.onResume(); List<MountPoint> mountPoints = RootMountPoint.getRootedMountPoints(this); PreferenceScreen prefs = getPreferenceScreen(); prefs.removeAll(); SharedPreferences shprefs = getSharedPreferences("ignore_list", Context.MODE_PRIVATE); Map<String, ?> ignoreList = shprefs.getAll(); Set<String> ignores = ignoreList.keySet(); for (MountPoint mountPoint: mountPoints) { CheckBoxPreference pref = new CheckBoxPreference(this); FileSystemEntry.setupStrings(this); FileSystemStats stats = new FileSystemStats(mountPoint); pref.setSummary(stats.formatUsageInfo()); pref.setTitle(mountPoint.getRoot()); pref.setChecked(!ignores.contains(mountPoint.getRoot())); prefs.addPreference(pref); } }
/** * Update the summaries of each item to show the local setting and the global setting. */ @Override protected void reloadSummaries() { super.reloadSummaries(); boolean local, global; local = mDPM.getStorageEncryption(mDeviceAdminSample); global = mDPM.getStorageEncryption(null); mRequireEncryption.setSummary(localGlobalSummary(local, global)); int deviceStatusCode = mDPM.getStorageEncryptionStatus(); String deviceStatus = statusCodeToString(deviceStatusCode); String status = mActivity.getString(R.string.status_device_encryption, deviceStatus); mActivateEncryption.setSummary(status); }
/** * Update the summaries of each item to show the local setting and the global setting. */ @Override protected void reloadSummaries() { super.reloadSummaries(); boolean local, global; local = mDPM.getStorageEncryption(mDeviceAdminSample); global = mDPM.getStorageEncryption(null); mRequireEncryption.setSummary(localGlobalSummary(local, global)); int deviceStatusCode = mDPM.getStorageEncryptionStatus(); String deviceStatus = statusCodeToString(deviceStatusCode); String status = mActivity.getString(R.string.status_device_encryption, deviceStatus); mActivateEncryption.setSummary(status); }
checkboxPref.setKey("checkbox_preference"); checkboxPref.setTitle(R.string.title_checkbox_preference); checkboxPref.setSummary(R.string.summary_checkbox_preference); inlinePrefCat.addPreference(checkboxPref); nextScreenCheckBoxPref.setKey("next_screen_toggle_preference"); nextScreenCheckBoxPref.setTitle(R.string.title_next_screen_toggle_preference); nextScreenCheckBoxPref.setSummary(R.string.summary_next_screen_toggle_preference); screenPref.addPreference(nextScreenCheckBoxPref); parentCheckBoxPref.setSummary(R.string.summary_parent_preference); prefAttrsCat.addPreference(parentCheckBoxPref); parentCheckBoxPref.setKey(PARENT_CHECKBOX_PREFERENCE); CheckBoxPreference childCheckBoxPref = new CheckBoxPreference(this); childCheckBoxPref.setTitle(R.string.title_child_preference); childCheckBoxPref.setSummary(R.string.summary_child_preference); childCheckBoxPref.setLayoutResource( a.getResourceId(R.styleable.TogglePrefAttrs_android_preferenceLayoutChild,
checkboxPref.setKey("checkbox_preference"); checkboxPref.setTitle(R.string.title_checkbox_preference); checkboxPref.setSummary(R.string.summary_checkbox_preference); inlinePrefCat.addPreference(checkboxPref); nextScreenCheckBoxPref.setKey("next_screen_toggle_preference"); nextScreenCheckBoxPref.setTitle(R.string.title_next_screen_toggle_preference); nextScreenCheckBoxPref.setSummary(R.string.summary_next_screen_toggle_preference); screenPref.addPreference(nextScreenCheckBoxPref); parentCheckBoxPref.setSummary(R.string.summary_parent_preference); prefAttrsCat.addPreference(parentCheckBoxPref); parentCheckBoxPref.setKey(PARENT_CHECKBOX_PREFERENCE); CheckBoxPreference childCheckBoxPref = new CheckBoxPreference(this); childCheckBoxPref.setTitle(R.string.title_child_preference); childCheckBoxPref.setSummary(R.string.summary_child_preference); childCheckBoxPref.setLayoutResource( a.getResourceId(R.styleable.TogglePrefAttrs_android_preferenceLayoutChild,
online_offlinePrefernce.setSummary("Maps are ONLINE"); }else{ online_offlinePrefernce.setSummary("Maps are OFFLINE");
isCollectData.setSummary(R.string.collect_gps_data_desc); root.addPreference(isCollectData); isCollectData.setOnPreferenceClickListener(this); allowErrorReporting.setSummary(R.string.allow_error_reporting_summary); allowErrorReporting.setChecked(GTG.isAcraEnabled(this)); root.addPreference(allowErrorReporting); writeGpsWakeLockDebugFile.setSummary( String.format(getString(R.string.write_to_gps_wake_lock_log_summary), getString(R.string.gps_wake_lock_filename)));
estimate.setKey(settings.getEstimationEnabledKey()); estimate.setTitle(R.string.label_estimate_measurement); estimate.setSummary(R.string.label_estimate_measurement_summary); estimate.setPersistent(true); estimate.setDefaultValue(settings.isEstimationEnabled());