Java PreferenceCategory类代码示例

本文整理汇总了Java中android.support.v7.preference.PreferenceCategory的典型用法代码示例。如果您正苦于以下问题:Java PreferenceCategory类的具体用法?Java PreferenceCategory怎么用?Java PreferenceCategory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Java PreferenceCategory类代码示例

PreferenceCategory类属于android.support.v7.preference包,在下文中一共展示了PreferenceCategory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: initPrefsSummary

import android.support.v7.preference.PreferenceCategory; //导入依赖的package包/类
/**
 * Init single Preference
 */
protected void initPrefsSummary(SharedPreferences sharedPreferences,
                                Preference p) {
    if (p instanceof PreferenceCategory) {
        PreferenceCategory pCat = (PreferenceCategory) p;
        int pcCatCount = pCat.getPreferenceCount();
        for (int i = 0; i < pcCatCount; i++) {
            initPrefsSummary(sharedPreferences, pCat.getPreference(i));
        }
    } else {
        updatePrefsSummary(sharedPreferences, p);
        if (p instanceof RingtonePreference) {
            p.setOnPreferenceChangeListener(new RingToneOnPreferenceChangeListener());
            mRingtonePreference = (RingtonePreference) p;
        }
    }
} 
开发者ID:davideas,项目名称:AndroidBlueprints,代码行数:20,代码来源:PreferencesFragmentSummary.java

示例2: onCreatePreferences

import android.support.v7.preference.PreferenceCategory; //导入依赖的package包/类
@Override
public void onCreatePreferences(Bundle bundle, String s)
{
    super.onCreatePreferences(bundle, s);

    // Get our screen which is created in Skin SettingsFragment
    PreferenceScreen screen = getPreferenceScreen();

    // Get profile preference
    PreferenceCategory category = (PreferenceCategory) screen.findPreference(KEY_PROFILE);

    // If category exists, we should add mole mapper specific things. If not, that means we
    // are not consented so we have no data to set.
    if(category != null)
    {
        // Example Preference
        Preference checkBoxPref = new Preference(screen.getContext());
        checkBoxPref.setKey(KEY_EXAMPLE);
        checkBoxPref.setTitle("Example Title");
        checkBoxPref.setSummary("You need to extend your settings fragment from Skin's " +
                "Settings fragment and then modify any preferences that you'd like");
        category.addPreference(checkBoxPref);
    }
} 
开发者ID:daviszhou,项目名称:BeaconTrackerAndroid,代码行数:25,代码来源:SampleSettingsFragment.java

示例3: onCreatePreferences

import android.support.v7.preference.PreferenceCategory; //导入依赖的package包/类
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
    getPreferenceManager().setSharedPreferencesName(Constants.PREF_NAME);
    addPreferencesFromResource(R.xml.monitor);

    suVersion = Tools.SuVersion(getActivity());
    isCMSU = Tools.SuVersionBool(suVersion);

    mMonitor = (PreferenceCategory) findPreference("monitor_su");

    mPerAppDontCare = (Preference) findPreference("per_app_dontcare");
    mPerAppActive = (Preference) findPreference("per_app_active");
    mAutoRestartSU = (SwitchPreference) findPreference("auto_restart_su");
    mAutoRestartISU = (SwitchPreference) findPreference("auto_restart_isu");
    mPerAppDeactive = (Preference) findPreference("per_app_deactive");
    mMonitorView = (Preference) findPreference("per_app_view");
    mMonitorWarning = (Preference) findPreference("per_app_warning");

    mAutoRestartSU.setOnPreferenceChangeListener(this);
    mAutoRestartISU.setOnPreferenceChangeListener(this);

} 
开发者ID:bhb27,项目名称:isu,代码行数:23,代码来源:Monitor.java

示例4: onSharedPreferenceChanged

import android.support.v7.preference.PreferenceCategory; //导入依赖的package包/类
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key)
{
    switch(key)
    {
        case KEY_APP_MOLE_NAMING:
            String defaultNamingConvention = Integer.toString(MoleNameHelper.Gender.RANDOM.ordinal());
            String currentNamingConvInt = sharedPreferences.getString(key,
                    defaultNamingConvention);
            int currentNamingOrdinal = Integer.parseInt(currentNamingConvInt);

            // Get App Category
            PreferenceCategory categoryNaming = (PreferenceCategory) getPreferenceScreen().findPreference(
                    KEY_APP);

            // Get naming pref and change summary string
            Preference namingConventionPref = categoryNaming.findPreference(KEY_APP_MOLE_NAMING);
            namingConventionPref.setSummary(MoleNameHelper.Gender.values()[currentNamingOrdinal]
                    .getNameResourceId());
            break;
        default:
            super.onSharedPreferenceChanged(sharedPreferences, key);
            break;
    }
} 
开发者ID:ResearchStack,项目名称:MoleMapperAndroid,代码行数:26,代码来源:MoleMapperSettingsFragment.java

示例5: testDynamicPrefs

