本文整理汇总了Java中org.chromium.chrome.browser.ntp.NewTabPageLayout类的典型用法代码示例。如果您正苦于以下问题:Java NewTabPageLayout类的具体用法?Java NewTabPageLayout怎么用?Java NewTabPageLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NewTabPageLayout类属于org.chromium.chrome.browser.ntp包,在下文中一共展示了NewTabPageLayout类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updatePeekingCardAndHeader
import org.chromium.chrome.browser.ntp.NewTabPageLayout; //导入依赖的package包/类
public void updatePeekingCardAndHeader() {
NewTabPageLayout aboveTheFoldView = findAboveTheFoldView();
if (aboveTheFoldView == null) return;
SectionHeaderViewHolder header = findFirstHeader();
if (header == null) return;
header.updateDisplay(computeVerticalScrollOffset(), mHasSpaceForPeekingCard);
CardViewHolder firstCard = findFirstCard();
if (firstCard != null) updatePeekingCard(firstCard);
// Update the space at the bottom, which needs to know about the height of the header.
refreshBottomSpacing();
}
示例2: findAboveTheFoldView
import org.chromium.chrome.browser.ntp.NewTabPageLayout; //导入依赖的package包/类
/**
* Finds the above the fold view.
* @return The view for above the fold or null, if it is not present.
*/
public NewTabPageLayout findAboveTheFoldView() {
int position = getNewTabPageAdapter().getAboveTheFoldPosition();
if (position == RecyclerView.NO_POSITION) return null;
ViewHolder viewHolder = findViewHolderForAdapterPosition(position);
if (viewHolder == null) return null;
View view = viewHolder.itemView;
if (!(view instanceof NewTabPageLayout)) return null;
return (NewTabPageLayout) view;
}
示例3: NewTabPageRecyclerView
import org.chromium.chrome.browser.ntp.NewTabPageLayout; //导入依赖的package包/类
public NewTabPageRecyclerView(Context context) {
super(context);
Resources res = getContext().getResources();
mToolbarHeight = res.getDimensionPixelSize(R.dimen.toolbar_height_no_shadow)
+ res.getDimensionPixelSize(R.dimen.toolbar_progress_bar_height);
mPeekingCardBounceDistance =
res.getDimensionPixelSize(R.dimen.snippets_peeking_card_bounce_distance);
mSearchBoxTransitionLength =
res.getDimensionPixelSize(R.dimen.ntp_search_box_transition_length);
mPeekingHeight = res.getDimensionPixelSize(R.dimen.snippets_padding);
mAboveTheFoldView = (NewTabPageLayout) LayoutInflater.from(getContext())
.inflate(R.layout.new_tab_page_layout, this, false);
}
示例4: findAboveTheFoldView
import org.chromium.chrome.browser.ntp.NewTabPageLayout; //导入依赖的package包/类
/**
* Finds the above the fold view.
* @return The view for above the fold or null, if it is not present.
*/
private NewTabPageLayout findAboveTheFoldView() {
int position = getNewTabPageAdapter().getAboveTheFoldPosition();
if (position == RecyclerView.NO_POSITION) return null;
ViewHolder viewHolder = findViewHolderForAdapterPosition(position);
if (viewHolder == null) return null;
View view = viewHolder.itemView;
if (!(view instanceof NewTabPageLayout)) return null;
return (NewTabPageLayout) view;
}
示例5: getAboveTheFoldView
import org.chromium.chrome.browser.ntp.NewTabPageLayout; //导入依赖的package包/类
public NewTabPageLayout getAboveTheFoldView() {
return mAboveTheFoldView;
}