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

Hello #546

Open
UmairAhmed420 opened this issue Dec 19, 2019 · 1 comment
Open

Hello #546

UmairAhmed420 opened this issue Dec 19, 2019 · 1 comment

Comments

@UmairAhmed420
Copy link

is there a way to check if one swipe is already open then before opening 2nd swipe first swipe gets close

@sheckspir
Copy link

SwipeLayout is just a ViewGroup. So it shouldn't know about other views.
You can resolve that logic by yourself
For example, if you use RececlerView with many items(viewed by SwipeLayout) you can ask each SwipeLayout is it opened or closed and do your logic:

var closed = 0
for (i in 0..recyclerView.childCount) {
    val view = recyclerView.getChildAt(i)
    if (view is SwipeLayout) {
        if (view.openStatus == SwipeLayout.Status.Open)  {
            closed++
            view.close()
        }
    }
}
Toast.makeText(context, "We closed $closed items", Toast.LENGTH_SHORT).show()

I'm not sure about how resolve situation with Status.Middle in right way

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