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

How to revert the state of the previous item when swiping a new item? #6

Open
TamND87 opened this issue Mar 29, 2022 · 3 comments
Open
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@TamND87
Copy link

TamND87 commented Mar 29, 2022

Hi, thank you for your library, it's perfect but could you give me the solution to revert the state of the previous item?

Ex:
The List has 4 items: A, B, C, D.
1/ Swipe item A EndToStart.
2/ Swipe item B & revert the state of item A.
3/ Swipe item C & revert the state of item B.

Thanks.

@ch4rl3x
Copy link
Owner

ch4rl3x commented Aug 5, 2022

Hi,

at the moment, there is no way to revert the other states. I am planning to inlclude these feature in the next version (hopefully) by using the same RevealState.

Alex

@ch4rl3x ch4rl3x added enhancement New feature or request help wanted Extra attention is needed labels Aug 5, 2022
@JahonovAsilbek
Copy link

Is there any news about this feature? @ch4rl3x

@pdnelson
Copy link

pdnelson commented Aug 29, 2024

@JahonovAsilbek and @TamND87, I was able to facilitate this behavior by storing the RevealState in the list item's data class.

This way, each item has its own RevealState, and when calling a state's confirmValueChange lambda, you can cycle through each item in the list, calling RevealState.animateTo(targetValue = RevealValue.Default) on any open list items.

This method of storing the RevealState with the list item allows you to change any list item's value without having to directly interact with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants