Skip to content

Commit

Permalink
Examples. JetSnack. Migrate to Compose 1.7 (#4989)
Browse files Browse the repository at this point in the history
`rememberRipple` was deprecated:

https://teamcity.jetbrains.com/buildConfiguration/JetBrainsPublicProjects_Compose_Task4ValidateExamples/4656662?hideTestsFromDependencies=false&hideProblemsFromDependencies=false&expandBuildDeploymentsSection=false&expandBuildProblemsSection=true
```
e: file:///home/teamcity/agent/work/b302b5c06ec67883/examples/jetsnack/common/src/commonMain/kotlin/com/example/jetsnack/ui/components/Button.kt:94:52 '@deprecated(...) @composable() fun rememberRipple(bounded: Boolean = ..., radius: Dp = ..., color: Color = ...): Indication' is deprecated. rememberRipple has been deprecated - it returns an old Indication implementation that is not compatible with the new Indication APIs that provide notable performance improvements. Instead, use the new ripple APIs provided by design system libraries, such as material and material3. If you are implementing your own design system library, use createRippleNode to create your own custom ripple implementation that queries your own theme values. For a migration guide and background information, please visit developer.android.com.
```
  • Loading branch information
igordmn committed Jun 17, 2024
1 parent a1b88db commit 6d4e0da
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,14 @@ fun JetsnackButton(
value = MaterialTheme.typography.button
) {
Row(
@Suppress("DEPRECATION_ERROR")
Modifier
.defaultMinSize(
minWidth = ButtonDefaults.MinWidth,
minHeight = ButtonDefaults.MinHeight
)
// TODO This should be replaced by non-deprecated alternative after the original example migrates to Jetpack Compose 1.7:
// https://github.com/android/compose-samples/blob/3bc6b7d7c74571ea74776ec5b15518b40de4d31b/Jetsnack/app/src/main/java/com/example/jetsnack/ui/components/Button.kt#L95
.indication(interactionSource, rememberRipple())
.padding(contentPadding),
horizontalArrangement = Arrangement.Center,
Expand Down

0 comments on commit 6d4e0da

Please sign in to comment.