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


Java SpinnerPreference类代码示例

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


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

示例1: clearBrowsingData

import org.chromium.chrome.browser.preferences.SpinnerPreference; //导入依赖的package包/类
/**
 * Requests the browsing data corresponding to the given dialog options to be deleted.
 * @param options The dialog options whose corresponding data should be deleted.
 */
private final void clearBrowsingData(EnumSet<DialogOption> options,
        @Nullable String[] blacklistedDomains, @Nullable int[] blacklistedDomainReasons,
        @Nullable String[] ignoredDomains, @Nullable int[] ignoredDomainReasons) {
    showProgressDialog();

    int[] dataTypes = new int[options.size()];
    int i = 0;
    for (DialogOption option : options) {
        dataTypes[i] = option.getDataType();
        ++i;
    }

    Object spinnerSelection =
            ((SpinnerPreference) findPreference(PREF_TIME_RANGE)).getSelectedOption();
    int timePeriod = ((TimePeriodSpinnerOption) spinnerSelection).getTimePeriod();
    if (blacklistedDomains != null && blacklistedDomains.length != 0) {
        PrefServiceBridge.getInstance().clearBrowsingDataExcludingDomains(this, dataTypes,
                timePeriod, blacklistedDomains, blacklistedDomainReasons, ignoredDomains,
                ignoredDomainReasons);
    } else {
        PrefServiceBridge.getInstance().clearBrowsingData(this, dataTypes, timePeriod);
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:28,代码来源:ClearBrowsingDataPreferences.java

示例2: clearBrowsingData

import org.chromium.chrome.browser.preferences.SpinnerPreference; //导入依赖的package包/类
/**
 * Requests the browsing data corresponding to the given dialog options to be deleted.
 * @param options The dialog options whose corresponding data should be deleted.
 */
private final void clearBrowsingData(EnumSet<DialogOption> options,
        @Nullable String[] blacklistedDomains, @Nullable int[] blacklistedDomainReasons,
        @Nullable String[] ignoredDomains, @Nullable int[] ignoredDomainReasons) {
    showProgressDialog();

    int[] dataTypes = new int[options.size()];
    int i = 0;
    for (DialogOption option : options) {
        dataTypes[i] = option.getDataType();
        ++i;
    }

    Object spinnerSelection =
            ((SpinnerPreference) findPreference(PREF_TIME_RANGE)).getSelectedOption();
    int timePeriod = ((TimePeriodSpinnerOption) spinnerSelection).getTimePeriod();
    if (blacklistedDomains != null && blacklistedDomains.length != 0) {
        BrowsingDataBridge.getInstance().clearBrowsingDataExcludingDomains(this, dataTypes,
                timePeriod, blacklistedDomains, blacklistedDomainReasons, ignoredDomains,
                ignoredDomainReasons);
    } else {
        BrowsingDataBridge.getInstance().clearBrowsingData(this, dataTypes, timePeriod);
    }

    // Clear all reported entities.
    AppIndexingReporter.getInstance().clearHistory();
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:31,代码来源:ClearBrowsingDataPreferences.java


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