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

One swipe moves multiple views #10

Closed
AlexHuicu opened this issue Sep 5, 2017 · 6 comments
Closed

One swipe moves multiple views #10

AlexHuicu opened this issue Sep 5, 2017 · 6 comments
Labels

Comments

@AlexHuicu
Copy link

AlexHuicu commented Sep 5, 2017

Having 10 SwipeActionViews in a ListView using a coustom adapter, swiping a view changes other also: number 0 changes number 7, 1 changes 8.
When having 35 views , swiping a view cause other 4 to swipe, one every 7 views.

I haven't inspected it yet

@AlexHuicu
Copy link
Author

I have inspected this and it was because I used ViewHolder pattern, recommended by Google. When "convertedView" was not null in adapter's getView(..) method, the listview was not creating a new view, but using an existing one, and hence the problem

@Tunous
Copy link
Owner

Tunous commented Sep 5, 2017

You mean that when you swipe one view you can observe few other views also move at the same time? This seems to be either issue with adapter or touch event handing on your side. I'm not sure if there is anything that could be causing this on library side.

Please try to investigate this further and let me know if you find anything.
Myself I'm using SwipeActionView with RecyclerView and never noticed this problem.

@Tunous
Copy link
Owner

Tunous commented Sep 5, 2017

RecyclerView uses view holder pattern so it should be no different. Did I misunderstand something in your issue?

@AlexHuicu
Copy link
Author

AlexHuicu commented Sep 5, 2017 via email

@Tunous
Copy link
Owner

Tunous commented Sep 5, 2017

I think I understand now. You were keeping views in scrolled state by returning false in gesture listener methods. And when you scrolled your ListView then the newly bound views would keep the state of other views. You probably fixed that by calling moveToOriginalPosition().

I'm closing this issue as that was user error. The views behaved correctly.

@Tunous Tunous closed this as completed Sep 5, 2017
@Tunous Tunous added the invalid label Sep 5, 2017
@AlexHuicu
Copy link
Author

AlexHuicu commented Sep 5, 2017 via email

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

No branches or pull requests

2 participants