android-Ultra-Pull-To-Refresh icon indicating copy to clipboard operation
android-Ultra-Pull-To-Refresh copied to clipboard

How can i cancel refreshing event?

Open HeyAlex opened this issue 8 years ago • 7 comments

How can i cancel animation of refreshing and return header in start position? I need it because if my task return me an error(no connection with in-net) i want to return header in current state and set the last update time. How can i make it?

HeyAlex avatar Aug 07 '16 12:08 HeyAlex

You can use refreshComplete() to cancel / stop.

liaohuqiu avatar Aug 07 '16 13:08 liaohuqiu

if i use refreshComplete() header will be updated, i mean the counter of last update time will reset. i want to save previous updating time if i've got an error.

HeyAlex avatar Aug 07 '16 14:08 HeyAlex

I think you can setup your custom header to do this

van048 avatar Aug 08 '16 04:08 van048

I think it will be better to introduce a overload method: refreshComplete(boolean success).

liaohuqiu avatar Aug 08 '16 04:08 liaohuqiu

@liaohuqiu Yeah. It is better in that way. OnUIRefreshComplete(PtrFrameLayout frame) should be handled too.

van048 avatar Aug 08 '16 05:08 van048

As i understand, where is no way for me to extends PtrFrameLayout and override refreshCompleate() ?

HeyAlex avatar Aug 08 '16 06:08 HeyAlex

oh, Merci!

HeyAlex avatar Aug 08 '16 10:08 HeyAlex