From 21d85ea8bc6da66bf65e304a3c9ec4ef9decc98e Mon Sep 17 00:00:00 2001 From: xuncl Date: Fri, 4 Mar 2016 19:25:43 +0800 Subject: [PATCH] Make the finishing can be quickly applied. If stop the freshing too quick, the method getOutRatio() will reset the boolean mIsRefreshing as true again. Then the refreshing would never stop. This can solve the problem. --- .../com/tuesda/walker/circlerefresh/AnimationView.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/circlerefresh/src/main/java/com/tuesda/walker/circlerefresh/AnimationView.java b/circlerefresh/src/main/java/com/tuesda/walker/circlerefresh/AnimationView.java index 364834e..16b1892 100644 --- a/circlerefresh/src/main/java/com/tuesda/walker/circlerefresh/AnimationView.java +++ b/circlerefresh/src/main/java/com/tuesda/walker/circlerefresh/AnimationView.java @@ -296,6 +296,8 @@ private void drawOutCir(Canvas canvas) { private boolean mIsStart = true; private boolean mIsRefreshing = true; + private boolean isQuickStop = false; + private void drawRefreshing(Canvas canvas) { canvas.drawRect(0, 0, mWidth, mHeight, mBackPaint); int innerY = PULL_HEIGHT - PULL_DELTA / 2 - mRadius * 2; @@ -322,11 +324,17 @@ private void drawRefreshing(Canvas canvas) { } + if (isQuickStop){ + mIsRefreshing = false; + isQuickStop = false; + } } // stop refreshing public void setRefreshing(boolean isFresh) { - mIsRefreshing = isFresh; + + mIsRefreshing = isFresh; + isQuickStop = true; } private void drawDone(Canvas canvas) {