Comments (2)
I have this list (userList) that LazyColumn is using, and am doing it like this:
LazyColumn(
state = rememberLazyListState(),
modifier = Modifier.padding(bottom = 40.dp)
) {
items(sharedViewModel.userList, key = { item -> item.id }) { user ->
Box(modifier = Modifier.animateItemPlacement()) {
SwipeableBoxPreview(
navCtr, Modifier.padding() user, onRemoveClicked = {
sharedViewModel.userList.remove(user)
}
)
}
Spacer(Modifier.height(1.dp))
Divider()
Spacer(Modifier.height(1.dp))
}
}
fun SwipeableBoxPreview(
navCtr: NavHostController,
modifier: Modifier = Modifier,
user: User,
onRemoveClicked: (user: User) -> Unit
) {
val remove = SwipeAction(
icon = rememberVectorPainter(Icons.TwoTone.Delete),
background = Color.SeaBuckthorn,
onSwipe = {
onRemoveClicked(user)
}
)
SwipeableActionsBox(
modifier = modifier,
endActions = listOf(remove),
swipeThreshold = 40.dp,
backgroundUntilSwipeThreshold = MaterialTheme.colorScheme.surfaceColorAtElevation(20.dp),
) {
SwipeItem( )
}
}
from swipe.
Nice. Thank you
from swipe.
Related Issues (20)
- No matching variant of me.saket.swipe:swipe:1.0.0 was found HOT 4
- Request: Add text in swipe action HOT 1
- How to setup swipe to dismiss in one direction? HOT 3
- Animation broken using compose 1.5.0-beta01 HOT 2
- [request] swipe up/down support ↕️ HOT 3
- Allow option to disable overscroll HOT 3
- Add option for static icons HOT 1
- Crash while swiping HOT 3
- The ability to specify swiping directions HOT 4
- How do I detect swipe? HOT 1
- Support swipe to reveal
- Permanent vibration on _slow_ swipe after threshold was crossed
- Option to limit swiping distance HOT 1
- Disable swipe when no action added
- Issue with LayoutDirection.
- Support for content without background HOT 4
- Crash when swiped to full width HOT 2
- Unintentional swipes while scrolling HOT 4
- Opposite side's swipe action color flickering when swiping fast HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swipe.