diff --git a/android/app/src/main/java/com/siriusdevops/onionwire/ui/RosterScreen.kt b/android/app/src/main/java/com/siriusdevops/onionwire/ui/RosterScreen.kt index ed641dc..18b8750 100644 --- a/android/app/src/main/java/com/siriusdevops/onionwire/ui/RosterScreen.kt +++ b/android/app/src/main/java/com/siriusdevops/onionwire/ui/RosterScreen.kt @@ -6,7 +6,6 @@ import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height @@ -53,11 +52,6 @@ fun RosterScreen( var confirmWipe by remember { mutableStateOf(false) } Scaffold( - // The content root below consumes systemBars ∪ ime itself (see - // `screenContentInsets`); zeroing the Scaffold's own insets keeps the - // navigation bar from being applied twice and lets the wipe-confirm - // strip sit above the keyboard instead of under it. - contentWindowInsets = WindowInsets(0, 0, 0, 0), topBar = { TopAppBar( title = { Text("OnionWire") }, @@ -70,7 +64,7 @@ fun RosterScreen( ) }, ) { pad -> - Column(Modifier.padding(pad).fillMaxSize().screenContentInsets()) { + Column(Modifier.padding(pad).fillMaxSize()) { Card( modifier = Modifier.fillMaxWidth().padding(horizontal = 12.dp), @@ -140,11 +134,7 @@ fun RosterScreen( ) } } else { - // weight(1f), not fillMaxSize(): the list must yield height to - // its siblings (the action row and the wipe-confirm strip above - // it) when the IME shrinks the window, instead of claiming all - // of it and pushing them off the bottom. - LazyColumn(Modifier.weight(1f).fillMaxWidth()) { + LazyColumn(Modifier.fillMaxSize()) { items(friends, key = { it.pubkeyHex }) { f -> FriendRow(f) { onOpenChat(f) } HorizontalDivider() diff --git a/android/app/src/main/java/com/siriusdevops/onionwire/ui/WalletScreen.kt b/android/app/src/main/java/com/siriusdevops/onionwire/ui/WalletScreen.kt index bc09ec7..0e5d8e8 100644 --- a/android/app/src/main/java/com/siriusdevops/onionwire/ui/WalletScreen.kt +++ b/android/app/src/main/java/com/siriusdevops/onionwire/ui/WalletScreen.kt @@ -9,15 +9,14 @@ import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.aspectRatio import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.items import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.foundation.verticalScroll import androidx.compose.material3.Button import androidx.compose.material3.Card import androidx.compose.material3.CardDefaults @@ -83,11 +82,6 @@ fun WalletScreen( LaunchedEffect(Unit) { reload() } Scaffold( - // The content root below consumes systemBars ∪ ime itself (see - // `screenContentInsets`); zeroing the Scaffold's own insets keeps the - // navigation bar from being applied twice, and keeps the IME inset out - // of the Scaffold's inner padding. - contentWindowInsets = WindowInsets(0, 0, 0, 0), topBar = { TopAppBar( title = { Text("Wallet") }, @@ -101,13 +95,7 @@ fun WalletScreen( }, ) { pad -> Column( - Modifier - .padding(pad) - .fillMaxSize() - // systemBars ∪ ime, applied outside the scrolling viewport so - // the inset does not scroll away with the content. - .screenContentInsets() - .verticalScroll(rememberScrollState()), + Modifier.padding(pad).fillMaxSize(), ) { Card( modifier = Modifier @@ -183,18 +171,19 @@ fun WalletScreen( style = MaterialTheme.typography.titleSmall, modifier = Modifier.padding(horizontal = 12.dp, vertical = 4.dp), ) - // Plain Column, not a LazyColumn: the root is a scrolling - // container now, so a nested lazy list would either throw on the - // unbounded height or need an arbitrary cap. `walletRecentTransfers` - // is bounded (25 rows), and the page scrolls as one gesture. - Column( + LazyColumn( modifier = Modifier .fillMaxWidth() + .weight(1f, fill = false) .padding(horizontal = 12.dp), verticalArrangement = Arrangement.spacedBy(4.dp), ) { - transfers.forEach { t -> TransferCard(t) } + items(transfers, key = { it.txid }) { t -> + TransferCard(t) + } } + } else { + Spacer(Modifier.weight(1f)) } val kind = composer