本文整理汇总了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);
}
示例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);
}
示例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);
}
示例4: getCategoryInfo
import org.chromium.chrome.browser.ntp.cards.SuggestionsCategoryInfo; //导入依赖的package包/类
@Override
public SuggestionsCategoryInfo getCategoryInfo(int category) {
return mCategoryInfo.get(category);
}
示例5: getCategoryInfo
import org.chromium.chrome.browser.ntp.cards.SuggestionsCategoryInfo; //导入依赖的package包/类
@Override
public SuggestionsCategoryInfo getCategoryInfo(int category) {
assert mNativeSnippetsBridge != 0;
return nativeGetCategoryInfo(mNativeSnippetsBridge, category);
}
示例6: nativeGetCategoryInfo
import org.chromium.chrome.browser.ntp.cards.SuggestionsCategoryInfo; //导入依赖的package包/类
private native SuggestionsCategoryInfo nativeGetCategoryInfo(
long nativeNTPSnippetsBridge, int category);
示例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();
}
示例8: getCategoryInfo
import org.chromium.chrome.browser.ntp.cards.SuggestionsCategoryInfo; //导入依赖的package包/类
/**
* Gets the meta information of a category.
*/
SuggestionsCategoryInfo getCategoryInfo(int category);