From f64338a3b8a7907cf9a1f06b8c9438ce3dec6aa5 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Tue, 28 Jul 2026 21:38:15 +0200 Subject: [PATCH] wear: dynamic bottom padding - last message clears floating buttons at newest, text flows behind them when scrolled up --- wear/src/main/java/com/bitchat/watch/ui/ChatScreen.kt | 10 +++++++++- wear/src/main/java/com/bitchat/watch/ui/DmScreen.kt | 8 +++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/wear/src/main/java/com/bitchat/watch/ui/ChatScreen.kt b/wear/src/main/java/com/bitchat/watch/ui/ChatScreen.kt index 18e97b15..b3092125 100644 --- a/wear/src/main/java/com/bitchat/watch/ui/ChatScreen.kt +++ b/wear/src/main/java/com/bitchat/watch/ui/ChatScreen.kt @@ -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 diff --git a/wear/src/main/java/com/bitchat/watch/ui/DmScreen.kt b/wear/src/main/java/com/bitchat/watch/ui/DmScreen.kt index 85e98e72..7d185ad1 100644 --- a/wear/src/main/java/com/bitchat/watch/ui/DmScreen.kt +++ b/wear/src/main/java/com/bitchat/watch/ui/DmScreen.kt @@ -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