diff --git a/core/theme/src/main/java/com/android/developers/androidify/theme/SharedElementsConfig.kt b/core/theme/src/main/java/com/android/developers/androidify/theme/SharedElementsConfig.kt index a053eeb0..8ec3b7a9 100644 --- a/core/theme/src/main/java/com/android/developers/androidify/theme/SharedElementsConfig.kt +++ b/core/theme/src/main/java/com/android/developers/androidify/theme/SharedElementsConfig.kt @@ -64,7 +64,6 @@ import androidx.graphics.shapes.RoundedPolygon import androidx.graphics.shapes.circle import androidx.graphics.shapes.rectangle import androidx.navigation3.ui.LocalNavAnimatedContentScope -import com.android.developers.androidify.util.skipToLookaheadPlacement import kotlin.math.max sealed interface SharedElementKey { @@ -123,7 +122,7 @@ fun Modifier.sharedBoundsReveal( renderInOverlayDuringTransition = renderInOverlayDuringTransition, ) .skipToLookaheadSize() - .skipToLookaheadPlacement(sharedTransitionScope) + .skipToLookaheadPosition() } } @@ -201,7 +200,7 @@ fun Modifier.sharedBoundsRevealWithShapeMorph( val modifier = if (keepChildrenSizePlacement) { Modifier .skipToLookaheadSize() - .skipToLookaheadPlacement(sharedTransitionScope) + .skipToLookaheadPosition() } else { Modifier } diff --git a/core/util/src/main/java/com/android/developers/androidify/util/AnimationUtils.kt b/core/util/src/main/java/com/android/developers/androidify/util/AnimationUtils.kt index ad9f9738..8097d3c8 100644 --- a/core/util/src/main/java/com/android/developers/androidify/util/AnimationUtils.kt +++ b/core/util/src/main/java/com/android/developers/androidify/util/AnimationUtils.kt @@ -15,8 +15,6 @@ */ package com.android.developers.androidify.util -import androidx.compose.animation.ExperimentalSharedTransitionApi -import androidx.compose.animation.SharedTransitionScope import androidx.compose.foundation.text.BasicTextField import androidx.compose.foundation.text.input.TextFieldDecorator import androidx.compose.foundation.text.input.TextFieldState @@ -24,42 +22,11 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.remember import androidx.compose.ui.Modifier -import androidx.compose.ui.layout.approachLayout import androidx.compose.ui.text.TextStyle -import androidx.compose.ui.unit.round import kotlinx.coroutines.delay import java.text.BreakIterator import java.text.StringCharacterIterator -/** - * Skips to the end size for a particular composable, skipping through the intermediate animated sizes. - * Similar to skipToLookaheadSize, but for placement instead. - * This is useful if you'd like your content to be placed in its final position and not have any animations affect its layout. - * See the usage on the CameraPreviewScreen composable, we want the camera contents to remain in place, - * but the animation should perform a progressive reveal. - * - * @param scope The SharedTransitionScope where the transition is taking place. - * @return Modifier chain. - */ -@OptIn(ExperimentalSharedTransitionApi::class) -fun Modifier.skipToLookaheadPlacement(scope: SharedTransitionScope): Modifier = - this.approachLayout( - isMeasurementApproachInProgress = { false }, - isPlacementApproachInProgress = { scope.isTransitionActive }, - ) { measurable, constraints -> - measurable.measure(constraints).run { - layout(width, height) { - coordinates?.let { - with(scope) { - val target = lookaheadScopeCoordinates.localLookaheadPositionOf(it) - val actual = lookaheadScopeCoordinates.localPositionOf(it) - place((target - actual).round()) - } - } ?: place(0, 0) - } - } - } - @Composable fun AnimatedTextField( textFieldState: TextFieldState, diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9809036b..b17577b5 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -19,7 +19,7 @@ benchmarkMacroJunit4 = "1.4.0" camerax = "1.5.0-beta02" coilCompose = "3.3.0" coilGif = "3.3.0" -composeBom = "2025.07.01" +composeBom = "2025.08.00" concurrent = "1.2.0" converterGson = "2.11.0" coreKtx = "1.16.0"