Search in sources :

Example 6 with PreferenceManager

use of android.support.v7.preference.PreferenceManager 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());
    }
}
Also used : ListPreference(android.support.v7.preference.ListPreference) Preference(android.support.v7.preference.Preference) ThemePreference(io.github.hidroh.materialistic.preference.ThemePreference) ListPreference(android.support.v7.preference.ListPreference)

Example 7 with PreferenceManager

use of android.support.v7.preference.PreferenceManager in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class PaymentSettings method onCreate.

@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    mPaymentBackend = new PaymentBackend(getActivity());
    setHasOptionsMenu(true);
    PreferenceManager manager = getPreferenceManager();
    PreferenceScreen screen = manager.createPreferenceScreen(getActivity());
    List<PaymentBackend.PaymentAppInfo> appInfos = mPaymentBackend.getPaymentAppInfos();
    if (appInfos != null && appInfos.size() > 0) {
        NfcPaymentPreference preference = new NfcPaymentPreference(getPrefContext(), mPaymentBackend);
        preference.setKey("payment");
        screen.addPreference(preference);
        NfcForegroundPreference foreground = new NfcForegroundPreference(getPrefContext(), mPaymentBackend);
        screen.addPreference(foreground);
    }
    setPreferenceScreen(screen);
}
Also used : PreferenceScreen(android.support.v7.preference.PreferenceScreen) PreferenceManager(android.support.v7.preference.PreferenceManager) PaymentAppInfo(com.android.settings.nfc.PaymentBackend.PaymentAppInfo)

Aggregations

PreferenceManager (android.support.v7.preference.PreferenceManager)5 PreferenceScreen (android.support.v7.preference.PreferenceScreen)4 Preference (android.support.v7.preference.Preference)3 BrowserDialog (acr.browser.lightning.dialog.BrowserDialog)1 Dialog (android.app.Dialog)1 DownloadManager (android.app.DownloadManager)1 ActivityNotFoundException (android.content.ActivityNotFoundException)1 Uri (android.net.Uri)1 AlertDialog (android.support.v7.app.AlertDialog)1 ListPreference (android.support.v7.preference.ListPreference)1 PreferenceGroup (android.support.v7.preference.PreferenceGroup)1 SpannableString (android.text.SpannableString)1 PaymentAppInfo (com.android.settings.nfc.PaymentBackend.PaymentAppInfo)1 OtrClient (com.waz.api.OtrClient)1 Self (com.waz.api.Self)1 Subscriber (com.waz.api.Subscriber)1 ThemePreference (io.github.hidroh.materialistic.preference.ThemePreference)1 File (java.io.File)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1