nuptboyzhb / SuperSwipeRefreshLayout

A custom SwipeRefreshLayout to support the pull-to-refresh featrue.RecyclerView,ListView,GridView,NestedScrollView,ScrollView are supported.
Apache License 2.0
1.24k stars 350 forks source link

当下拉刷新过程中,点击头部会收起后不会停止头部动画。 #17

Open chniccs opened 8 years ago

chniccs commented 8 years ago

问题是在下拉刷新过程中,主动点击头部View会出现头部收回后没有停止动画的情况,下次下拉时会叠加动画执行的速度。 `Animation.AnimationListener listener = null; if (!mScale) { listener = new Animation.AnimationListener() {

                        @Override
                        public void onAnimationStart(Animation animation) {
                        }

                        @Override
                        public void onAnimationEnd(Animation animation) {
                            if (!mScale) {
                                startScaleDownAnimation(null);//TODO
                            } 
                        }
                        @Override
                        public void onAnimationRepeat(Animation animation) {
                        }

                    };
                }
                animateOffsetToStartPosition(mCurrentTargetOffsetTop, listener);`

建议TODO这里,在动画结束时添加 if (usingDefaultHeader) { defaultProgressView.setOnDraw(false); } 不然下次下拉时会叠加速度