import android.support.v7.preference.PreferenceCategory; //导入依赖的package包/类
private void testDynamicPrefs() {
    final Context ctx = getPreferenceManager().getContext(); // this is the material styled context

    final PreferenceCategory dynamicCategory = (PreferenceCategory) findPreference("pref_categ");

    Preference prefAdd = findPreference("pref_add");
    if (prefAdd != null) {
        prefAdd.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
            private int n = 0;

            @Override
            public boolean onPreferenceClick(Preference preference) {
                Preference newPreference = new Preference(ctx);

                newPreference.setTitle("New preference " + n++);
                newPreference.setSummary(Long.toString(System.currentTimeMillis()));

                if (dynamicCategory != null) {
                    dynamicCategory.addPreference(newPreference);
                }
                return true;
            }
        });
    }
} 
开发者ID:Gericop,项目名称:Android-Support-Preference-V7-Fix,代码行数:26,代码来源:MyPreferenceFragment.java

示例6: onCreatePreferences

import android.support.v7.preference.PreferenceCategory; //导入依赖的package包/类
@Override
public void onCreatePreferences(Bundle bundle, String s) {
    super.addPreferencesFromResource(R.xml.rss_settings);

    // Get our screen which is created in Skin SettingsFragment
    PreferenceScreen screen = getPreferenceScreen();
    screen.getSharedPreferences().registerOnSharedPreferenceChangeListener(this);

    profileCategory = (PreferenceCategory) screen.findPreference(KEY_PROFILE);

    privacyCategory = (PreferenceCategory) screen.findPreference(KEY_PRIVACY);
    sharingScope = privacyCategory.findPreference(KEY_SHARING_OPTIONS);

    generalCategory = (PreferenceCategory) screen.findPreference(KEY_GENERAL);
    leaveStudy = generalCategory.findPreference(KEY_LEAVE_STUDY);
    joinStudy = generalCategory.findPreference(KEY_JOIN_STUDY);

    // Set version string
    screen.findPreference(KEY_VERSION).setSummary(getVersionString());
} 
开发者ID:ResearchStack,项目名称:ResearchStack,代码行数:21,代码来源:SettingsFragment.java

示例7: setMax

import android.support.v7.preference.PreferenceCategory; //导入依赖的package包/类
private void setMax(AudioManager audioManager, int catID, int key, int index) {
    PreferenceCategory cat = (PreferenceCategory)findPreference(getString(catID));
    ((SeekBarPreference)cat.findPreference(getString(key))).setMax(audioManager.getStreamMaxVolume(index));
} 
开发者ID:Eun,项目名称:InitialVolume,代码行数:5,代码来源:VolumeFragment.java

示例8: configureDisplayStatuses

import android.support.v7.preference.PreferenceCategory; //导入依赖的package包/类
@SuppressWarnings("ConstantConditions")
private void configureDisplayStatuses() {
    PreferenceCategory displayCategory =
            (PreferenceCategory) findPreference(PREF_ACCOUNT_DISPLAY_CATEGORY);
    Preference displayStatuses = findPreference(PREF_ACCOUNT_DISPLAY_STATUSES);
    boolean supportAccountStatus = ModelHelper.getGerritApi(getActivity()).supportsFeature(
            Features.ACCOUNT_STATUS, mAccount.mServerVersion);
    if (!supportAccountStatus) {
        displayCategory.removePreference(displayStatuses);
    }
} 
开发者ID:jruesga,项目名称:rview,代码行数:12,代码来源:AccountSettingsFragment.java

示例9: configureToggleTagged

import android.support.v7.preference.PreferenceCategory; //导入依赖的package包/类
private void configureToggleTagged() {
    PreferenceCategory messagesCategory =
            (PreferenceCategory) findPreference(PREF_ACCOUNT_MESSAGES_CATEGORY);
    Preference toggleTagged = findPreference(PREF_ACCOUNT_TOGGLE_TAGGED_MESSAGES);
    if (toggleTagged != null) {
        final GerritApi api = ModelHelper.getGerritApi(getActivity());
        boolean supportTaggedMessages = api != null
                && api.supportsFeature(Features.TAGGED_MESSAGES);
        if (!supportTaggedMessages) {
            messagesCategory.removePreference(toggleTagged);
        }
    }
} 
开发者ID:jruesga,项目名称:rview,代码行数:14,代码来源:AccountSettingsFragment.java

示例10: configureToggleCI

import android.support.v7.preference.PreferenceCategory; //导入依赖的package包/类
private void configureToggleCI() {
    PreferenceCategory messagesCategory =
            (PreferenceCategory) findPreference(PREF_ACCOUNT_MESSAGES_CATEGORY);
    Preference toggleCI = findPreference(PREF_ACCOUNT_TOGGLE_CI_MESSAGES);
    if (toggleCI != null) {
        Repository repository = ModelHelper.findRepositoryForAccount(getContext(), mAccount);
        if (repository == null || TextUtils.isEmpty(repository.mCiAccounts)) {
            messagesCategory.removePreference(toggleCI);
        }
    }
} 
开发者ID:jruesga,项目名称:rview,代码行数:12,代码来源:AccountSettingsFragment.java

