maurycyw / StaggeredGridView

A modified version of Android's experimental StaggeredGridView. Includes own OnItemClickListener and OnItemLongClickListener, selector, and fixed position restore.
https://github.com/maurycyw/StaggeredGridViewDemo
1.64k stars 664 forks source link

SwipeRefreshLayout #96

Closed rishabhsri20 closed 9 years ago

rishabhsri20 commented 9 years ago

Can not implement swipe refresh layout with this view. We can not scroll to the top instead it starts refreshing everytime I try to scroll to top.

ghost commented 9 years ago

This happens on any View that you try and wrap a SwipeRefreshLayout around. For it to work, you should consider extending this class and overriding its canChildScrollUp() method and make it return true.

Slake07 commented 9 years ago

@insanepaul can you please give me example of that?

ghost commented 9 years ago

Sure.

public class MySwipeRefreshLayout extends SwipeRefreshLayout {
    ...

    @Override
    public boolean canChildScrollUp() {
        return true;
    }

    ...
}

Then use MySwipeRefreshLayout instead of SwipeRefreshLayout in your code.