コード例 #1
0
 protected void onScrollChanged(int i, int j, int k, int l) {
   super.onScrollChanged(i, j, k, l);
   if (mTrackedChild == null) {
     if (getChildCount() > 0) {
       mTrackedChild = getChildInTheMiddle();
       mTrackedChildPrevTop = mTrackedChild.getTop();
       mTrackedChildPrevPosition = getPositionForView(mTrackedChild);
     }
     return;
   }
   if (mTrackedChild.getParent() == this
       && getPositionForView(mTrackedChild) == mTrackedChildPrevPosition) {
     i = 1;
   } else {
     i = 0;
   }
   if (i != 0) {
     i = mTrackedChild.getTop();
     if (mScrollDeltaListener != null) {
       j = mTrackedChildPrevTop;
       mScrollDeltaListener.onScroll(i - j);
     }
     mTrackedChildPrevTop = i;
     return;
   } else {
     mTrackedChild = null;
     return;
   }
 }
コード例 #2
0
 public void dispatchDraw(Canvas canvas) {
   super.dispatchDraw(canvas);
   if (mPinnedHeaderIsVisible
       && mPinnedHeaderView != null
       && !isMode(2)
       && mPinnedHeaderOffset > -mPinnedHeaderHeight) {
     canvas.save();
     canvas.clipRect(
         0,
         mPinnedHeaderOffset + mNavBottom,
         getWidth(),
         mPinnedHeaderHeight + mPinnedHeaderOffset + mNavBottom);
     canvas.translate(0.0F, mPinnedHeaderOffset + mNavBottom);
     mPinnedHeaderView.draw(canvas);
     canvas.restore();
   }
 }
コード例 #3
0
 public void setAdapter(ListAdapter listadapter) {
   super.setAdapter(listadapter);
   if (listadapter instanceof PinnedHeaderAdapter) {
     setPinnedHeaderAdapter((PinnedHeaderAdapter) listadapter);
   }
 }
コード例 #4
0
 public void onMeasure(int i, int j) {
   super.onMeasure(i, j);
   measureHeader(mPinnedHeaderView);
 }
コード例 #5
0
 private void init() {
   super.setOnScrollListener(this);
 }