示例11: configureNotifications

import android.support.v7.preference.PreferenceCategory; //导入依赖的package包/类
private void configureNotifications() {
    // Fetch or join current loader
    if (mNotificationsSupportLoader == null) {
        RxLoaderManager loaderManager = RxLoaderManagerCompat.get(this);
        mNotificationsSupportLoader = loaderManager.create(
                checkNotificationsSupport(), mNotificationsSupportObserver);
    }

    mNotificationsCategory =
            (PreferenceCategory) findPreference(PREF_ACCOUNT_NOTIFICATIONS_CATEGORY);
    mNotificationsAdvise =  findPreference(PREF_ACCOUNT_NOTIFICATIONS_ADVISE);
    mNotificationsAdvise.setOnPreferenceClickListener(this);
    mNotificationsEnabled =  findPreference(Constants.PREF_ACCOUNT_NOTIFICATIONS);
    mNotificationsEvents =  findPreference(Constants.PREF_ACCOUNT_NOTIFICATIONS_EVENTS);

    if (!mAccount.hasAuthenticatedAccessMode()) {
        if (mNotificationsCategory != null) {
            getPreferenceScreen().removePreference(mNotificationsCategory);
            mNotificationsCategory = null;
        }
    } else if (mAccount.hasNotificationsSupport()) {
        enableNotificationsSupport();
    } else {
        // Check notification support to server
        mNotificationsSupportLoader.restart();
    }
} 
开发者ID:jruesga,项目名称:rview,代码行数:28,代码来源:AccountSettingsFragment.java

示例12: configureHandleLinks

import android.support.v7.preference.PreferenceCategory; //导入依赖的package包/类
private void configureHandleLinks() {
    PreferenceCategory category =
            (PreferenceCategory) findPreference(PREF_ACCOUNT_EXTERNAL_CATEGORY);
    mHandleLinks = (TwoStatePreference) findPreference(PREF_ACCOUNT_HANDLE_LINKS);
    if (!ModelHelper.canAccountHandleUrls(getContext(), mAccount)) {
        if (mHandleLinks != null) {
            category.removePreference(mHandleLinks);
            mHandleLinks = null;
        }
    } else {
        mHandleLinks.setChecked(Preferences.isAccountHandleLinks(getContext(), mAccount)
                && ModelHelper.isAccountUrlHandlingEnabled(getContext(), mAccount));
        mHandleLinks.setOnPreferenceChangeListener(this);
    }
} 
开发者ID:jruesga,项目名称:rview,代码行数:16,代码来源:AccountSettingsFragment.java

示例13: configureAttachments

import android.support.v7.preference.PreferenceCategory; //导入依赖的package包/类
private void configureAttachments() {
    PreferenceCategory category =
            (PreferenceCategory) findPreference(PREF_ACCOUNT_ATTACHMENTS_CATEGORY);
    if (category != null &&
            AttachmentsProviderFactory.getAllAvailableAttachmentProviders().size() == 0) {
        getPreferenceScreen().removePreference(category);
    }
} 
开发者ID:jruesga,项目名称:rview,代码行数:9,代码来源:AccountSettingsFragment.java

示例14: configureContinuousIntegration

import android.support.v7.preference.PreferenceCategory; //导入依赖的package包/类
private void configureContinuousIntegration() {
    PreferenceCategory category =
            (PreferenceCategory) findPreference(PREF_ACCOUNT_CI_CATEGORY);
    if (category != null) {
        Repository repository = ModelHelper.findRepositoryForAccount(getActivity(), mAccount);
        if (repository == null || TextUtils.isEmpty(repository.mCiAccounts)) {
            getPreferenceScreen().removePreference(category);
        }
    }
} 
开发者ID:jruesga,项目名称:rview,代码行数:11,代码来源:AccountSettingsFragment.java

示例15: loadConnectionPreferences

import android.support.v7.preference.PreferenceCategory; //导入依赖的package包/类
private void loadConnectionPreferences(){
	this.rootPref = getPreferenceScreen();
	this.usbPrefs = (PreferenceCategory) findPreference("pref_usb");
	this.tcpPrefs = (PreferenceCategory) findPreference("pref_server");
	this.udpPrefs = (PreferenceCategory) findPreference("pref_server_udp");
	this.bluetoothPrefs = (PreferenceCategory) findPreference("pref_bluetooth");
} 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:8,代码来源:ModeDisconnectedFragment.java

本文标签属性:

示例:示例英文

代码:代码转换器

java:javascript18岁

PreferenceCategory:PreferenceCategory

上一篇:Java CronTriggerBean.setJobDetail方法代码示例(javacrontriggerbean.setjobdetail方法代码示例汇总)
下一篇:导师是什么意思(导师的意思导师的意思是什么)

为您推荐