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


Java PreferenceGroup.getPreferenceCount方法代码示例

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


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

示例1: getPreferenceParent

import android.support.v7.preference.PreferenceGroup; //导入方法依赖的package包/类
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;
}
 
开发者ID:gsantner,项目名称:markor,代码行数:17,代码来源:GsPreferenceFragmentCompat.java

示例2: tintPrefIconsRecursive

import android.support.v7.preference.PreferenceGroup; //导入方法依赖的package包/类
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);
                }
            }
        }
    }
}
 
开发者ID:gsantner,项目名称:markor,代码行数:15,代码来源:GsPreferenceFragmentCompat.java

示例3: initSummary

import android.support.v7.preference.PreferenceGroup; //导入方法依赖的package包/类
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);
    }
}
 
开发者ID:tomatrocho,项目名称:insapp-android,代码行数:13,代码来源:SettingsFragment.java

示例4: initPrefsInfos

import android.support.v7.preference.PreferenceGroup; //导入方法依赖的package包/类
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);
    }
}
 
开发者ID:FranckRJ,项目名称:RespawnIRC-Android,代码行数:15,代码来源:SettingsFragment.java

示例5: onActivityResult

import android.support.v7.preference.PreferenceGroup; //导入方法依赖的package包/类
/**
 * 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);
        }
    }
}
 
开发者ID:Gericop,项目名称:Android-Support-Preference-V7-Fix,代码行数:24,代码来源:PreferenceFragmentCompat.java

示例6: initSummary

import android.support.v7.preference.PreferenceGroup; //导入方法依赖的package包/类
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);
    }
}
 
开发者ID:alvinhkh,项目名称:buseta,代码行数:11,代码来源:SettingActivity.java

示例7: initSummary

import android.support.v7.preference.PreferenceGroup; //导入方法依赖的package包/类
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);
    }
}
 
开发者ID:MikeFot,项目名称:Android--Beacon-Scanner-Service,代码行数:11,代码来源:SettingsFragment.java

示例8: initPreferenceScreen

import android.support.v7.preference.PreferenceGroup; //导入方法依赖的package包/类
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());
            }
        }
    }
 
开发者ID:gandulf,项目名称:DsaTab,代码行数:15,代码来源:BasePreferenceFragment.java

示例9: setSummaries

import android.support.v7.preference.PreferenceGroup; //导入方法依赖的package包/类
private void setSummaries(PreferenceGroup screen) {
	for (int i = screen.getPreferenceCount(); i-- > 0; ) {
		setSummary(screen.getPreference(i));
	}
}
 
开发者ID:markusfisch,项目名称:ShaderEditor,代码行数:6,代码来源:PreferencesFragment.java


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