Fix some insets
This commit is contained in:
parent
1801dc321b
commit
dfe302d5b3
3 changed files with 14 additions and 10 deletions
|
|
@ -80,7 +80,6 @@ fun MessagesScreen(
|
|||
val composerText by composerViewModel.collectAsState(MessageComposerViewState::text)
|
||||
val snackbarHostState = remember { SnackbarHostState() }
|
||||
MessagesScreenContent(
|
||||
|
||||
roomTitle = roomTitle,
|
||||
roomAvatar = roomAvatar,
|
||||
timelineItems = timelineItems().orEmpty(),
|
||||
|
|
@ -159,6 +158,7 @@ fun MessagesScreenContent(
|
|||
) {
|
||||
LogCompositions(tag = "MessagesScreen", msg = "Content")
|
||||
Scaffold(
|
||||
contentWindowInsets = WindowInsets.statusBars,
|
||||
topBar = {
|
||||
MessagesTopAppBar(
|
||||
roomTitle = roomTitle,
|
||||
|
|
@ -212,6 +212,8 @@ fun MessagesContent(
|
|||
Column(
|
||||
modifier = modifier
|
||||
.fillMaxSize()
|
||||
.navigationBarsPadding()
|
||||
.imePadding()
|
||||
) {
|
||||
if (!composerFullScreen) {
|
||||
TimelineItems(
|
||||
|
|
@ -236,7 +238,6 @@ fun MessagesContent(
|
|||
composerText = composerText?.charSequence?.toString(),
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.imePadding()
|
||||
.let {
|
||||
if (composerFullScreen) {
|
||||
it.weight(1f)
|
||||
|
|
|
|||
|
|
@ -3,9 +3,7 @@
|
|||
package io.element.android.x.features.messages.components
|
||||
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.navigationBarsPadding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.material.*
|
||||
|
|
@ -25,12 +23,13 @@ fun TimelineItemActionsScreen(
|
|||
modifier: Modifier = Modifier
|
||||
) {
|
||||
ModalBottomSheetLayout(
|
||||
modifier = modifier.navigationBarsPadding(),
|
||||
modifier = modifier,
|
||||
sheetState = sheetState,
|
||||
sheetContent = {
|
||||
SheetContent(
|
||||
actionsSheetState = actionsSheetState,
|
||||
onActionClicked = onActionClicked
|
||||
onActionClicked = onActionClicked,
|
||||
modifier = Modifier.navigationBarsPadding()
|
||||
)
|
||||
}
|
||||
) {}
|
||||
|
|
@ -41,13 +40,17 @@ fun TimelineItemActionsScreen(
|
|||
private fun SheetContent(
|
||||
actionsSheetState: MessagesItemActionsSheetState?,
|
||||
onActionClicked: (MessagesItemAction) -> Unit,
|
||||
modifier: Modifier = Modifier
|
||||
) {
|
||||
if (actionsSheetState == null || actionsSheetState.actions.isEmpty()) {
|
||||
// Crashes if sheetContent size is zero
|
||||
Box(modifier = Modifier.size(1.dp))
|
||||
Box(modifier = modifier.size(1.dp))
|
||||
return
|
||||
}
|
||||
LazyColumn {
|
||||
LazyColumn(
|
||||
modifier = modifier
|
||||
.fillMaxWidth()
|
||||
) {
|
||||
items(actionsSheetState.actions) {
|
||||
ListItem(
|
||||
modifier = Modifier.clickable {
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ fun OnBoardingContent(
|
|||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.systemBarsPadding()
|
||||
.padding(vertical = 16.dp)
|
||||
) {
|
||||
Column(
|
||||
|
|
@ -113,7 +114,6 @@ fun OnBoardingContent(
|
|||
},
|
||||
enabled = true,
|
||||
modifier = Modifier
|
||||
.navigationBarsPadding()
|
||||
.align(CenterHorizontally)
|
||||
.padding(top = 16.dp)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue