tuesda / CircleRefreshLayout

a custom pull-to-refresh layout which contains a interesting animation
1.78k stars 369 forks source link

Calling mRefreshLayout.finishRefreshing() does not finish animation if its too fast #5

Open Arbitrary-T opened 8 years ago

Arbitrary-T commented 8 years ago

For example if as soon as the user refreshes, and there is no data to update (for example no connection/website down etc...) the animation just keeps on going but you can still refresh again by pulling while its refreshing.

I solved this by using a handler and calling postdelayed with a delay of 1000ms this would finish the view's animation but its not ideal because of 1000ms delay.

SanthoshDhandapani commented 8 years ago

Yes finish refreshing does not happens mostly, which spoils the stable usability. Please fix asap

thesnowgoose commented 7 years ago

I am still having exactly the same issue.

`refreshLayout = (CircleRefreshLayout) findViewById(R.id.refresh_layout);

    if (refreshLayout != null) {
        refreshLayout.setOnRefreshListener(new CircleRefreshLayout.OnCircleRefreshListener() {
            @Override
            public void completeRefresh() { }

            @Override
            public void refreshing() {
                buildNewsRequest(null);
            }
        });
    }

` in "buildNewsRequest()" is where I am calling refreshLayout.finishRefreshing(); and the method is being called but the animation just keep playing if buildNewsRequest() ends to soon.

xrnd commented 7 years ago

Yes same here. My network call finishes sometimes in as less as 5 ms. Then I set mRefresh.finishRefreshing(); the animation still goes on and can not dismiss only. Please let me know the work around if anybody has already found it. Thanks