当前位置: 首页>>代码示例>>Java>>正文


Java PreferenceGroup.removeAll方法代码示例

本文整理汇总了Java中android.preference.PreferenceGroup.removeAll方法的典型用法代码示例。如果您正苦于以下问题:Java PreferenceGroup.removeAll方法的具体用法?Java PreferenceGroup.removeAll怎么用?Java PreferenceGroup.removeAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.preference.PreferenceGroup的用法示例。


在下文中一共展示了PreferenceGroup.removeAll方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: replaceAllCheckBoxPreferencesBySwitchPreferences

import android.preference.PreferenceGroup; //导入方法依赖的package包/类
private static void replaceAllCheckBoxPreferencesBySwitchPreferences(
        final PreferenceGroup group) {
    final ArrayList<Preference> preferences = new ArrayList<>();
    final int count = group.getPreferenceCount();
    for (int index = 0; index < count; index++) {
        preferences.add(group.getPreference(index));
    }
    group.removeAll();
    for (int index = 0; index < count; index++) {
        final Preference preference = preferences.get(index);
        if (preference instanceof CheckBoxPreference) {
            addSwitchPreferenceBasedOnCheckBoxPreference((CheckBoxPreference)preference, group);
        } else {
            group.addPreference(preference);
            if (preference instanceof PreferenceGroup) {
                replaceAllCheckBoxPreferencesBySwitchPreferences((PreferenceGroup)preference);
            }
        }
    }
}
 
开发者ID:rkkr,项目名称:simple-keyboard,代码行数:21,代码来源:TwoStatePreferenceHelper.java

示例2: rebuildProfileList

