Search in sources :

Example 6 with PreferenceScreen

use of android.preference.PreferenceScreen in project Signal-Android by WhisperSystems.

the class AppProtectionPreferenceFragment method initializePlatformSpecificOptions.

private void initializePlatformSpecificOptions() {
    PreferenceScreen preferenceScreen = getPreferenceScreen();
    Preference screenSecurityPreference = findPreference(TextSecurePreferences.SCREEN_SECURITY_PREF);
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH && screenSecurityPreference != null) {
        preferenceScreen.removePreference(screenSecurityPreference);
    }
}
Also used : PreferenceScreen(android.preference.PreferenceScreen) CheckBoxPreference(android.preference.CheckBoxPreference) Preference(android.preference.Preference)

Example 7 with PreferenceScreen

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();
}
Also used : PreferenceScreen(android.preference.PreferenceScreen)

Example 8 with PreferenceScreen

use of android.preference.PreferenceScreen in project nmid-headline by miao1007.

the class SupportPreferenceFragment method addPreferencesFromIntent.

public void addPreferencesFromIntent(Intent intent) {
    requirePreferenceManager();
    try {
        Method m = PreferenceManager.class.getDeclaredMethod("inflateFromIntent", Intent.class, PreferenceScreen.class);
        m.setAccessible(true);
        PreferenceScreen screen = (PreferenceScreen) m.invoke(mPreferenceManager, intent, getPreferenceScreen());
        setPreferenceScreen(screen);
    } catch (Exception ignored) {
    }
}
Also used : PreferenceScreen(android.preference.PreferenceScreen) Method(java.lang.reflect.Method)

Example 9 with PreferenceScreen

use of android.preference.PreferenceScreen in project nmid-headline by miao1007.

the class SupportPreferenceFragment method addPreferencesFromResource.

public void addPreferencesFromResource(int resId) {
    requirePreferenceManager();
    try {
        Method m = PreferenceManager.class.getDeclaredMethod("inflateFromResource", Context.class, int.class, PreferenceScreen.class);
        m.setAccessible(true);
        PreferenceScreen screen = (PreferenceScreen) m.invoke(mPreferenceManager, getActivity(), resId, getPreferenceScreen());
        setPreferenceScreen(screen);
    } catch (Exception ignored) {
    }
}
Also used : PreferenceScreen(android.preference.PreferenceScreen) Method(java.lang.reflect.Method)

Example 10 with PreferenceScreen

use of android.preference.PreferenceScreen in project nmid-headline by miao1007.

the class SupportPreferenceFragment method onSaveInstanceState.

public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    PreferenceScreen preferenceScreen = getPreferenceScreen();
    if (preferenceScreen != null) {
        Bundle container = new Bundle();
        preferenceScreen.saveHierarchyState(container);
        outState.putBundle(PREFERENCES_TAG, container);
    }
}
Also used : PreferenceScreen(android.preference.PreferenceScreen) Bundle(android.os.Bundle)

Aggregations

PreferenceScreen (android.preference.PreferenceScreen)79 Preference (android.preference.Preference)35 ListPreference (android.preference.ListPreference)21 PreferenceCategory (android.preference.PreferenceCategory)17 CheckBoxPreference (android.preference.CheckBoxPreference)16 EditTextPreference (android.preference.EditTextPreference)14 Bundle (android.os.Bundle)13 Method (java.lang.reflect.Method)11 SharedPreferences (android.content.SharedPreferences)9 Intent (android.content.Intent)6 ArrayList (java.util.ArrayList)5 Dialog (android.app.Dialog)4 Context (android.content.Context)4 Activity (android.app.Activity)3 MultiSelectListPreference (android.preference.MultiSelectListPreference)3 OnPreferenceClickListener (android.preference.Preference.OnPreferenceClickListener)3 PreferenceManager (android.preference.PreferenceManager)3 TwoStatePreference (android.preference.TwoStatePreference)3 View (android.view.View)3 TargetApi (android.annotation.TargetApi)2