use of android.preference.PreferenceScreen in project Conversations by siacs.
the class SettingsFragment method openPreferenceScreen.
private void openPreferenceScreen(final String screenName) {
final Preference pref = findPreference(screenName);
if (pref instanceof PreferenceScreen) {
final PreferenceScreen preferenceScreen = (PreferenceScreen) pref;
getActivity().setTitle(preferenceScreen.getTitle());
preferenceScreen.setDependency("");
setPreferenceScreen((PreferenceScreen) pref);
}
}
use of android.preference.PreferenceScreen in project zxing-lib by kennydude.
the class PreferencesActivity method onCreate.
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
PreferenceScreen preferences = getPreferenceScreen();
preferences.getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
decode1D = (CheckBoxPreference) preferences.findPreference(KEY_DECODE_1D);
decodeQR = (CheckBoxPreference) preferences.findPreference(KEY_DECODE_QR);
decodeDataMatrix = (CheckBoxPreference) preferences.findPreference(KEY_DECODE_DATA_MATRIX);
disableLastCheckedPref();
}
use of android.preference.PreferenceScreen in project xabber-android by redsolution.
the class BaseSettingsFragment method setPreferences.
/**
* Set values to the UI elements.
*
* @param source
*/
protected void setPreferences(Map<String, Object> source) {
PreferenceScreen preferenceScreen = getPreferenceScreen();
for (int index = 0; index < preferenceScreen.getPreferenceCount(); index++) {
Preference preference = preferenceScreen.getPreference(index);
Object value = source.get(preference.getKey());
setPreference(preference, value);
}
}
use of android.preference.PreferenceScreen in project xabber-android by redsolution.
the class DebugSettingsFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preference_debug);
PreferenceScreen preferenceScreen = getPreferenceScreen();
preferenceScreen.removePreference(preferenceScreen.findPreference(getString(R.string.debug_log_key)));
preferenceScreen.removePreference(preferenceScreen.findPreference(getString(R.string.cache_clear_key)));
preferenceScreen.removePreference(preferenceScreen.findPreference(getString(R.string.debug_connection_errors_key)));
Preference prefDownloadArchive = preferenceScreen.findPreference(getString(R.string.debug_download_all_messages_key));
prefDownloadArchive.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
startMessageArchiveDownload();
return true;
}
});
Preference prefFetchCrowdfundingFeed = preferenceScreen.findPreference(getString(R.string.debug_fetch_crowdfunding_feed_key));
if (prefFetchCrowdfundingFeed != null) {
prefFetchCrowdfundingFeed.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
CrowdfundingManager.getInstance().fetchFeedForDebug();
Toast.makeText(getActivity(), "Crowdfunding feed updated", Toast.LENGTH_SHORT).show();
return true;
}
});
}
if (!BuildConfig.DEBUG) {
preferenceScreen.removePreference(prefDownloadArchive);
}
if (!SettingsManager.isCrashReportsSupported()) {
preferenceScreen.removePreference(preferenceScreen.findPreference(getString(R.string.debug_crash_reports_key)));
}
PreferenceSummaryHelperActivity.updateSummary(preferenceScreen);
}
use of android.preference.PreferenceScreen in project xabber-android by redsolution.
the class PresenceSettingsFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preference_presence);
PreferenceScreen preferenceScreen = getPreferenceScreen();
PreferenceSummaryHelperActivity.updateSummary(preferenceScreen);
}
Aggregations