Skip to content

Commit 07ce7fa

Browse files
committed
merging changes from main
2 parents fe4f3f2 + c85963d commit 07ce7fa

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

compose/snippets/src/main/java/com/example/compose/snippets/components/SwipeToDismissBox.kt

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright 2024 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package com.example.compose.snippets.components
218

319
import androidx.compose.animation.animateColorAsState
@@ -229,10 +245,10 @@ fun SwipeCardItem(
229245
SwipeToDismissBoxValue.StartToEnd ->
230246
lerp(Color.LightGray, Color.Blue, swipeToDismissState.progress)
231247

232-
233248
SwipeToDismissBoxValue.EndToStart ->
234249
lerp(Color.LightGray, Color.Red, swipeToDismissState.progress)
235-
}, label = "swipeable card item background color"
250+
},
251+
label = "swipeable card item background color"
236252
)
237253
Row(
238254
modifier = Modifier
@@ -262,7 +278,6 @@ fun SwipeCardItem(
262278
}
263279
}
264280

265-
266281
SwipeToDismissBoxValue.EndToStart -> {
267282
Spacer(modifier = Modifier)
268283
Icon(
@@ -274,11 +289,11 @@ fun SwipeCardItem(
274289
)
275290
}
276291

277-
278292
SwipeToDismissBoxValue.Settled -> {}
279293
}
280294
}
281-
}) {
295+
}
296+
) {
282297
content(value)
283298
}
284299
}
@@ -314,10 +329,11 @@ private fun SwipeCardItemExample() {
314329
OutlinedCard(shape = RectangleShape) {
315330
ListItem(
316331
headlineContent = { Text(todoItem.itemDescription) },
317-
supportingContent = { Text("swipe me to update or remove.") })
332+
supportingContent = { Text("swipe me to update or remove.") }
333+
)
318334
}
319335
}
320336
}
321337
}
322338
}
323-
// [END android_compose_components_swipecarditemexample]
339+
// [END android_compose_components_swipecarditemexample]

0 commit comments

Comments
 (0)