You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a similar problem to issue #40, loosing the ability to pull to refresh. It is possibly the same bug. I found a consistent way to reproduce it in my app was to:
Load a fresh page (therefore at the top of the list).
"Fling" scroll towards the bottom of the list
Before the previous "fling" scroll downwards has finished, "fling" back to the top of the page.
Looking at the code, the reason the refresh is not happening is that in PullToRefreshListView -- onTouchEvent, ACTION_MOVE is being called but previousY==-1. The first if statement therefore does not pass.
The difference between the above method and this:
Fresh page
Fling down
Wait for fling to finish
Fling to top
Pull to refresh (successful)
is that ACTION_DOWN is not called in the latter case, but is in the former, setting previousY = -1. I believe the ACTION_DOWN code is there for the purpose of stopping a user performing a pull to refresh unless they have started their pull from the top of the list. I think this makes sense.
My solution to this issue is to include:
previousY = event.getY();
to ACTION_UP, just before the break statement, outside of the if.
I have a similar problem to issue #40, loosing the ability to pull to refresh. It is possibly the same bug. I found a consistent way to reproduce it in my app was to:
If you don't know what I mean by "fling", see onFling at http://developer.android.com/reference/android/view/GestureDetector.OnGestureListener.html . It is a fast scroll and release. The page continues to scroll even though your finger has left the page.
Looking at the code, the reason the refresh is not happening is that in PullToRefreshListView -- onTouchEvent, ACTION_MOVE is being called but previousY==-1. The first if statement therefore does not pass.
The difference between the above method and this:
is that ACTION_DOWN is not called in the latter case, but is in the former, setting previousY = -1. I believe the ACTION_DOWN code is there for the purpose of stopping a user performing a pull to refresh unless they have started their pull from the top of the list. I think this makes sense.
My solution to this issue is to include:
to ACTION_UP, just before the break statement, outside of the if.
I am not sure if there will be unintended consequences to this. I have started testing and it seems to work. I will keep you posted.
The text was updated successfully, but these errors were encountered: