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