wear: dynamic bottom padding - last message clears floating buttons at newest, text flows behind them when scrolled up

This commit is contained in:
callebtc 2026-07-28 21:38:15 +02:00
parent 5e937fa816
commit f64338a3b8
2 changed files with 16 additions and 2 deletions

View File

@ -91,6 +91,14 @@ fun ChatScreen(onOpenPeople: () -> Unit, onOpenTextInput: () -> Unit) {
val buttonsVisible = rememberBottomBarVisibility(scrollState)
val headerExpanded = scrollState.maxValue - scrollState.value > 60
// Full bottom clearance only at the newest message, so the last message sits comfortably
// above the floating buttons; collapses when scrolling up so history flows behind them.
val atNewest = scrollState.maxValue - scrollState.value < 40
val listBottomPadding by androidx.compose.animation.core.animateDpAsState(
targetValue = if (atNewest) 56.dp else 8.dp,
animationSpec = androidx.compose.animation.core.tween(BitchatMotion.STANDARD_MS),
label = "listBottomPad"
)
Column(modifier = Modifier.fillMaxSize()) {
// Sticky header
@ -116,7 +124,7 @@ fun ChatScreen(onOpenPeople: () -> Unit, onOpenTextInput: () -> Unit) {
Column(
modifier = Modifier
.fillMaxWidth()
.padding(bottom = 8.dp)
.padding(bottom = listBottomPadding)
.rotaryScrollable(
RotaryScrollableDefaults.behavior(scrollState),
rotaryFocus

View File

@ -91,6 +91,12 @@ fun DmScreen(peerID: String, onOpenTextInput: () -> Unit) {
val buttonsVisible = rememberBottomBarVisibility(scrollState)
val headerExpanded = scrollState.maxValue - scrollState.value > 60
val atNewest = scrollState.maxValue - scrollState.value < 40
val listBottomPadding by androidx.compose.animation.core.animateDpAsState(
targetValue = if (atNewest) 56.dp else 8.dp,
animationSpec = androidx.compose.animation.core.tween(BitchatMotion.STANDARD_MS),
label = "listBottomPad"
)
val headerIconSize by androidx.compose.animation.core.animateDpAsState(
targetValue = if (headerExpanded) 16.dp else 11.dp,
animationSpec = androidx.compose.animation.core.tween(BitchatMotion.STANDARD_MS),
@ -145,7 +151,7 @@ fun DmScreen(peerID: String, onOpenTextInput: () -> Unit) {
Column(
modifier = Modifier
.fillMaxWidth()
.padding(bottom = 8.dp)
.padding(bottom = listBottomPadding)
.rotaryScrollable(
RotaryScrollableDefaults.behavior(scrollState),
rotaryFocus