Exemple #1
0
 private void updateHeaderHeight(float delta) {
   mHeaderView.setVisiableHeight((int) delta + mHeaderView.getVisiableHeight());
   if (mEnablePullRefresh && !mPullRefreshing) { // 未处于刷新状态,更新箭头
     if (mHeaderView.getVisiableHeight() > mHeaderViewHeight) {
       mHeaderView.setState(NewListViewHeader.STATE_READY);
     } else {
       mHeaderView.setState(NewListViewHeader.STATE_NORMAL);
     }
   }
   setSelection(0); // scroll to top each time
 }
Exemple #2
0
 @Override
 public void computeScroll() {
   if (mScroller.computeScrollOffset()) {
     if (mScrollBack == SCROLLBACK_HEADER) {
       mHeaderView.setVisiableHeight(mScroller.getCurrY());
     } else {
       mFooterView.setBottomMargin(mScroller.getCurrY());
     }
     postInvalidate();
     invokeOnScrolling();
   }
   super.computeScroll();
 }