diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/ui/month/MonthMorph.kt b/app/src/main/java/de/jeanlucmakiola/calendula/ui/month/MonthMorph.kt index ec05cd2..1cd42c9 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/ui/month/MonthMorph.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/ui/month/MonthMorph.kt @@ -1,18 +1,13 @@ package de.jeanlucmakiola.calendula.ui.month import androidx.compose.animation.AnimatedVisibilityScope -import androidx.compose.animation.BoundsTransform import androidx.compose.animation.ExperimentalSharedTransitionApi import androidx.compose.animation.SharedTransitionScope import androidx.compose.animation.fadeIn import androidx.compose.animation.fadeOut -import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.runtime.compositionLocalOf -import androidx.compose.runtime.remember import androidx.compose.ui.Modifier -import androidx.compose.ui.geometry.Rect import kotlinx.datetime.LocalDate /** @@ -61,22 +56,6 @@ internal class MonthMorphScope( internal val LocalMonthMorph = compositionLocalOf { null } -/** - * How fast a tagged piece travels between its two homes. - * - * The *fast* spatial spec, not the default one the month/week/day page slide - * uses. Paging is a spring under one whole page and wants room to settle; this is - * a direct answer to a drag the user has already committed to, and at the default - * pace the grid felt like it was catching up rather than responding. It is also - * a hundred-odd pieces moving at once, where a long settle reads as lag. - */ -@OptIn(ExperimentalSharedTransitionApi::class, ExperimentalMaterial3ExpressiveApi::class) -@Composable -internal fun rememberMorphBoundsTransform(): BoundsTransform { - val spec = MaterialTheme.motionScheme.fastSpatialSpec() - return remember(spec) { BoundsTransform { _, _ -> spec } } -} - /** * Tag content that is *the same thing* on both sides — a background pill, a day * number — so it animates between its two positions and sizes. @@ -89,7 +68,6 @@ internal fun Modifier.morphElement(key: MonthMorphKey): Modifier { this@morphElement.sharedElement( sharedContentState = rememberSharedContentState(key), animatedVisibilityScope = morph.visibility, - boundsTransform = rememberMorphBoundsTransform(), ) } } @@ -114,7 +92,6 @@ internal fun Modifier.morphBounds(key: MonthMorphKey): Modifier { animatedVisibilityScope = morph.visibility, enter = fadeIn(), exit = fadeOut(), - boundsTransform = rememberMorphBoundsTransform(), resizeMode = SharedTransitionScope.ResizeMode.RemeasureToBounds, ) } diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/ui/month/MonthScreen.kt b/app/src/main/java/de/jeanlucmakiola/calendula/ui/month/MonthScreen.kt index e1ec215..c8dc4af 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/ui/month/MonthScreen.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/ui/month/MonthScreen.kt @@ -47,7 +47,6 @@ import androidx.compose.material.icons.filled.Menu import androidx.compose.material.icons.filled.Search import androidx.compose.material3.DrawerValue import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.Icon import androidx.compose.material3.IconButton @@ -909,7 +908,7 @@ private val MONTH_EXPAND_THRESHOLD = 48.dp * screen to explain why. [rememberSaveable] carries it across a rotation, which * is as long as it should live. */ -@OptIn(ExperimentalSharedTransitionApi::class, ExperimentalMaterial3ExpressiveApi::class) +@OptIn(ExperimentalSharedTransitionApi::class) @Composable private fun SplitMonthContent( state: MonthUiState, @@ -924,9 +923,7 @@ private fun SplitMonthContent( onEventClick: (EventInstance) -> Unit, onCreateEvent: (LocalDate) -> Unit, ) { - // The fast effects spec, matching the morph's fast spatial one — the page - // slide's default pace made the swap trail behind a gesture already committed. - val fadeSpec = MaterialTheme.motionScheme.fastEffectsSpec() + val fadeSpec = rememberCalendarFadeSpec() val reduceMotion = rememberReduceMotion() var expanded by rememberSaveable { mutableStateOf(false) } // Back collapses before it does anything else. Expanding replaces the whole