use of android.support.v7.preference.Preference in project android_packages_apps_crDroidSettings by crdroidandroid.
the class VolumeSteps method updateVolumeStepPrefs.
private void updateVolumeStepPrefs(Preference pref, int steps) {
if (pref == null || !(pref instanceof ListPreference)) {
return;
}
final ListPreference listPref = (ListPreference) pref;
listPref.setSummary(String.valueOf(steps));
listPref.setValue(String.valueOf(steps));
}
use of android.support.v7.preference.Preference in project materialistic by hidroh.
the class Preferences method sync.
private static void sync(PreferenceManager preferenceManager, String key) {
Preference pref = preferenceManager.findPreference(key);
if (pref instanceof ListPreference) {
ListPreference listPref = (ListPreference) pref;
pref.setSummary(listPref.getEntry());
}
}
use of android.support.v7.preference.Preference in project fresco by facebook.
the class SettingsFragment method onSharedPreferenceChanged.
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
Preference preference = findPreference(key);
switch(key) {
case Const.DATA_SOURCE_KEY:
updateDataSourceSummary(preference);
break;
case Const.RECYCLER_LAYOUT_KEY:
updateRecyclerLayoutSummary(preference);
break;
case Const.GRID_SPAN_COUNT_KEY:
updateGridRecyclerLayoutSummary();
break;
case Const.INFINITE_DATA_SOURCE_KEY:
updateInfiniteDataSourceSummary(preference);
break;
case Const.DISTINCT_DATA_SOURCE_KEY:
updateDistinctDataSourceSummary(preference);
break;
case Const.REUSE_OLD_CONTROLLER_KEY:
updateReuseOldControllerSummary(preference);
break;
case Const.ROUNDED_CORNERS_KEY:
updateRoundedCornersSummary(preference);
break;
case Const.ROUNDED_AS_CIRCLE_KEY:
updateRoundedAsCircleSummary(preference);
break;
case Const.USE_POSTPROCESSOR_KEY:
updateUsePostprocessorSummary(preference);
break;
case Const.POSTPROCESSOR_TYPE_KEY:
updateWhatPostprocessorSummary(preference);
break;
case Const.SCALE_TYPE_KEY:
updateWhatScaleTypeSummary(preference);
break;
case Const.AUTO_ROTATE_KEY:
updateAutoRotateSummary(preference);
break;
case Const.FORCED_ROTATION_ANGLE_KEY:
updateRotationAngleSummary(preference);
break;
case Const.DOWNSAMPLING_KEY:
updateDownsamplingSummary(preference);
getShowRestartMessageDialog().show(getChildFragmentManager(), null);
break;
case Const.WEBP_SUPPORT_KEY:
updateWebpSupportSummary(preference);
getShowRestartMessageDialog().show(getChildFragmentManager(), null);
break;
case Const.DECODING_THREAD_KEY:
updateNumberOfDecodingThreadSummary(preference);
getShowRestartMessageDialog().show(getChildFragmentManager(), null);
break;
case Const.INSTRUMENTATION_ENABLED_KEY:
updateInstrumentationSummary(preference);
break;
case Const.DECODE_CANCELLATION_KEY:
updateDecodeCancellationSummary(preference);
getShowRestartMessageDialog().show(getChildFragmentManager(), null);
break;
case Const.DRAWEE_OVERLAY_KEY:
updateDraweeOverlaySummary(preference);
getShowRestartMessageDialog().show(getChildFragmentManager(), null);
break;
case Const.BG_COLOR_KEY:
updateBgColorSummary(preference);
break;
case Const.OVERRIDE_SIZE_KEY:
updateOverrideSizeSummary(preference);
break;
case Const.FADE_DURATION_KEY:
updateFadeDurationSummary(preference);
break;
case Const.DRAW_BORDER_KEY:
updateDrawBorderSummary(preference);
break;
}
}
use of android.support.v7.preference.Preference in project fresco by facebook.
the class SettingsFragment method updateNumberOfDecodingThreadSummary.
private void updateNumberOfDecodingThreadSummary(final Preference preference) {
final ListPreference listPreference = (ListPreference) preference;
final int valueIndex = listPreference.findIndexOfValue(listPreference.getValue());
String summary = getResources().getStringArray(R.array.decoding_thread_summaries)[valueIndex];
if (valueIndex == 0) {
summary += Const.NUMBER_OF_PROCESSORS;
}
preference.setSummary(summary);
}
use of android.support.v7.preference.Preference in project fresco by facebook.
the class SettingsFragment method populateVersionAndDeviceDetails.
private void populateVersionAndDeviceDetails() {
final Preference preferenceAndroidVersion = findPreference(KEY_DETAILS_ANDROID_VERSION);
final String androidVersion = getString(R.string.preference_details_android_version_summary, String.valueOf(Build.VERSION.SDK_INT), Build.VERSION.RELEASE);
preferenceAndroidVersion.setSummary(androidVersion);
final Preference preferenceCpuArchitecture = findPreference(KEY_DETAILS_CPU_ARCHITECTURE);
final String cpuArch = System.getProperty("os.arch");
final String cpuDetails;
if (Build.VERSION.SDK_INT < 21) {
cpuDetails = getString(R.string.preference_details_cpu_architecture_summary_before_21, cpuArch, Build.CPU_ABI, Build.CPU_ABI2);
} else {
cpuDetails = getString(R.string.preference_details_cpu_architecture_summary_after_21, cpuArch, Arrays.toString(Build.SUPPORTED_ABIS));
}
preferenceCpuArchitecture.setSummary(cpuDetails);
final Preference preferenceDeviceName = findPreference(KEY_DETAILS_DEVICE_NAME);
final String deviceName = getString(R.string.preference_details_device_name_summary, Build.MANUFACTURER, Build.DEVICE);
preferenceDeviceName.setSummary(deviceName);
}
Aggregations