From 6d4e0da9315fd9510498f7a368beeeb119b6d9d2 Mon Sep 17 00:00:00 2001 From: Igor Demin Date: Mon, 17 Jun 2024 14:30:48 +0200 Subject: [PATCH] Examples. JetSnack. Migrate to Compose 1.7 (#4989) `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. ``` --- .../kotlin/com/example/jetsnack/ui/components/Button.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/jetsnack/common/src/commonMain/kotlin/com/example/jetsnack/ui/components/Button.kt b/examples/jetsnack/common/src/commonMain/kotlin/com/example/jetsnack/ui/components/Button.kt index dd1889e39e..73fa507eea 100644 --- a/examples/jetsnack/common/src/commonMain/kotlin/com/example/jetsnack/ui/components/Button.kt +++ b/examples/jetsnack/common/src/commonMain/kotlin/com/example/jetsnack/ui/components/Button.kt @@ -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,