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


Java SuggestionsCategoryInfo类代码示例

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


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

示例1: createSuggestionsCategoryInfo

import org.chromium.chrome.browser.ntp.cards.SuggestionsCategoryInfo; //导入依赖的package包/类
@CalledByNative
private static SuggestionsCategoryInfo createSuggestionsCategoryInfo(int category, String title,
        int cardLayout, boolean hasMoreAction, boolean hasReloadAction,
        boolean hasViewAllAction, boolean showIfEmpty, String noSuggestionsMessage) {
    return new SuggestionsCategoryInfo(category, title, cardLayout, hasMoreAction,
            hasReloadAction, hasViewAllAction, showIfEmpty, noSuggestionsMessage);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:8,代码来源:SnippetsBridge.java

示例2: createSuggestionsCategoryInfo

import org.chromium.chrome.browser.ntp.cards.SuggestionsCategoryInfo; //导入依赖的package包/类
@CalledByNative
private static SuggestionsCategoryInfo createSuggestionsCategoryInfo(int category, String title,
        @ContentSuggestionsCardLayout int cardLayout,
        @ContentSuggestionsAdditionalAction int additionalAction, boolean showIfEmpty,
        String noSuggestionsMessage) {
    return new SuggestionsCategoryInfo(
            category, title, cardLayout, additionalAction, showIfEmpty, noSuggestionsMessage);
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:9,代码来源:SnippetsBridge.java

示例3: setInfoForCategory

import org.chromium.chrome.browser.ntp.cards.SuggestionsCategoryInfo; //导入依赖的package包/类
/**
 * Sets the metadata to be returned for a given category.
 */
public void setInfoForCategory(@CategoryInt int category, SuggestionsCategoryInfo info) {
    mCategoryInfo.put(category, info);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:7,代码来源:FakeSuggestionsSource.java

示例4: getCategoryInfo

import org.chromium.chrome.browser.ntp.cards.SuggestionsCategoryInfo; //导入依赖的package包/类
@Override
public SuggestionsCategoryInfo getCategoryInfo(int category) {
    return mCategoryInfo.get(category);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:5,代码来源:FakeSuggestionsSource.java

示例5: getCategoryInfo

import org.chromium.chrome.browser.ntp.cards.SuggestionsCategoryInfo; //导入依赖的package包/类
@Override
public SuggestionsCategoryInfo getCategoryInfo(int category) {
    assert mNativeSnippetsBridge != 0;
    return nativeGetCategoryInfo(mNativeSnippetsBridge, category);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:6,代码来源:SnippetsBridge.java

示例6: nativeGetCategoryInfo

import org.chromium.chrome.browser.ntp.cards.SuggestionsCategoryInfo; //导入依赖的package包/类
private native SuggestionsCategoryInfo nativeGetCategoryInfo(
long nativeNTPSnippetsBridge, int category);
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:3,代码来源:SnippetsBridge.java

示例7: onBindViewHolder

import org.chromium.chrome.browser.ntp.cards.SuggestionsCategoryInfo; //导入依赖的package包/类
/**
 * Updates ViewHolder with data.
 * @param article The snippet to take the data from.
 * @param categoryInfo The info of the category which the snippet belongs to.
 */
public void onBindViewHolder(
        final SnippetArticle article, SuggestionsCategoryInfo categoryInfo) {
    super.onBindViewHolder();

    mArticle = article;
    mCategoryInfo = categoryInfo;
    updateLayout();

    mHeadlineTextView.setText(mArticle.mTitle);

    // The favicon of the publisher should match the TextView height.
    int widthSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
    int heightSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
    mPublisherTextView.measure(widthSpec, heightSpec);
    mPublisherFaviconSizePx = mPublisherTextView.getMeasuredHeight();

    mArticleSnippetTextView.setText(mArticle.mPreviewText);
    mPublisherTextView.setText(getPublisherString(mArticle));
    mArticleAgeTextView.setText(getArticleAge(mArticle));
    setThumbnail();

    // Set the favicon of the publisher.
    // We start initialising with the default favicon to reserve the space and prevent the text
    // from moving later.
    setDefaultFaviconOnView();
    try {
        long faviconFetchStartTimeMs = SystemClock.elapsedRealtime();
        URI pageUrl = new URI(mArticle.mUrl);
        if (!article.isArticle() || !SnippetsConfig.isFaviconsFromNewServerEnabled()) {
            // The old code path. Remove when the experiment is successful.
            // Currently, we have to use this for non-articles, due to privacy.
            fetchFaviconFromLocalCache(pageUrl, true, faviconFetchStartTimeMs);
        } else {
            // The new code path.
            fetchFaviconFromLocalCacheOrGoogleServer(faviconFetchStartTimeMs);
        }
    } catch (URISyntaxException e) {
        // Do nothing, stick to the default favicon.
    }

    mOfflineBadge.setVisibility(View.GONE);
    refreshOfflineBadgeVisibility();
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:49,代码来源:SnippetArticleViewHolder.java

示例8: getCategoryInfo

import org.chromium.chrome.browser.ntp.cards.SuggestionsCategoryInfo; //导入依赖的package包/类
/**
 * Gets the meta information of a category.
 */
SuggestionsCategoryInfo getCategoryInfo(int category);
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:5,代码来源:SuggestionsSource.java


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