Skip to content

Commit

Permalink
FIXED issue (Cannot draw back after Refreshing complete)
Browse files Browse the repository at this point in the history
FIXED issue (Cannot draw back after Refreshing complete) 

tuesda#7
tuesda#5
  • Loading branch information
samigehi committed Nov 6, 2015
1 parent 92a27db commit b1ae4de
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,33 @@ public void finishRefreshing() {
}
mIsRefreshing = false;
mHeader.setRefreshing(false);

back();
}

public boolean isRefreshing() {
return mIsRefreshing;
}

private void back() {
float height = mChildView.getTranslationY();
ValueAnimator backTopAni = ValueAnimator.ofFloat(height, 0);
backTopAni.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float val = (float) animation.getAnimatedValue();
val = decelerateInterpolator.getInterpolation(val / mHeaderHeight) * val;
if (mChildView != null) {
mChildView.setTranslationY(val);
}
mHeader.getLayoutParams().height = (int) val;
mHeader.requestLayout();
}
});
backTopAni.setDuration((long) (height * BACK_TOP_DUR / mHeaderHeight));
backTopAni.start();
}

private OnCircleRefreshListener onCircleRefreshListener;

public void setOnRefreshListener(OnCircleRefreshListener onCircleRefreshListener) {
Expand Down

1 comment on commit b1ae4de

@Vurtex
Copy link

@Vurtex Vurtex commented on b1ae4de Jan 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much.

Please sign in to comment.