Java 类android.support.v7.preference.PreferenceGroup 实例源码

项目:markor    文件:GsPreferenceFragmentCompat.java   
protected PreferenceGroup getPreferenceParent(PreferenceGroup prefGroup, Preference pref) {
    for (int i = 0; i < prefGroup.getPreferenceCount(); ++i) {
        Preference prefChild = prefGroup.getPreference(i);
        if (prefChild == pref) {
            return prefGroup;
        }
        if (prefChild instanceof PreferenceGroup) {
            PreferenceGroup childGroup = (PreferenceGroup) prefChild;
            PreferenceGroup result = getPreferenceParent(childGroup, pref);
            if (result != null) {
                return result;
            }
        }
    }
    return null;
}
项目:memetastic    文件:GsPreferenceFragmentCompat.java   
protected PreferenceGroup getPreferenceParent(PreferenceGroup prefGroup, Preference pref) {
    for (int i = 0; i < prefGroup.getPreferenceCount(); ++i) {
        Preference prefChild = prefGroup.getPreference(i);
        if (prefChild == pref) {
            return prefGroup;
        }
        if (prefChild instanceof PreferenceGroup) {
            PreferenceGroup childGroup = (PreferenceGroup) prefChild;
            PreferenceGroup result = getPreferenceParent(childGroup, pref);
            if (result != null) {
                return result;
            }
        }
    }
    return null;
}
项目:haystack    文件:DevelopmentSettings.java   
@DexAppend
@Override
public void onCreate(Bundle icicle) {
    try {
        PreferenceGroup pg = (PreferenceGroup) findPreference(
                FakeSignatureGlobalUI.DEBUG_APPLICATIONS_CATEGORY_KEY);
        if (pg != null) {
            TwoStatePreference p = createTwoStatePreference(pg.getContext());
            p.setKey(FakeSignatureGlobalUI.SETTING_SECURE_KEY);
            p.setTitle(FakeSignatureGlobalUI.SETTING_TITLE);
            p.setSummary(FakeSignatureGlobalUI.SETTING_SUMMARY);
            p.setPersistent(false);
            mResetTwoStatePrefsAdd(p);
            mAllPrefs.add(p);
            //pg.setOrderingAsAdded(true);
            pg.addPreference(p);
            mAllowFakeSignatureGlobal = p;
        } else {
            Log.e("DevelopmentSettings_FakeSignatureGlobalUI", "cannot find 'applications' preference category");
        }
    } catch (Throwable t) {
        Log.e("DevelopmentSettings_FakeSignatureGlobalUI", "onCreate exception", t);
    }
}
项目:android_maplibui    文件:NGWSettingsFragment.java   
protected void addEditAccountAction(
        final IGISApplication application,
        final Account account,
        PreferenceGroup actionCategory)
{
    Preference preferenceEdit = new Preference(mStyledContext);
    preferenceEdit.setTitle(R.string.edit_account);
    preferenceEdit.setSummary(R.string.edit_account_summary);

    String url = application.getAccountUrl(account);
    String login = application.getAccountLogin(account);

    Intent intent = new Intent(mStyledContext, NGWLoginActivity.class);
    intent.putExtra(NGWLoginActivity.FOR_NEW_ACCOUNT, false);
    intent.putExtra(NGWLoginActivity.ACCOUNT_URL_TEXT, url);
    intent.putExtra(NGWLoginActivity.ACCOUNT_LOGIN_TEXT, login);
    intent.putExtra(NGWLoginActivity.CHANGE_ACCOUNT_URL, false);
    intent.putExtra(NGWLoginActivity.CHANGE_ACCOUNT_LOGIN, true);
    preferenceEdit.setIntent(intent);

    actionCategory.addPreference(preferenceEdit);
}
项目:markor    文件:GsPreferenceFragmentCompat.java   
private void tintPrefIconsRecursive(PreferenceGroup prefGroup, @ColorInt int iconColor) {
    if (prefGroup != null) {
        int prefCount = prefGroup.getPreferenceCount();
        for (int i = 0; i < prefCount; i++) {
            Preference pref = prefGroup.getPreference(i);
            if (pref != null) {
                pref.setIcon(_cu.tintDrawable(pref.getIcon(), iconColor));
                if (pref instanceof PreferenceGroup) {
                    tintPrefIconsRecursive((PreferenceGroup) pref, iconColor);
                }
            }
        }
    }
}
项目:markor    文件:GsPreferenceFragmentCompat.java   
protected void removePreference(@Nullable Preference preference) {
    if (preference == null) {
        return;
    }
    PreferenceGroup parent = getPreferenceParent(getPreferenceScreen(), preference);
    if (parent == null) {
        return;
    }
    parent.removePreference(preference);
}
项目:android_nextgis_mobile    文件:NGIDSettingsFragment.java   
protected void fillPreferences(PreferenceGroup screen)
{
    if (mAction != null && mAction.equals(SettingsConstantsUI.ACTION_ACCOUNT)) {
        addPreferencesFromResource(R.xml.preferences_ngid);
        fillAccountPreferences(screen);
    }
}
项目:IslamicLibraryAndroid    文件:SettingsFragment.java   
private void removeAdvancePreference(Preference preference) {
    // these null checks are to fix a crash due to an NPE on 4.4.4
    if (preference != null) {
        PreferenceGroup group =
                (PreferenceGroup) findPreference("pref_general");
        if (group != null) {
            group.removePreference(preference);
        }
    }
}
项目:memetastic    文件:GsPreferenceFragmentCompat.java   
protected void removePreference(@Nullable Preference preference) {
    if (preference == null) {
        return;
    }
    PreferenceGroup parent = getPreferenceParent(getPreferenceScreen(), preference);
    if (parent == null) {
        return;
    }
    parent.removePreference(preference);
}
项目:insapp-android    文件:SettingsFragment.java   
private void initSummary(Preference preference) {
    if (preference instanceof PreferenceGroup) {
        PreferenceGroup preferenceGroup = (PreferenceGroup) preference;

        for (int i = 0; i < preferenceGroup.getPreferenceCount(); i++) {
            initSummary(preferenceGroup.getPreference(i));
        }
    }
    else {
        updatePreferenceSummary(preference);
    }
}
项目:RespawnIRC-Android    文件:SettingsFragment.java   
private void initPrefsInfos(Preference pref) {
    if (pref instanceof PreferenceGroup) {
        PreferenceGroup prefGroup = (PreferenceGroup) pref;
        final int currentPreferenceCount = prefGroup.getPreferenceCount();
        for (int i = 0; i < currentPreferenceCount; i++) {
            initPrefsInfos(prefGroup.getPreference(i));
        }
    } else {
        initClickedListenerIfNeeded(pref);
        initFilterIfNeeded(pref);
        updatePrefDefaultValue(pref);
        updatePrefSummary(pref);
    }
}
项目:android_nextgis_mobile    文件:NGIDSettingsFragment.java   
protected void fillPreferences(PreferenceGroup screen)
{
    if (mAction != null && mAction.equals(SettingsConstantsUI.ACTION_ACCOUNT)) {
        addPreferencesFromResource(R.xml.preferences_ngid);
        fillAccountPreferences(screen);
    }
}
项目:SorceryIconPack    文件:SettingsFragment.java   
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
    setPreferencesFromResource(R.xml.preference_settings, rootKey);
    mPreferenceScreen = (PreferenceScreen) findPreference("preference_screen");
    initGeneral();
    initUi();

    mDevPreferenceGroup = (PreferenceGroup) findPreference("preference_group_dev");
    if (!mPrefs.devOptionsOpened().getValue()) {
        mPreferenceScreen.removePreference(mDevPreferenceGroup);
    } else {
        initDevOps();
    }
    initAbout();
}
项目:Android-Support-Preference-V7-Fix    文件:PreferenceGroupAdapter.java   
public PreferenceGroupAdapter(PreferenceGroup preferenceGroup) {
    super(preferenceGroup);

    try {
        Field preferenceLayoutsField = android.support.v7.preference.PreferenceGroupAdapter.class.getDeclaredField("mPreferenceLayouts");
        preferenceLayoutsField.setAccessible(true);
        mPreferenceLayouts = (List) preferenceLayoutsField.get(this);

        getReflectionFields();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
项目:Android-Support-Preference-V7-Fix    文件:PreferenceFragmentCompat.java   
/**
 * Traverses a {@code PreferenceGroup} to notify all eligible preferences about the results
 * of a returning activity.
 *
 * @param group       The {@code PreferenceGroup} to traverse.
 * @param requestCode The integer request code originally supplied to startActivityForResult(), allowing you to identify who this result came from.
 * @param resultCode  The integer result code returned by the child activity through its setResult().
 * @param data        An Intent, which can return result data to the caller (various data can be attached to Intent "extras").
 */
protected void onActivityResult(PreferenceGroup group, int requestCode, int resultCode, Intent data) {
    final int n = group.getPreferenceCount();

    for (int i = 0; i < n; i++) {
        Preference pref = group.getPreference(i);
        if (pref instanceof PreferenceActivityResultListener) {
            ((PreferenceActivityResultListener) pref).onActivityResult(requestCode, resultCode, data);
        }

        if (pref instanceof PreferenceGroup) {
            onActivityResult((PreferenceGroup) pref, requestCode, resultCode, data);
        }
    }
}
项目:buseta    文件:SettingActivity.java   
private void initSummary(Preference p) {
    if (p instanceof PreferenceGroup) {
        PreferenceGroup pGrp = (PreferenceGroup) p;
        for (int i = 0; i < pGrp.getPreferenceCount(); i++) {
            initSummary(pGrp.getPreference(i));
        }
    } else {
        updatePrefSummary(p);
    }
}
项目:Android--Beacon-Scanner-Service    文件:SettingsFragment.java   
private void initSummary(Preference preference) {
    if (preference instanceof PreferenceGroup) {
        PreferenceGroup group = (PreferenceGroup) preference;
        for (int i = 0; i < group.getPreferenceCount(); i++) {
            initSummary(group.getPreference(i));
        }
    } else {
        updatePrefSummary(preference);
    }
}
项目:android_maplibui    文件:NGWSettingsFragment.java   
protected void fillPreferences(PreferenceGroup screen)
{
    if (mAction != null && mAction.equals(SettingsConstantsUI.ACTION_ACCOUNT)) {
        Account account = getArguments().getParcelable(NGWSettingsActivity.KEY_ACCOUNT);
        fillAccountPreferences(screen, account);
    }
}
项目:android_maplibui    文件:NGWSettingsFragment.java   
public void fillAccountPreferences(
            PreferenceGroup screen,
            final Account account)
    {
        final IGISApplication appContext = (IGISApplication) mStyledContext.getApplicationContext();

        // add sync settings group
        PreferenceCategory syncCategory = new PreferenceCategory(mStyledContext);
        syncCategory.setTitle(R.string.sync);
        screen.addPreference(syncCategory);

        // add auto sync property
        addAutoSyncProperty(appContext, account, syncCategory);

        // add time for periodic sync
        addPeriodicSyncTime(appContext, account, syncCategory);

        // add account layers
        addAccountLayers(screen, appContext, account);

        // add actions group
        PreferenceCategory actionCategory = new PreferenceCategory(mStyledContext);
        actionCategory.setTitle(R.string.actions);
        screen.addPreference(actionCategory);

        // add "Edit account" action
        addEditAccountAction(appContext, account, actionCategory);

        // add delete account action
        addDeleteAccountAction(appContext, account, actionCategory);

// TODO: for isMultiPane() change title of Settings fragment, not of Activity
//        if (mChangeTitle && !NGPreferenceActivity.isMultiPane(mActivity)) {
        if (mChangeTitle) {
            ActionBar ab = mActivity.getSupportActionBar();
            if (null != ab) {
                ab.setTitle(account.name);
            }
        }
    }
项目:android_maplibui    文件:NGWSettingsFragment.java   
protected void addAutoSyncProperty(
        final IGISApplication application,
        final Account account,
        PreferenceGroup syncCategory)
{
    final String accountNameHash = "_" + account.name.hashCode();
    SharedPreferences sharedPreferences =
            mStyledContext.getSharedPreferences(Constants.PREFERENCES,
                    Constants.MODE_MULTI_PROCESS);

    CheckBoxPreference enablePeriodicSync = new CheckBoxPreference(mStyledContext);
    enablePeriodicSync.setKey(KEY_SYNC);
    enablePeriodicSync.setPersistent(false);
    enablePeriodicSync.setTitle(R.string.auto_sync);

    boolean isAccountSyncEnabled = isAccountSyncEnabled(account, application.getAuthority());
    enablePeriodicSync.setChecked(isAccountSyncEnabled);
    enablePeriodicSync.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener()
    {
        @Override
        public boolean onPreferenceChange(
                Preference preference,
                Object newValue)
        {
            boolean isChecked = (boolean) newValue;
            setAccountSyncEnabled(account, application.getAuthority(), isChecked);
            return true;
        }
    });

    long timeStamp = sharedPreferences.getLong(
            com.nextgis.maplib.util.SettingsConstants.KEY_PREF_LAST_SYNC_TIMESTAMP
                    + accountNameHash, 0);
    if (isAccountSyncEnabled && timeStamp > 0) {
        enablePeriodicSync.setSummary(ControlHelper.getSyncTime(mStyledContext, timeStamp));
    } else {
        enablePeriodicSync.setSummary(R.string.auto_sync_summary);
    }
    syncCategory.addPreference(enablePeriodicSync);
}
项目:android_maplibui    文件:NGIDSettingsFragment.java   
protected void fillPreferences(PreferenceGroup screen)
{
    if (mAction != null && mAction.equals(SettingsConstantsUI.ACTION_ACCOUNT)) {
        addPreferencesFromResource(R.xml.preferences_ngid);
        fillAccountPreferences(screen);
    }
}
项目:android_packages_apps_GmsCore    文件:GcmFragment.java   
private static void addPreferencesSorted(List<Preference> prefs, PreferenceGroup container) {
    // If there's some items to display, sort the items and add them to the container.
    Collections.sort(prefs, new Comparator<Preference>() {
        @Override
        public int compare(Preference lhs, Preference rhs) {
            return lhs.getTitle().toString().toLowerCase().compareTo(rhs.getTitle().toString().toLowerCase());
        }
    });
    for (Preference entry : prefs) {
        container.addPreference(entry);
    }
}
项目:ShaderEditor    文件:PreferencesFragment.java   
private void setSummary(Preference preference) {
    if (preference instanceof ShaderListPreference) {
        long id = Preferences.WALLPAPER_SHADER.equals(preference.getKey()) ?
                ShaderEditorApp.preferences.getWallpaperShader() :
                ShaderEditorApp.preferences.getDefaultNewShader();
        preference.setSummary(getShaderSummary(id));
    } else if (preference instanceof ListPreference) {
        preference.setSummary(((ListPreference) preference).getEntry());
    } else if (preference instanceof PreferenceGroup) {
        setSummaries((PreferenceGroup) preference);
    }
}
项目:DsaTab    文件:BasePreferenceFragment.java   
private void initPreferenceScreen(PreferenceGroup screen, SharedPreferences sharedPreferences) {

        final int count = screen.getPreferenceCount();

        for (int i = 0; i < count; i++) {
            Preference preference = screen.getPreference(i);

            if (preference instanceof PreferenceGroup) {
                initPreferenceScreen((PreferenceGroup) preference, sharedPreferences);
            } else {
                handlePreferenceChange(preference, sharedPreferences, preference.getKey());
            }
        }
    }
项目:Nird2    文件:PreferenceDividerDecoration.java   
@Override
public void onDrawOver(Canvas c, RecyclerView parent,
        RecyclerView.State state) {
    int left = parent.getPaddingLeft();
    int right = parent.getWidth() - parent.getPaddingRight();

    final PreferenceGroupAdapter adapter =
            (PreferenceGroupAdapter) parent.getAdapter();
    final int adapterCount = adapter.getItemCount();

    boolean wasLastPreferenceGroup = false;
    for (int i = 0, childCount = parent.getChildCount(); i < childCount;
            i++) {
        final View child = parent.getChildAt(i);

        final int adapterPosition = parent.getChildAdapterPosition(child);
        Preference preference = adapter.getItem(adapterPosition);

        boolean skipNextAboveDivider = false;
        if (adapterPosition == 0) {
            if (mDrawTop) {
                drawAbove(c, left, right, child);
            }
            skipNextAboveDivider = true;
        }

        if (preference instanceof PreferenceGroup
                && !(preference instanceof PreferenceScreen)) {
            if (mDrawBetweenCategories) {
                if (!skipNextAboveDivider) {
                    drawAbove(c, left, right, child);
                    skipNextAboveDivider = true;
                }
            }
            wasLastPreferenceGroup = true;
        } else {
            if (mDrawBetweenItems && !wasLastPreferenceGroup) {
                if (!skipNextAboveDivider) {
                    drawAbove(c, left, right, child);
                    skipNextAboveDivider = true;
                }
            }
            wasLastPreferenceGroup = false;
        }

        if (adapterPosition == adapterCount - 1) {
            if (mDrawBottom) {
                drawBottom(c, left, right, child);
            }
        }
    }
}
项目:Nird2    文件:PreferenceDividerDecoration.java   
@Override
public void onDrawOver(Canvas c, RecyclerView parent,
        RecyclerView.State state) {
    int left = parent.getPaddingLeft();
    int right = parent.getWidth() - parent.getPaddingRight();

    final PreferenceGroupAdapter adapter =
            (PreferenceGroupAdapter) parent.getAdapter();
    final int adapterCount = adapter.getItemCount();

    boolean wasLastPreferenceGroup = false;
    for (int i = 0, childCount = parent.getChildCount(); i < childCount;
            i++) {
        final View child = parent.getChildAt(i);

        final int adapterPosition = parent.getChildAdapterPosition(child);
        Preference preference = adapter.getItem(adapterPosition);

        boolean skipNextAboveDivider = false;
        if (adapterPosition == 0) {
            if (mDrawTop) {
                drawAbove(c, left, right, child);
            }
            skipNextAboveDivider = true;
        }

        if (preference instanceof PreferenceGroup
                && !(preference instanceof PreferenceScreen)) {
            if (mDrawBetweenCategories) {
                if (!skipNextAboveDivider) {
                    drawAbove(c, left, right, child);
                    skipNextAboveDivider = true;
                }
            }
            wasLastPreferenceGroup = true;
        } else {
            if (mDrawBetweenItems && !wasLastPreferenceGroup) {
                if (!skipNextAboveDivider) {
                    drawAbove(c, left, right, child);
                    skipNextAboveDivider = true;
                }
            }
            wasLastPreferenceGroup = false;
        }

        if (adapterPosition == adapterCount - 1) {
            if (mDrawBottom) {
                drawBottom(c, left, right, child);
            }
        }
    }
}
项目:android_nextgis_mobile    文件:NGIDSettingsFragment.java   
public void fillAccountPreferences(PreferenceGroup screen)
{
    String notDefined = getString(R.string.not_set);
    String value = mPreferences.getString(NGIDUtils.PREF_USERNAME, null);
    screen.findPreference(NGIDUtils.PREF_USERNAME)
            .setSummary(TextUtils.isEmpty(value) ? notDefined : value);
    value = mPreferences.getString(NGIDUtils.PREF_EMAIL, null);
    screen.findPreference(NGIDUtils.PREF_EMAIL)
            .setSummary(TextUtils.isEmpty(value) ? notDefined : value);
    value = mPreferences.getString(NGIDUtils.PREF_FIRST_NAME, null);
    screen.findPreference(NGIDUtils.PREF_FIRST_NAME)
            .setSummary(TextUtils.isEmpty(value) ? notDefined : value);
    value = mPreferences.getString(NGIDUtils.PREF_LAST_NAME, null);
    screen.findPreference(NGIDUtils.PREF_LAST_NAME)
            .setSummary(TextUtils.isEmpty(value) ? notDefined : value);
    screen.findPreference("sign_out")
            .setOnPreferenceClickListener(new Preference.OnPreferenceClickListener()
            {
                @Override
                public boolean onPreferenceClick(Preference preference)
                {
                    mPreferences.edit()
                            .remove(NGIDUtils.PREF_USERNAME)
                            .remove(NGIDUtils.PREF_EMAIL)
                            .remove(NGIDUtils.PREF_FIRST_NAME)
                            .remove(NGIDUtils.PREF_LAST_NAME)
                            .remove(NGIDUtils.PREF_ACCESS_TOKEN)
                            .remove(NGIDUtils.PREF_REFRESH_TOKEN)
                            .apply();

                    if (!NGPreferenceActivity.isMultiPane(getActivity())) {
                        mActivity.onBackPressed();
                        mActivity.onBackPressed();
                    } else {
                        mActivity.invalidatePreferences();
                    }
                    mActivity.replaceSettingsFragment(null);
                    return false;
                }
            });
}
项目:android_nextgis_mobile    文件:NGIDSettingsFragment.java   
public void fillAccountPreferences(PreferenceGroup screen)
{
    String notDefined = getString(R.string.not_set);
    String value = mPreferences.getString(NGIDUtils.PREF_USERNAME, null);
    screen.findPreference(NGIDUtils.PREF_USERNAME)
            .setSummary(TextUtils.isEmpty(value) ? notDefined : value);
    value = mPreferences.getString(NGIDUtils.PREF_EMAIL, null);
    screen.findPreference(NGIDUtils.PREF_EMAIL)
            .setSummary(TextUtils.isEmpty(value) ? notDefined : value);
    value = mPreferences.getString(NGIDUtils.PREF_FIRST_NAME, null);
    screen.findPreference(NGIDUtils.PREF_FIRST_NAME)
            .setSummary(TextUtils.isEmpty(value) ? notDefined : value);
    value = mPreferences.getString(NGIDUtils.PREF_LAST_NAME, null);
    screen.findPreference(NGIDUtils.PREF_LAST_NAME)
            .setSummary(TextUtils.isEmpty(value) ? notDefined : value);
    screen.findPreference("sign_out")
            .setOnPreferenceClickListener(new Preference.OnPreferenceClickListener()
            {
                @Override
                public boolean onPreferenceClick(Preference preference)
                {
                    mPreferences.edit()
                            .remove(NGIDUtils.PREF_USERNAME)
                            .remove(NGIDUtils.PREF_EMAIL)
                            .remove(NGIDUtils.PREF_FIRST_NAME)
                            .remove(NGIDUtils.PREF_LAST_NAME)
                            .remove(NGIDUtils.PREF_ACCESS_TOKEN)
                            .remove(NGIDUtils.PREF_REFRESH_TOKEN)
                            .apply();

                    if (!NGPreferenceActivity.isMultiPane(getActivity())) {
                        mActivity.onBackPressed();
                        mActivity.onBackPressed();
                    } else {
                        mActivity.invalidatePreferences();
                    }
                    mActivity.replaceSettingsFragment(null);
                    return false;
                }
            });
}
项目:android-testdpc    文件:BaseSearchablePolicyPreferenceFragment.java   
public HighlightablePreferenceGroupAdapter(PreferenceGroup preferenceGroup) {
    super(preferenceGroup);
}
项目:android_maplibui    文件:NGIDSettingsFragment.java   
public void fillAccountPreferences(PreferenceGroup screen)
{
    String notDefined = getString(R.string.not_set);
    String value = mPreferences.getString(NGIDUtils.PREF_USERNAME, null);
    screen.findPreference(NGIDUtils.PREF_USERNAME)
            .setSummary(TextUtils.isEmpty(value) ? notDefined : value);
    value = mPreferences.getString(NGIDUtils.PREF_EMAIL, null);
    screen.findPreference(NGIDUtils.PREF_EMAIL)
            .setSummary(TextUtils.isEmpty(value) ? notDefined : value);
    value = mPreferences.getString(NGIDUtils.PREF_FIRST_NAME, null);
    screen.findPreference(NGIDUtils.PREF_FIRST_NAME)
            .setSummary(TextUtils.isEmpty(value) ? notDefined : value);
    value = mPreferences.getString(NGIDUtils.PREF_LAST_NAME, null);
    screen.findPreference(NGIDUtils.PREF_LAST_NAME)
            .setSummary(TextUtils.isEmpty(value) ? notDefined : value);
    screen.findPreference("sign_out")
            .setOnPreferenceClickListener(new Preference.OnPreferenceClickListener()
            {
                @Override
                public boolean onPreferenceClick(Preference preference)
                {
                    mPreferences.edit()
                            .remove(NGIDUtils.PREF_USERNAME)
                            .remove(NGIDUtils.PREF_EMAIL)
                            .remove(NGIDUtils.PREF_FIRST_NAME)
                            .remove(NGIDUtils.PREF_LAST_NAME)
                            .remove(NGIDUtils.PREF_ACCESS_TOKEN)
                            .remove(NGIDUtils.PREF_REFRESH_TOKEN)
                            .apply();

                    File support = getContext().getExternalFilesDir(null);
                    if (support == null)
                        support = new File(getContext().getFilesDir(), SUPPORT);
                    else
                        support = new File(support, SUPPORT);
                    FileUtil.deleteRecursive(support);

                    if (!NGPreferenceActivity.isMultiPane(getActivity())) {
                        mActivity.onBackPressed();
                        mActivity.onBackPressed();
                    } else {
                        mActivity.invalidatePreferences();
                    }
                    mActivity.replaceSettingsFragment(null);
                    return false;
                }
            });
}
项目:ShaderEditor    文件:PreferencesFragment.java   
private void setSummaries(PreferenceGroup screen) {
    for (int i = screen.getPreferenceCount(); i-- > 0; ) {
        setSummary(screen.getPreference(i));
    }
}