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

onCheckCanDrop method issue with StaggeredGridLayoutManager and setFullSpan #508

Open
isNoobDev opened this issue Jul 26, 2020 · 0 comments

Comments

@isNoobDev
Copy link

Hi,
I have a StaggeredGridLayout RecyclerView with a spanCount of 3.
The last item if a footer and it's set as:
(itemView.layoutParams as StaggeredGridLayoutManager.LayoutParams).isFullSpan = true

by doing so, the method onCheckCanDrop is triggered multiple times when i move an element on it.
screenshot

Let's suppose I have 5 items plus the footer, when I move the 5th (index 4) item to the footer (index 5), as shown in the screenshot, the onCheckCanDrop is called several in this way:

onCheckCanDrop from 4 to 4
onCheckCanDrop from 4 to 5
onCheckCanDrop from 4 to 4
onCheckCanDrop from 4 to 5
onCheckCanDrop from 4 to 4
onCheckCanDrop from 4 to 5
onCheckCanDrop from 4 to 4
onCheckCanDrop from 4 to 5
onCheckCanDrop from 4 to 4
onCheckCanDrop from 4 to 5
onCheckCanDrop from 4 to 4
onCheckCanDrop from 4 to 5
onCheckCanDrop from 4 to 4
onCheckCanDrop from 4 to 5
onCheckCanDrop from 4 to 4
onCheckCanDrop from 4 to 5

as you can see, the draggingPosition remains the same while the dropPosition switches between 4 and 5.

This is my adapter https://pastebin.com/pSSajdfz

Thank you in advance

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

1 participant