Tunous / SwipeActionView

Android swipe-able view, which allows users to perform actions with swipe gestures.
Apache License 2.0
196 stars 16 forks source link

One swipe moves multiple views #10

Closed AlexHuicu closed 7 years ago

AlexHuicu commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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

AlexHuicu commented 7 years ago

No, you did not. I replied to the issue on github

Pe 5 sept. 2017 17:25, "Łukasz Rutkowski" notifications@github.com a scris:

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

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Tunous/SwipeActionView/issues/10#issuecomment-327192115, or mute the thread https://github.com/notifications/unsubscribe-auth/AXf2kinYq5-2NPiqy8efKmp2YaTAeiXrks5sfVnugaJpZM4PM_sG .

Tunous commented 7 years ago

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.

AlexHuicu commented 7 years ago

Yes, you can close it. Thank you for your patience and reponsivity. And for the project, too :D

Pe 5 sept. 2017 18:03, "Łukasz Rutkowski" notifications@github.com a scris:

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.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Tunous/SwipeActionView/issues/10#issuecomment-327204011, or mute the thread https://github.com/notifications/unsubscribe-auth/AXf2knT3kX8k2nUAMM_AHBVk_XBzSLtVks5sfWKZgaJpZM4PM_sG .