I have a custom adapter for a ListView. On getView()
, I attach an onTouchListener to the convertView.
Upon touch of the item/convertView, I update the ViewHolder's RelativeLayout's LayoutParams to be shifted left and set a couple buttons revealed underneath the uppermost layout to clickable, as described on a few swipeable ListView guides.
Unfortunately, when I scroll down my ListView, other items also now have the layout slid to the side with the buttons set clickable underneath. I am not sure why a change to a single ViewHolder is being recycled to others, but I'm sure I'm just falling prey to a simple misunderstanding. Can anyone offer an explanation and solution? Thanks!
After recycling a view you should reset the view to its initial state and populate it with the new values.