Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using DragSort recycler with SwipeRefreshLayout #16

Open
ghost opened this issue Feb 23, 2015 · 3 comments
Open

Using DragSort recycler with SwipeRefreshLayout #16

ghost opened this issue Feb 23, 2015 · 3 comments

Comments

@ghost
Copy link

ghost commented Feb 23, 2015

Hello,

I have implemented your DragSort Recycler in my RecyclerView. I am also trying to implement the SwipeRefreshLayout on the recyclerview..

The problem I am facing is when I long press and drag the view in downward motion, the SwipeRefreshLayout's setOnRefreshListener gets called preventing me from sorting the view items. I am able to move items in the upward motion.

Any suggestions on this would be very helpful

@azizimusa
Copy link

i am facing similar problem as yours. what i am planning to do is, to add / remove either swiperefreshlayout or dragsortrecycler listener programmatically... or maybe dynamically control the swiperefreshlayout using dragstart or dragdrop function...

@robgravy
Copy link

I was able to get around this problem by enabling and disabling onDragStart/Stop override methods

        dragSortRecycler.setOnDragStateChangedListener(new DragSortRecycler.OnDragStateChangedListener() {
            @Override
            public void onDragStart() {
                mRefreshLayout.setEnabled(false);
            }

            @Override
            public void onDragStop() {
                mRefreshLayout.setEnabled(true);
            }
        });

@emileb
Copy link
Owner

emileb commented May 20, 2015

Thanks for this report and for the potential fix, I have not tried this yet so I will leave this open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants