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

I drag an item and I want the other open items to be closed. #9

Open
cesarvv opened this issue Nov 29, 2021 · 1 comment
Open

I drag an item and I want the other open items to be closed. #9

cesarvv opened this issue Nov 29, 2021 · 1 comment

Comments

@cesarvv
Copy link

cesarvv commented Nov 29, 2021

I drag an item and I want the other open items to be closed.
Is there any configuration?

@aman4india
Copy link

aman4india commented Nov 16, 2022

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
               }
           });

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

2 participants