Skip to content

Commit

Permalink
Updated samples
Browse files Browse the repository at this point in the history
  • Loading branch information
aclassen committed Jun 2, 2022
1 parent fd4e89e commit f9976de
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ private fun HorizontalGrid(
contentPadding = PaddingValues(horizontal = 8.dp),
verticalArrangement = Arrangement.spacedBy(4.dp),
horizontalArrangement = Arrangement.spacedBy(4.dp),
modifier = modifier.reorderable(state).height(200.dp)
modifier = modifier
.reorderable(state).height(200.dp)
.detectReorderAfterLongPress(state)
) {
items(vm.cats, { it.key }) { item ->
ReorderableItem(state, item.key) { isDragging ->
Expand All @@ -76,7 +78,6 @@ private fun HorizontalGrid(
.shadow(elevation.value)
.aspectRatio(1f)
.background(MaterialTheme.colors.secondary)
.detectReorderAfterLongPress(state)
) {
Text(item.title)
}
Expand All @@ -97,7 +98,9 @@ private fun VerticalGrid(
contentPadding = PaddingValues(horizontal = 8.dp),
verticalArrangement = Arrangement.spacedBy(4.dp),
horizontalArrangement = Arrangement.spacedBy(4.dp),
modifier = modifier.reorderable(state)
modifier = modifier
.reorderable(state)
.detectReorderAfterLongPress(state)
) {
items(vm.dogs, { it.key }) { item ->
ReorderableItem(state, item.key) { isDragging ->
Expand All @@ -118,7 +121,6 @@ private fun VerticalGrid(
.shadow(elevation.value)
.aspectRatio(1f)
.background(MaterialTheme.colors.primary)
.detectReorderAfterLongPress(state)
) {
Text(item.title)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ private fun NewVerticalReorderList(
LazyColumn(
state = state.listState,
modifier = modifier
.then(Modifier.reorderable(state))
.then(Modifier
.reorderable(state)
.detectReorderAfterLongPress(state))
) {
items(vm.dogs, { item -> item.key }) { item ->
ReorderableItem(state, item.key) { dragging ->
Expand All @@ -88,7 +90,6 @@ private fun NewVerticalReorderList(
.shadow(elevation.value)
.fillMaxWidth()
.background(MaterialTheme.colors.surface)
.detectReorderAfterLongPress(state)
) {
Text(
text = item.title,
Expand All @@ -111,7 +112,9 @@ private fun NewHorizontalReorderList(
LazyRow(
state = state.listState,
horizontalArrangement = Arrangement.spacedBy(8.dp),
modifier = modifier.then(Modifier.reorderable(state)),
modifier = modifier.then(Modifier
.reorderable(state))
.detectReorderAfterLongPress(state),
) {
items(vm.cats, { item -> item.key }) { item ->
ReorderableItem(state, item.key) { dragging ->
Expand All @@ -125,7 +128,6 @@ private fun NewHorizontalReorderList(
.shadow(elevation, RoundedCornerShape(24.dp))
.clip(RoundedCornerShape(24.dp))
.background(Color.Red)
.detectReorderAfterLongPress(state)
) {
Text(item.title)
}
Expand Down

0 comments on commit f9976de

Please sign in to comment.