Fixing spacing in the bottom bar for chat screens
This commit is contained in:
+7
-1
@@ -24,6 +24,8 @@ import androidx.compose.foundation.layout.Box
|
|||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.PaddingValues
|
import androidx.compose.foundation.layout.PaddingValues
|
||||||
import androidx.compose.foundation.layout.imePadding
|
import androidx.compose.foundation.layout.imePadding
|
||||||
|
import androidx.compose.foundation.layout.navigationBarsPadding
|
||||||
|
import androidx.compose.foundation.layout.statusBarsPadding
|
||||||
import androidx.compose.material3.HorizontalDivider
|
import androidx.compose.material3.HorizontalDivider
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.Surface
|
import androidx.compose.material3.Surface
|
||||||
@@ -90,12 +92,16 @@ fun DisappearingScaffold(
|
|||||||
// The outer Surface provides the Material container color + onBackground as
|
// The outer Surface provides the Material container color + onBackground as
|
||||||
// LocalContentColor, matching M3 Scaffold's behaviour (without it, default text
|
// LocalContentColor, matching M3 Scaffold's behaviour (without it, default text
|
||||||
// color falls back to Color.Black and is invisible on the dark theme).
|
// color falls back to Color.Black and is invisible on the dark theme).
|
||||||
val rootModifier =
|
val baseModifier =
|
||||||
if (allowBarHide) {
|
if (allowBarHide) {
|
||||||
Modifier.imePadding().nestedScroll(connection)
|
Modifier.imePadding().nestedScroll(connection)
|
||||||
} else {
|
} else {
|
||||||
Modifier.imePadding()
|
Modifier.imePadding()
|
||||||
}
|
}
|
||||||
|
val rootModifier =
|
||||||
|
baseModifier
|
||||||
|
.let { if (topBar == null) it.statusBarsPadding() else it }
|
||||||
|
.let { if (bottomBar == null) it.navigationBarsPadding() else it }
|
||||||
|
|
||||||
Surface(
|
Surface(
|
||||||
modifier = rootModifier,
|
modifier = rootModifier,
|
||||||
|
|||||||
+1
-3
@@ -22,9 +22,7 @@ package com.vitorpamplona.amethyst.ui.screen.loggedIn.chats.marmotGroup
|
|||||||
|
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.consumeWindowInsets
|
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.statusBarsPadding
|
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
||||||
import androidx.compose.material.icons.filled.GroupAdd
|
import androidx.compose.material.icons.filled.GroupAdd
|
||||||
@@ -100,7 +98,7 @@ fun MarmotGroupChatScreen(
|
|||||||
accountViewModel = accountViewModel,
|
accountViewModel = accountViewModel,
|
||||||
allowBarHide = false,
|
allowBarHide = false,
|
||||||
) {
|
) {
|
||||||
Column(Modifier.padding(it).consumeWindowInsets(it).statusBarsPadding()) {
|
Column(Modifier.padding(it)) {
|
||||||
MarmotGroupChatView(
|
MarmotGroupChatView(
|
||||||
nostrGroupId = nostrGroupId,
|
nostrGroupId = nostrGroupId,
|
||||||
accountViewModel = accountViewModel,
|
accountViewModel = accountViewModel,
|
||||||
|
|||||||
+1
-3
@@ -21,9 +21,7 @@
|
|||||||
package com.vitorpamplona.amethyst.ui.screen.loggedIn.chats.privateDM
|
package com.vitorpamplona.amethyst.ui.screen.loggedIn.chats.privateDM
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.consumeWindowInsets
|
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.statusBarsPadding
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.collectAsState
|
import androidx.compose.runtime.collectAsState
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
@@ -84,7 +82,7 @@ fun ChatroomScreen(
|
|||||||
accountViewModel = accountViewModel,
|
accountViewModel = accountViewModel,
|
||||||
allowBarHide = false,
|
allowBarHide = false,
|
||||||
) {
|
) {
|
||||||
Column(Modifier.padding(it).consumeWindowInsets(it).statusBarsPadding()) {
|
Column(Modifier.padding(it)) {
|
||||||
ChatroomView(
|
ChatroomView(
|
||||||
room = roomId,
|
room = roomId,
|
||||||
draftMessage = draftMessage,
|
draftMessage = draftMessage,
|
||||||
|
|||||||
Reference in New Issue
Block a user