SwipeLayout
SwipeLayout copied to clipboard
I drag an item and I want the other open items to be closed.
I drag an item and I want the other open items to be closed. Is there any configuration?
Use it like this. Hope this will help you. This is for right open, change is accordingly...
if (position == selectedPos && itemHolder.swipeLayout.isRightOpen()){
itemHolder.swipeLayout.close(true);
}
and in onswipe listener update the selectedPos
swipeLayout.setOnActionsListener(new SwipeLayout.SwipeActionsListener() {
@Override
public void onOpen(int direction, boolean isContinuous) {
notifyItemChanged(selectedPos);
selectedPos = getAdapterPosition();
if (direction == SwipeLayout.LEFT && isContinuous) {
if (getAdapterPosition() != NO_POSITION) {
delConfirmation(itemView.getContext(), getAdapterPosition(), swipeLayout);
}
}
}
@Override
public void onClose() {
//called when closing
}
});