SwipeToDismiss(
state = rememberDismissState(),
background = { /* Background Content */ },
dismissContent = { /* Content to Dismiss */ }
)
val refreshState = rememberSwipeRefreshState(isRefreshing = false)
SwipeRefresh(
state = refreshState,
onRefresh = { /* Refresh logic */ }
) {
Text("Swipe to Refresh")
}
Box(
modifier = Modifier.fillMaxSize()
) {
Text("This fills the entire screen")
}
BoxWithConstraints {
if (maxWidth < 300.dp) {
Text("Small screen")
} else {
Text("Large screen")
}
}
Box(
modifier = Modifier
.size(300.dp)
.scrollable(
state = rememberScrollableState { delta ->
// Handle scroll delta
delta
},
orientation = Orientation.Vertical
)
) {
Text("Scrollable content")
}
val scrollState = rememberScrollState()
Column(
modifier = Modifier.verticalScroll(scrollState)
) {
repeat(20) {
Text("Item #$it")
}
}
LazyVerticalGrid(
cells = GridCells.Adaptive(128.dp),
contentPadding = PaddingValues(16.dp)
) {
items(20) { index ->
Card(
modifier = Modifier.padding(4.dp),
elevation = 4.dp
) {
Text("Item $index", Modifier.padding(16.dp))
}
}
}
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。