Modern Apps git

← Modern-Apps.git

apps: move remaining animations onto the shared motion helpers

Commit
2b47a35c6e4f06530ea98237447c017641fca32d
Author
vayun-mathur <[email protected]>
When
2026-08-31 16:13 UTC (3 months ago)
Parents
2d1fdc2

Diff

camera/src/main/java/com/vayunmathur/camera/ui/CameraScreen.kt
diff --git a/camera/src/main/java/com/vayunmathur/camera/ui/CameraScreen.kt b/camera/src/main/java/com/vayunmathur/camera/ui/CameraScreen.ktindex cbf4493899..20c93c39b7 100644--- a/camera/src/main/java/com/vayunmathur/camera/ui/CameraScreen.kt+++ b/camera/src/main/java/com/vayunmathur/camera/ui/CameraScreen.kt@@ -1,3 +1,6 @@+// RAW ANIMATION EXCEPTION: the panorama capture flash is imperative - an Animatable snapped to+// white as each guide dot is captured and released back to zero, with no declarative target to+// animate towards; the shutter and record-button springs are tuned to this viewfinder's own feel. package com.vayunmathur.camera.ui  import android.content.ClipData@@ -26,11 +29,6 @@ import androidx.camera.core.DynamicRange import androidx.camera.viewfinder.compose.MutableCoordinateTransformer import androidx.camera.viewfinder.core.ImplementationMode import androidx.compose.animation.core.Animatable-import androidx.compose.animation.core.RepeatMode-import androidx.compose.animation.core.animateFloat-import androidx.compose.animation.core.animateFloatAsState-import androidx.compose.animation.core.infiniteRepeatable-import androidx.compose.animation.core.rememberInfiniteTransition import androidx.compose.animation.core.spring import androidx.compose.animation.core.tween import androidx.compose.foundation.Canvas@@ -88,11 +86,13 @@ import com.vayunmathur.library.ui.IconVideoCamera import com.vayunmathur.library.ui.IconSettings import com.vayunmathur.library.ui.IconButton import com.vayunmathur.library.ui.MaterialTheme+import com.vayunmathur.library.ui.Motion import com.vayunmathur.library.ui.Scaffold import com.vayunmathur.library.ui.Slider import com.vayunmathur.library.ui.SliderDefaults import com.vayunmathur.library.ui.Text import com.vayunmathur.library.ui.TextButton+import com.vayunmathur.library.ui.animatedFloat import androidx.compose.runtime.Composable import androidx.compose.runtime.DisposableEffect import androidx.compose.runtime.LaunchedEffect@@ -279,9 +279,9 @@ fun CameraScreen(      // Orientation tracking     var deviceRotation by remember { mutableIntStateOf(0) }-    val animatedRotation by animateFloatAsState(-        targetValue = deviceRotation.toFloat(),-        animationSpec = tween(durationMillis = 300)+    val animatedRotation = animatedFloat(+        target = deviceRotation.toFloat(),+        spec = Motion.over(300)     )      // Tracks physical orientation purely to rotate the on-screen control icons. Capture output@@ -1304,13 +1304,13 @@ private fun ShutterRow(     iconRotation: Float,     flipEnabled: Boolean = true ) {-    val shutterScale by animateFloatAsState(-        targetValue = if (isCapturing) 0.8f else 1f,-        animationSpec = spring(dampingRatio = 0.4f, stiffness = 800f)+    val shutterScale = animatedFloat(+        target = if (isCapturing) 0.8f else 1f,+        spec = spring(dampingRatio = 0.4f, stiffness = 800f)     )-    val recordingCornerRadius by animateFloatAsState(-        targetValue = if (isRecording) 8f else 38f,-        animationSpec = spring(dampingRatio = 0.6f, stiffness = 500f)+    val recordingCornerRadius = animatedFloat(+        target = if (isRecording) 8f else 38f,+        spec = spring(dampingRatio = 0.6f, stiffness = 500f)     )      Row(@@ -1354,9 +1354,9 @@ private fun ShutterRow(             }         } -        val animatedSize by animateFloatAsState(-            targetValue = if (isRecording) 36f else 66f,-            animationSpec = spring(dampingRatio = 0.6f, stiffness = 500f)+        val animatedSize = animatedFloat(+            target = if (isRecording) 36f else 66f,+            spec = spring(dampingRatio = 0.6f, stiffness = 500f)         )         Box(             modifier = Modifier@@ -1590,9 +1590,9 @@ private fun QrResultOverlay(text: String, onDismiss: () -> Unit, context: Contex  @Composable private fun RecordingIndicator(durationSec: Long, modifier: Modifier = Modifier) {-    val dotAlpha by animateFloatAsState(-        targetValue = if ((durationSec % 2) == 0L) 1f else 0.3f,-        animationSpec = tween(500)+    val dotAlpha = animatedFloat(+        target = if ((durationSec % 2) == 0L) 1f else 0.3f,+        spec = Motion.over(500)     )      val minutes = durationSec / 60
clock/src/main/java/com/vayunmathur/clock/ui/ClockScreen.kt
diff --git a/clock/src/main/java/com/vayunmathur/clock/ui/ClockScreen.kt b/clock/src/main/java/com/vayunmathur/clock/ui/ClockScreen.ktindex 4c2c0474c1..986a1b8c7c 100644--- a/clock/src/main/java/com/vayunmathur/clock/ui/ClockScreen.kt+++ b/clock/src/main/java/com/vayunmathur/clock/ui/ClockScreen.kt@@ -1,6 +1,4 @@ package com.vayunmathur.clock.ui--import androidx.compose.animation.core.animateDpAsState import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer@@ -40,6 +38,7 @@ import com.vayunmathur.library.ui.MaterialTheme import com.vayunmathur.library.ui.ReorderableItem import com.vayunmathur.library.ui.Text import com.vayunmathur.library.ui.appBarScrollBehavior+import com.vayunmathur.library.ui.animatedDp import com.vayunmathur.library.ui.draggableHandle import com.vayunmathur.library.ui.rememberReorderableLazyListState import com.vayunmathur.library.util.NavBackStack@@ -106,7 +105,7 @@ fun ClockScreen(             val is24h = state.is24Hour             val amPm = if (is24h) "" else if (timeHere.time.hour >= 12) stringResource(R.string.time_pm) else stringResource(R.string.time_am)             ReorderableItem(reorderState, key = worldClock.city, modifier = Modifier.fillParentMaxWidth().animateItem()) { isDragging ->-                val elevation by animateDpAsState(if (isDragging) 6.dp else 0.dp)+                val elevation = animatedDp(if (isDragging) 6.dp else 0.dp)                 Card(Modifier.fillMaxWidth().shadow(elevation, MaterialTheme.shapes.medium)) {                     ListItem({ Text(worldClock.city) }, trailingContent = {                         Row(verticalAlignment = Alignment.CenterVertically) {
education/src/main/java/com/vayunmathur/education/ui/K2QuizPage.kt
diff --git a/education/src/main/java/com/vayunmathur/education/ui/K2QuizPage.kt b/education/src/main/java/com/vayunmathur/education/ui/K2QuizPage.ktindex 6f0612ea78..06b1441d2f 100644--- a/education/src/main/java/com/vayunmathur/education/ui/K2QuizPage.kt+++ b/education/src/main/java/com/vayunmathur/education/ui/K2QuizPage.kt@@ -1,9 +1,6 @@ package com.vayunmathur.education.ui import com.vayunmathur.education.R -import androidx.compose.animation.AnimatedVisibility-import androidx.compose.animation.fadeIn-import androidx.compose.animation.fadeOut import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement@@ -15,6 +12,7 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import com.vayunmathur.library.ui.AppScaffold+import com.vayunmathur.library.ui.FadeVisibility import com.vayunmathur.library.ui.Card import com.vayunmathur.library.ui.CardDefaults import com.vayunmathur.library.ui.ExperimentalMaterial3Api@@ -184,7 +182,7 @@ fun K2QuizScreen(state: QuizUiState, actions: QuizActions) {                 }             } -            AnimatedVisibility(visible = celebrating, enter = fadeIn(), exit = fadeOut()) {+            FadeVisibility(visible = celebrating) {                 Box(                     Modifier                         .fillMaxSize()
launcher/src/main/java/com/vayunmathur/launcher/ui/DrawerContent.kt
diff --git a/launcher/src/main/java/com/vayunmathur/launcher/ui/DrawerContent.kt b/launcher/src/main/java/com/vayunmathur/launcher/ui/DrawerContent.ktindex ec26d83c59..5140fe67a0 100644--- a/launcher/src/main/java/com/vayunmathur/launcher/ui/DrawerContent.kt+++ b/launcher/src/main/java/com/vayunmathur/launcher/ui/DrawerContent.kt@@ -1,6 +1,5 @@ package com.vayunmathur.launcher.ui -import androidx.compose.animation.core.animateFloatAsState import androidx.activity.compose.BackHandler import androidx.compose.foundation.background import androidx.compose.foundation.clickable
launcher/src/main/java/com/vayunmathur/launcher/ui/HomeContent.kt
diff --git a/launcher/src/main/java/com/vayunmathur/launcher/ui/HomeContent.kt b/launcher/src/main/java/com/vayunmathur/launcher/ui/HomeContent.ktindex 13cb8fcf58..68673ed86e 100644--- a/launcher/src/main/java/com/vayunmathur/launcher/ui/HomeContent.kt+++ b/launcher/src/main/java/com/vayunmathur/launcher/ui/HomeContent.kt@@ -5,7 +5,6 @@ import android.appwidget.AppWidgetProviderInfo import androidx.activity.compose.BackHandler import androidx.compose.animation.core.Animatable import androidx.compose.animation.core.animate-import androidx.compose.animation.core.animateFloatAsState import androidx.compose.foundation.background import androidx.compose.foundation.border import androidx.compose.foundation.clickable@@ -102,6 +101,7 @@ import com.vayunmathur.library.ui.MaterialTheme import com.vayunmathur.library.ui.ModalBottomSheet import com.vayunmathur.library.ui.Motion import com.vayunmathur.library.ui.Spacing+import com.vayunmathur.library.ui.animatedFloat import com.vayunmathur.library.ui.scrim import kotlinx.coroutines.launch @@ -839,10 +839,9 @@ private fun WorkspaceCell(     val beingDragged = drag.payload?.itemId == item.id     // Animated, and held dimmed for the whole settle: the drag layer is still flying towards this     // cell, and two solid copies of one icon is the artefact that would replace the jump.-    val dim by animateFloatAsState(-        targetValue = if (beingDragged) LauncherTuning.DraggedAlpha else 1f,-        animationSpec = Motion.reorder(),-        label = "cellDim",+    val dim = animatedFloat(+        if (beingDragged) LauncherTuning.DraggedAlpha else 1f,+        Motion.reorder(),     )      Box(@@ -1012,10 +1011,9 @@ private fun HotseatCell( ) {     val drag = LocalLauncherDrag.current     var bounds by remember { mutableStateOf(Rect.Zero) }-    val dim by animateFloatAsState(-        targetValue = if (drag.payload?.itemId == item.id) LauncherTuning.DraggedAlpha else 1f,-        animationSpec = Motion.reorder(),-        label = "hotseatDim",+    val dim = animatedFloat(+        if (drag.payload?.itemId == item.id) LauncherTuning.DraggedAlpha else 1f,+        Motion.reorder(),     )     Box(         modifier = Modifier
launcher/src/main/java/com/vayunmathur/launcher/ui/components/DropBar.kt
diff --git a/launcher/src/main/java/com/vayunmathur/launcher/ui/components/DropBar.kt b/launcher/src/main/java/com/vayunmathur/launcher/ui/components/DropBar.ktindex 737c21f85f..d9bba03690 100644--- a/launcher/src/main/java/com/vayunmathur/launcher/ui/components/DropBar.kt+++ b/launcher/src/main/java/com/vayunmathur/launcher/ui/components/DropBar.kt@@ -1,6 +1,5 @@ package com.vayunmathur.launcher.ui.components -import androidx.compose.animation.AnimatedVisibility import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.RowScope@@ -20,6 +19,7 @@ import androidx.compose.ui.geometry.Rect import androidx.compose.ui.unit.dp import com.vayunmathur.launcher.domain.DropBarSecondary import com.vayunmathur.launcher.domain.DropBarTargets+import com.vayunmathur.library.ui.ExpandVisibility import com.vayunmathur.library.ui.IconDelete import com.vayunmathur.library.ui.IconInfo import com.vayunmathur.library.ui.IconUninstall@@ -44,7 +44,7 @@ fun DropBar(     onAppInfo: (Long) -> Unit,     modifier: Modifier = Modifier, ) {-    AnimatedVisibility(visible = controller.isDragging, modifier = modifier) {+    ExpandVisibility(visible = controller.isDragging, modifier = modifier) {         val payload = controller.payload         val secondary = payload?.let {             // An app straight out of the drawer was never on the workspace, so nothing about it can
maps/src/main/java/com/vayunmathur/maps/ui/map/WaypointList.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/map/WaypointList.kt b/maps/src/main/java/com/vayunmathur/maps/ui/map/WaypointList.ktindex 2acd41c43a..2717c6bf3c 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/map/WaypointList.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/map/WaypointList.kt@@ -1,6 +1,4 @@ package com.vayunmathur.maps.ui.map--import androidx.compose.animation.core.animateDpAsState import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth@@ -27,6 +25,7 @@ import com.vayunmathur.library.ui.Text import com.vayunmathur.library.ui.draggableHandle import com.vayunmathur.library.ui.rememberReorderableLazyListState import com.vayunmathur.library.ui.verticalShape+import com.vayunmathur.library.ui.animatedDp import com.vayunmathur.maps.data.SpecificFeature import com.vayunmathur.maps.ui.theme.MapChromeMetrics import com.vayunmathur.maps.R as MapsR@@ -67,7 +66,7 @@ fun WaypointList(         ) { index, waypoint ->             val key = waypoint?.position?.toString() ?: ""             ReorderableItem(reorderState = reorderState, key = key) { isDragging ->-                val elevation by animateDpAsState(if (isDragging) 4.dp else 0.dp)+                val elevation = animatedDp(if (isDragging) 4.dp else 0.dp)                 Card(                     shape = verticalShape(index, route.waypoints.size),                     elevation = CardDefaults.cardElevation(elevation),
office/src/main/java/com/vayunmathur/office/MainActivity.kt
diff --git a/office/src/main/java/com/vayunmathur/office/MainActivity.kt b/office/src/main/java/com/vayunmathur/office/MainActivity.ktindex f1b55e5cd6..f44a0272a9 100644--- a/office/src/main/java/com/vayunmathur/office/MainActivity.kt+++ b/office/src/main/java/com/vayunmathur/office/MainActivity.kt@@ -27,7 +27,6 @@ import androidx.activity.compose.setContent import androidx.activity.enableEdgeToEdge import androidx.activity.result.contract.ActivityResultContracts import androidx.activity.viewModels-import androidx.compose.animation.AnimatedVisibility import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.horizontalScroll@@ -49,6 +48,7 @@ import androidx.compose.foundation.lazy.items import androidx.compose.foundation.lazy.rememberLazyListState import androidx.compose.foundation.shape.RoundedCornerShape import com.vayunmathur.library.ui.AlertDialog+import com.vayunmathur.library.ui.ExpandVisibility import com.vayunmathur.library.ui.AppScaffold import com.vayunmathur.library.ui.Button import com.vayunmathur.library.ui.CircularProgressIndicator@@ -1096,7 +1096,7 @@ fun DocumentScreen(document: OdfDocument, viewModel: OfficeViewModel, activity:                             }                         }                     }-                    AnimatedVisibility(visible = showTimer && isPresentation) {+                    ExpandVisibility(visible = showTimer && isPresentation) {                         Surface(color = MaterialTheme.colorScheme.secondaryContainer) {                             Row(Modifier.fillMaxWidth().padding(horizontal = 16.dp, vertical = 4.dp), verticalAlignment = Alignment.CenterVertically) {                                 Text("⏱ %02d:%02d".format(timerSeconds / 60, timerSeconds % 60), style = MaterialTheme.typography.titleMedium, color = MaterialTheme.colorScheme.onSecondaryContainer)@@ -1106,7 +1106,7 @@ fun DocumentScreen(document: OdfDocument, viewModel: OfficeViewModel, activity:                             }                         }                     }-                    AnimatedVisibility(visible = showSearch) {+                    ExpandVisibility(visible = showSearch) {                         Column {                             TextField(value = searchQuery, onValueChange = { searchQuery = it }, placeholder = { Text(stringResource(R.string.search_hint)) }, singleLine = true,                                 modifier = Modifier.fillMaxWidth().padding(horizontal = 16.dp, vertical = 4.dp),@@ -1132,7 +1132,7 @@ fun DocumentScreen(document: OdfDocument, viewModel: OfficeViewModel, activity:                                     Text(if (total > 0) "${(findIndex % total) + 1}/$total" else "0/0", style = MaterialTheme.typography.labelMedium)                                 }                             }-                            AnimatedVisibility(visible = showReplaceBar && searchQuery.isNotEmpty()) {+                            ExpandVisibility(visible = showReplaceBar && searchQuery.isNotEmpty()) {                                 Column {                                     Row(Modifier.fillMaxWidth().padding(horizontal = 16.dp, vertical = 2.dp), verticalAlignment = Alignment.CenterVertically) {                                         TextField(value = replaceText, onValueChange = { replaceText = it }, placeholder = { Text(stringResource(R.string.replace_hint)) }, singleLine = true, modifier = Modifier.weight(1f),@@ -1148,7 +1148,7 @@ fun DocumentScreen(document: OdfDocument, viewModel: OfficeViewModel, activity:                             }                         }                     }-                    AnimatedVisibility(visible = showFontControl) {+                    ExpandVisibility(visible = showFontControl) {                         Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.padding(horizontal = 16.dp, vertical = 4.dp)) {                             Text("A", style = MaterialTheme.typography.bodySmall)                             Slider(value = fontSizeMultiplier, onValueChange = { fontSizeMultiplier = it }, valueRange = 0.5f..2.0f, modifier = Modifier.weight(1f).padding(horizontal = 8.dp))@@ -1157,7 +1157,7 @@ fun DocumentScreen(document: OdfDocument, viewModel: OfficeViewModel, activity:                             TextButton(onClick = { fontSizeMultiplier = 1f }) { Text(stringResource(R.string.reset)) }                         }                     }-                    AnimatedVisibility(visible = showWordBar && isTextDoc) {+                    ExpandVisibility(visible = showWordBar && isTextDoc) {                         Surface(color = MaterialTheme.colorScheme.surfaceVariant) {                             Text(stringResource(R.string.words_characters_min_read, wordCount, charCount, readingTime),                                 style = MaterialTheme.typography.labelMedium,
office/src/main/java/com/vayunmathur/office/ui/DocumentViews.kt
diff --git a/office/src/main/java/com/vayunmathur/office/ui/DocumentViews.kt b/office/src/main/java/com/vayunmathur/office/ui/DocumentViews.ktindex 3a20b89926..d375b03c78 100644--- a/office/src/main/java/com/vayunmathur/office/ui/DocumentViews.kt+++ b/office/src/main/java/com/vayunmathur/office/ui/DocumentViews.kt@@ -2,7 +2,6 @@ package com.vayunmathur.office.ui  import android.content.Intent import android.graphics.BitmapFactory-import androidx.compose.animation.AnimatedVisibility import androidx.compose.foundation.Canvas import androidx.compose.foundation.Image import androidx.compose.foundation.background@@ -42,6 +41,7 @@ import androidx.compose.foundation.text.KeyboardActions import androidx.compose.foundation.text.KeyboardOptions import com.vayunmathur.library.ui.R as UiR import com.vayunmathur.library.ui.AlertDialog+import com.vayunmathur.library.ui.ExpandVisibility import com.vayunmathur.library.ui.Card import com.vayunmathur.library.ui.CardDefaults import com.vayunmathur.library.ui.HorizontalDivider@@ -799,7 +799,7 @@ fun ParagraphView(paragraph: OdfParagraph, searchQuery: String = "", fontSizeMul                     expandedAnnotation = if (expandedAnnotation == a.item) null else a.item                 }             })-            AnimatedVisibility(visible = expandedAnnotation != null) { expandedAnnotation?.let { AnnotationPopup(it) } }+            ExpandVisibility(visible = expandedAnnotation != null) { expandedAnnotation?.let { AnnotationPopup(it) } }         }     } else Text(text = annotatedString, style = scaledStyle, modifier = modifier) }
photos/src/main/java/com/vayunmathur/photos/ui/OcrTextLayer.kt
diff --git a/photos/src/main/java/com/vayunmathur/photos/ui/OcrTextLayer.kt b/photos/src/main/java/com/vayunmathur/photos/ui/OcrTextLayer.ktindex 95dd8660a3..e415ee2051 100644--- a/photos/src/main/java/com/vayunmathur/photos/ui/OcrTextLayer.kt+++ b/photos/src/main/java/com/vayunmathur/photos/ui/OcrTextLayer.kt@@ -1,8 +1,6 @@ package com.vayunmathur.photos.ui -import androidx.compose.animation.AnimatedVisibility-import androidx.compose.animation.fadeIn-import androidx.compose.animation.fadeOut+import com.vayunmathur.library.ui.FadeVisibility import androidx.compose.foundation.Canvas import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxSize@@ -114,7 +112,7 @@ fun OcrTextLayer(     Box(modifier = modifier) {         // Both of these sit under the selectable text in z-order so they can never         // intercept a touch (a Canvas takes no pointer input either way).-        AnimatedVisibility(visible = dimImage, enter = fadeIn(), exit = fadeOut()) {+        FadeVisibility(visible = dimImage) {             Canvas(modifier = Modifier.fillMaxSize()) {                 drawRect(color = Color.Black.copy(alpha = 0.4f))             }@@ -122,7 +120,7 @@ fun OcrTextLayer(          // Shown with the metadata card, and whenever text is being selected, which         // makes the feature discoverable without adding a control.-        AnimatedVisibility(visible = showOutlines || dimImage, enter = fadeIn(), exit = fadeOut()) {+        FadeVisibility(visible = showOutlines || dimImage) {             Canvas(modifier = Modifier.fillMaxSize()) {                 // The whole layer is inside the image's zoom transform, so the                 // strokes are pre-divided by it to stay a constant thickness
photos/src/main/java/com/vayunmathur/photos/ui/PhotoPage.kt
diff --git a/photos/src/main/java/com/vayunmathur/photos/ui/PhotoPage.kt b/photos/src/main/java/com/vayunmathur/photos/ui/PhotoPage.ktindex 58e2c66d8f..50c38d1a4f 100644--- a/photos/src/main/java/com/vayunmathur/photos/ui/PhotoPage.kt+++ b/photos/src/main/java/com/vayunmathur/photos/ui/PhotoPage.kt@@ -1,6 +1,7 @@ package com.vayunmathur.photos.ui  import com.vayunmathur.library.ui.ExternalIntents+import com.vayunmathur.library.ui.FadeVisibility import com.vayunmathur.library.ui.R as UiR import com.vayunmathur.library.ui.DateString import android.app.Activity@@ -13,9 +14,6 @@ import androidx.activity.compose.rememberLauncherForActivityResult import androidx.activity.result.IntentSenderRequest import androidx.activity.result.contract.ActivityResultContracts import androidx.annotation.OptIn-import androidx.compose.animation.AnimatedVisibility-import androidx.compose.animation.fadeIn-import androidx.compose.animation.fadeOut import androidx.compose.foundation.background import androidx.compose.foundation.gestures.awaitEachGesture import androidx.compose.foundation.gestures.awaitFirstDown@@ -569,10 +567,8 @@ fun PhotoDetailView(         // composed while the chrome is hidden, or its tap targets would swallow         // the single tap that brings the chrome back.         faceBoxes?.takeIf { isSettled && size != IntSize.Zero }?.let { boxes ->-            AnimatedVisibility(+            FadeVisibility(                     visible = isMetadataVisible,-                    enter = fadeIn(),-                    exit = fadeOut(),                     modifier = Modifier.fillMaxSize().then(zoomModifier)             ) {                 FaceBoxLayer(@@ -585,10 +581,8 @@ fun PhotoDetailView(             }         } -        AnimatedVisibility(+        FadeVisibility(                 visible = isMetadataVisible,-                enter = fadeIn(),-                exit = fadeOut(),                 modifier = Modifier.align(Alignment.BottomStart)         ) {             Column(@@ -678,10 +672,8 @@ fun PhotoDetailView(         }          if (isPanorama) {-            AnimatedVisibility(+            FadeVisibility(                     visible = isMetadataVisible,-                    enter = fadeIn(),-                    exit = fadeOut(),                     modifier = Modifier.align(Alignment.TopEnd).padding(16.dp)             ) {                 FilledTonalButton(onClick = { showImmersive = true }) {@@ -798,7 +790,7 @@ fun VideoPlayer(         }          // Play/Pause Overlay-        AnimatedVisibility(visible = isMetadataVisible, enter = fadeIn(), exit = fadeOut()) {+        FadeVisibility(visible = isMetadataVisible) {             IconButton(onClick = { if (isPlaying) exoPlayer.pause() else exoPlayer.play() }) {                 if (isPlaying) IconPause(                         modifier = Modifier.size(64.dp),@@ -813,10 +805,8 @@ fun VideoPlayer(         // Seek bar overlay, shares the metadata-visible gate with the play/pause button.         // Anchored to the top so it never sits under the centered play/pause control or         // the bottom metadata/button card, both of which are drawn over the video.-        AnimatedVisibility(+        FadeVisibility(                 visible = isMetadataVisible && durationMs > 0,-                enter = fadeIn(),-                exit = fadeOut(),                 modifier = Modifier.align(Alignment.TopCenter)         ) {             val sliderValue =
weather/src/main/java/com/vayunmathur/weather/ui/HomePage.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/ui/HomePage.kt b/weather/src/main/java/com/vayunmathur/weather/ui/HomePage.ktindex 0485e4930a..398520dabb 100644--- a/weather/src/main/java/com/vayunmathur/weather/ui/HomePage.kt+++ b/weather/src/main/java/com/vayunmathur/weather/ui/HomePage.kt@@ -1,11 +1,8 @@ package com.vayunmathur.weather.ui  import androidx.activity.compose.BackHandler-import androidx.compose.animation.AnimatedVisibility-import androidx.compose.animation.expandVertically-import androidx.compose.animation.fadeIn-import androidx.compose.animation.fadeOut-import androidx.compose.animation.shrinkVertically+import com.vayunmathur.library.ui.AppScaffold+import com.vayunmathur.library.ui.ExpandVisibility import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column@@ -279,11 +276,7 @@ private fun ForecastColumn(              var lastSelection by remember { mutableStateOf(selected) }             LaunchedEffect(selected) { if (selected != null) lastSelection = selected }-            AnimatedVisibility(-                visible = selected != null,-                enter = expandVertically() + fadeIn(),-                exit = shrinkVertically() + fadeOut(),-            ) {+            ExpandVisibility(visible = selected != null) {                 (selected ?: lastSelection)?.let { sel ->                     SelectedDateTimeHeader(                         selection = sel,
weather/src/main/java/com/vayunmathur/weather/ui/LocationsScreen.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/ui/LocationsScreen.kt b/weather/src/main/java/com/vayunmathur/weather/ui/LocationsScreen.ktindex 4e89cbba90..59edf2ad7f 100644--- a/weather/src/main/java/com/vayunmathur/weather/ui/LocationsScreen.kt+++ b/weather/src/main/java/com/vayunmathur/weather/ui/LocationsScreen.kt@@ -9,7 +9,6 @@ import android.provider.Settings import androidx.activity.compose.rememberLauncherForActivityResult import androidx.activity.result.contract.ActivityResultContracts import androidx.compose.foundation.clickable-import androidx.compose.animation.core.animateDpAsState import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column@@ -90,6 +89,7 @@ import com.vayunmathur.library.ui.ReorderableItem import com.vayunmathur.library.ui.draggableHandle import com.vayunmathur.library.ui.rememberReorderableLazyListState import com.vayunmathur.library.ui.appBarScrollBehavior+import com.vayunmathur.library.ui.animatedDp  /**  * Composable helper that provides a device-location request action with@@ -305,7 +305,7 @@ fun LocationsScreen(         itemsIndexed(localData, key = { _, item -> item.location.id }) { idx, row ->             val loc = row.location             ReorderableItem(reorderState, key = loc.id) { isDragging ->-                val elevation by animateDpAsState(if (isDragging) 6.dp else 0.dp)+                val elevation = animatedDp(if (isDragging) 6.dp else 0.dp)                 LocationItem(                     location = loc,                     description = row.description,