Closed SanthoshDhandapani closed 9 years ago
I just love your work. Please fix this issue asap, so that this will become very effective.
@SanthoshDhandapani thanks for reporting a bug. Unfortunately I couldn't reproduce it. Can you post a screenshot or video of how/to reproduce it step by step. Also I've created a branch (issue_1) which has sample that uses RecyclerView instead of ListView. Thanks in advance.
@shliama Thank you very much for the response and sorry for my unclear steps about the issue. You sample project was working absolutely file. The issue happens when we place a view group under the pull to refresh view. Like the below screenshot In my project i need to do something with the help of relative layout, so in this case it happens.
@SanthoshDhandapani ok, now it's clear. I'll try to find out the way to fix this issue asap. Excuse me for delayed response, I'm quite busy these days.
Thanks for your response dude. Take your own time.
@SanthoshDhandapani ok, I've reproduced the problem, and found the solution. The problem was in the PullToRefreshView.java class in method canChildScrollUp(). The thing is, there is also a method called ensureTarget() which looks for a child view (in your case, it is RelativeLayout), that's why canChildScrollUp() was always returning false.
So, I recommend you to include this library to your project as local library project and change ensureTarget() method for your needs. Something similar to this (that is working with above code on your screenshot, but a bit ugly ;)
/** Create new variable to keep your list view that scrolls */
private View mListTarget;
private void ensureTarget() {
if (mTarget != null)
return;
if (getChildCount() > 0) {
for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i);
if (child != mRefreshView) {
mTarget = child;
/** Add here your logic to find it, here is just sample to take 1st child */
if (child instanceof ViewGroup) {
mListTarget = ((ViewGroup) child).getChildAt(0);
}
}
}
}
}
/** Pass here not the whole child, but sub-child that scrolls */
private boolean canChildScrollUp() {
return ViewCompat.canScrollVertically(mListTarget, -1);
}
@shilama Thank you very much for your efforts.
If i try to scroll up from the bottom of the list, it pulls the refresh view instead of scrolling up. Please fix it asap.