use of org.chromium.chrome.browser.ntp.NewTabPageLayout in project AndroidChromium by JackyAndroid.
the class NewTabPageRecyclerView method findAboveTheFoldView.
/**
* Finds the above the fold view.
* @return The View for above the fold or null, if it is not present.
*/
public NewTabPageLayout findAboveTheFoldView() {
int aboveTheFoldPosition = getNewTabPageAdapter().getAboveTheFoldPosition();
if (aboveTheFoldPosition == RecyclerView.NO_POSITION)
return null;
ViewHolder viewHolder = findViewHolderForAdapterPosition(aboveTheFoldPosition);
if (viewHolder == null)
return null;
View view = viewHolder.itemView;
if (!(view instanceof NewTabPageLayout))
return null;
return (NewTabPageLayout) view;
}
use of org.chromium.chrome.browser.ntp.NewTabPageLayout in project AndroidChromium by JackyAndroid.
the class NewTabPageRecyclerView method updatePeekingCardAndHeader.
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();
}
Aggregations