@Override protected void onLayout(boolean changed, int l, int t, int r, int b) { super.onLayout(changed, l, t, r, b); final View child = getChildAt(0); if (child != null) { mScrollThreshold = Math.max(0, child.getMeasuredHeight() - b + t - getPaddingBottom()); } if (b - t > 0) { // Post check scroll in the next run loop, so that the callback methods will be invoked // after the layout pass. This way a new layout pass will be scheduled if view // properties are changed in the callbacks. post(mCheckScrollRunnable); } }
@Override protected void pageScrollDown() { mScrollView.pageScroll(ScrollView.FOCUS_DOWN); }
@Override protected void onScrollChanged(int l, int t, int oldl, int oldt) { super.onScrollChanged(l, t, oldl, oldt); if (oldt != t) { checkScroll(); } }
@Override protected void requireScroll() { super.requireScroll(); mScrollView.setBottomScrollListener(this); }
@Override protected void onScrollChanged(int l, int t, int oldl, int oldt) { super.onScrollChanged(l, t, oldl, oldt); updateStickyHeaderPosition(); }
private void checkScroll() { if (mListener != null) { if (getScrollY() >= mScrollThreshold) { mListener.onScrolledToBottom(); } else if (!mRequiringScroll) { mRequiringScroll = true; mListener.onRequiresScroll(); } } }
@Override protected void onLayout(boolean changed, int l, int t, int r, int b) { super.onLayout(changed, l, t, r, b); if (mSticky == null) { updateStickyView(); } updateStickyHeaderPosition(); }