Search in sources :

Example 1 with AppCompatListPreference

use of com.geecko.QuickLyric.view.AppCompatListPreference in project fdroidclient by f-droid.

the class PreferencesFragment method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    addPreferencesFromResource(R.xml.preferences);
    useTorCheckPref = (CheckBoxPreference) findPreference(Preferences.PREF_USE_TOR);
    enableProxyCheckPref = (CheckBoxPreference) findPreference(Preferences.PREF_ENABLE_PROXY);
    updateAutoDownloadPref = findPreference(Preferences.PREF_AUTO_DOWNLOAD_INSTALL_UPDATES);
    updatePrivilegedExtensionPref = findPreference(Preferences.PREF_UNINSTALL_PRIVILEGED_APP);
    AppCompatListPreference languagePref = (AppCompatListPreference) findPreference(Preferences.PREF_LANGUAGE);
    if (Build.VERSION.SDK_INT >= 24) {
        PreferenceCategory category = (PreferenceCategory) findPreference("pref_category_display");
        category.removePreference(languagePref);
    } else {
        Languages languages = Languages.get(getActivity());
        languagePref.setDefaultValue(Languages.USE_SYSTEM_DEFAULT);
        languagePref.setEntries(languages.getAllNames());
        languagePref.setEntryValues(languages.getSupportedLocales());
    }
}
Also used : PreferenceCategory(android.preference.PreferenceCategory) Languages(org.fdroid.fdroid.Languages) AppCompatListPreference(com.geecko.QuickLyric.view.AppCompatListPreference)

Aggregations

PreferenceCategory (android.preference.PreferenceCategory)1 AppCompatListPreference (com.geecko.QuickLyric.view.AppCompatListPreference)1 Languages (org.fdroid.fdroid.Languages)1