import android.preference.PreferenceGroup; //导入方法依赖的package包/类
private void rebuildProfileList() {
    // Add an edit preference for each current Chrome profile.
    PreferenceGroup profileCategory = (PreferenceGroup) findPreference(PREF_AUTOFILL_PROFILES);
    profileCategory.removeAll();
    for (AutofillProfile profile : PersonalDataManager.getInstance().getProfilesForSettings()) {
        // Add an item on the current page...
        Preference pref = new Preference(getActivity());
        pref.setTitle(profile.getFullName());
        pref.setSummary(profile.getLabel());

        if (profile.getIsLocal()) {
            pref.setFragment(AutofillProfileEditor.class.getName());
        } else {
            pref.setWidgetLayoutResource(R.layout.autofill_server_data_label);
            pref.setFragment(AutofillServerProfilePreferences.class.getName());
        }

        Bundle args = pref.getExtras();
        args.putString(AUTOFILL_GUID, profile.getGUID());
        profileCategory.addPreference(pref);
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:23,代码来源:AutofillPreferences.java

示例3: rebuildCreditCardList

import android.preference.PreferenceGroup; //导入方法依赖的package包/类
private void rebuildCreditCardList() {
    PreferenceGroup profileCategory =
            (PreferenceGroup) findPreference(PREF_AUTOFILL_CREDIT_CARDS);
    profileCategory.removeAll();
    for (CreditCard card : PersonalDataManager.getInstance().getCreditCardsForSettings()) {
        // Add an item on the current page...
        Preference pref = new Preference(getActivity());
        pref.setTitle(card.getObfuscatedNumber());
        pref.setSummary(card.getFormattedExpirationDate(getActivity()));

        if (card.getIsLocal()) {
            pref.setFragment(AutofillLocalCardEditor.class.getName());
        } else {
            pref.setFragment(AutofillServerCardEditor.class.getName());
            pref.setWidgetLayoutResource(R.layout.autofill_server_data_label);
        }

        Bundle args = pref.getExtras();
        args.putString(AUTOFILL_GUID, card.getGUID());
        profileCategory.addPreference(pref);
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:23,代码来源:AutofillPreferences.java

示例4: createUserDictSettings

import android.preference.PreferenceGroup; //导入方法依赖的package包/类
/**
 * Creates the entries that allow the user to go into the user dictionary for each locale.
 * @param userDictGroup The group to put the settings in.
 */
protected void createUserDictSettings(final PreferenceGroup userDictGroup) {
    final Activity activity = getActivity();
    userDictGroup.removeAll();
    final TreeSet<String> localeSet =
            UserDictionaryList.getUserDictionaryLocalesSet(activity);

    if (localeSet.size() > 1) {
        // Have an "All languages" entry in the languages list if there are two or more active
        // languages
        localeSet.add("");
    }

    if (localeSet.isEmpty()) {
        userDictGroup.addPreference(createUserDictionaryPreference(null));
    } else {
        for (String locale : localeSet) {
            userDictGroup.addPreference(createUserDictionaryPreference(locale));
        }
    }
}
 
开发者ID:sergeychilingaryan,项目名称:AOSP-Kayboard-7.1.2,代码行数:25,代码来源:UserDictionaryList.java

示例5: rebuildProfileList

import android.preference.PreferenceGroup; //导入方法依赖的package包/类
private void rebuildProfileList() {
    // Add an edit preference for each current Chrome profile.
    PreferenceGroup profileCategory = (PreferenceGroup) findPreference(PREF_AUTOFILL_PROFILES);
    profileCategory.removeAll();
    for (AutofillProfile profile : PersonalDataManager.getInstance().getProfiles()) {
        // Add an item on the current page...
        Preference pref = new Preference(getActivity());
        pref.setTitle(profile.getFullName());
        pref.setSummary(profile.getLabel());

        if (profile.getIsLocal()) {
            pref.setFragment(AutofillProfileEditor.class.getName());
        } else {
            pref.setWidgetLayoutResource(R.layout.autofill_server_data_label);
            pref.setFragment(AutofillServerProfilePreferences.class.getName());
        }

        Bundle args = pref.getExtras();
        args.putString(AUTOFILL_GUID, profile.getGUID());
        profileCategory.addPreference(pref);
    }
}
 
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:23,代码来源:AutofillPreferences.java

示例6: rebuildCreditCardList

import android.preference.PreferenceGroup; //导入方法依赖的package包/类
private void rebuildCreditCardList() {
    PreferenceGroup profileCategory =
            (PreferenceGroup) findPreference(PREF_AUTOFILL_CREDIT_CARDS);
    profileCategory.removeAll();
    for (CreditCard card : PersonalDataManager.getInstance().getCreditCards()) {
        // Add an item on the current page...
        Preference pref = new Preference(getActivity());
        pref.setTitle(card.getObfuscatedNumber());
        pref.setSummary(card.getFormattedExpirationDate(getActivity()));

        if (card.getIsLocal()) {
            pref.setFragment(AutofillCreditCardEditor.class.getName());
        } else {
            pref.setWidgetLayoutResource(R.layout.autofill_server_data_label);
            pref.setFragment(AutofillServerCardPreferences.class.getName());
        }

        Bundle args = pref.getExtras();
        args.putString(AUTOFILL_GUID, card.getGUID());
        profileCategory.addPreference(pref);
    }
}
 
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:23,代码来源:AutofillPreferences.java

示例7: setPrefSubtypes

import android.preference.PreferenceGroup; //导入方法依赖的package包/类
private void setPrefSubtypes(final String prefSubtypes, final Context context) {
    final PreferenceGroup group = getPreferenceScreen();
    group.removeAll();
    final InputMethodSubtype[] subtypesArray =
            AdditionalSubtypeUtils.createAdditionalSubtypesArray(prefSubtypes);
    for (final InputMethodSubtype subtype : subtypesArray) {
        final CustomInputStylePreference pref =
                new CustomInputStylePreference(context, subtype, this);
        group.addPreference(pref);
    }
}
 
开发者ID:rkkr,项目名称:simple-keyboard,代码行数:12,代码来源:CustomInputStyleSettingsFragment.java


注:本文中的android.preference.PreferenceGroup.removeAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。