Add an animation to user node list items to animate on details expansion (#1590)

This commit is contained in:
Joshua Soberg 2025-02-16 15:37:49 -05:00 committed by GitHub
parent 8ddd553753
commit 5430169830
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View file

@ -79,6 +79,7 @@ fun NodeItem(
gpsFormat: Int,
distanceUnits: Int,
tempInFahrenheit: Boolean,
modifier: Modifier = Modifier,
onAction: (NodeMenuAction) -> Unit = {},
expanded: Boolean = false,
currentTimeMillis: Long,
@ -114,7 +115,7 @@ fun NodeItem(
val (detailsShown, showDetails) = remember { mutableStateOf(expanded) }
Card(
modifier = Modifier
modifier = modifier
.fillMaxWidth()
.padding(horizontal = 8.dp, vertical = 4.dp)
.defaultMinSize(minHeight = 80.dp),

View file

@ -21,6 +21,7 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.compose.animation.animateContentSize
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.fillMaxSize
@ -130,6 +131,7 @@ fun NodesScreen(
items(nodes, key = { it.num }) { node ->
NodeItem(
modifier = Modifier.animateContentSize(),
thisNode = ourNode,
thatNode = node,
gpsFormat = state.gpsFormat,