DocumentScreen: fix position of "Add" button
This commit is contained in:
@@ -64,12 +64,16 @@ fun MyScaffold(
|
|||||||
if (onBack != null) {
|
if (onBack != null) {
|
||||||
BackButton(
|
BackButton(
|
||||||
onBack,
|
onBack,
|
||||||
modifier = Modifier.align(Alignment.TopStart).windowInsetsPadding(WindowInsets.safeDrawing)
|
modifier = Modifier
|
||||||
|
.align(Alignment.TopStart)
|
||||||
|
.windowInsetsPadding(WindowInsets.safeDrawing)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
AboutScreenNavButton(
|
AboutScreenNavButton(
|
||||||
onClick = toAboutScreen,
|
onClick = toAboutScreen,
|
||||||
modifier = Modifier.align(Alignment.TopEnd).windowInsetsPadding(WindowInsets.safeDrawing)
|
modifier = Modifier
|
||||||
|
.align(Alignment.TopEnd)
|
||||||
|
.windowInsetsPadding(WindowInsets.safeDrawing)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -81,21 +85,27 @@ fun DocumentBar(
|
|||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
pageListButton: (@Composable () -> Unit)? = null,
|
pageListButton: (@Composable () -> Unit)? = null,
|
||||||
) {
|
) {
|
||||||
|
val isLandscape = isLandscape(LocalConfiguration.current)
|
||||||
Column (
|
Column (
|
||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
modifier = modifier.background(MaterialTheme.colorScheme.surfaceContainer)
|
modifier = modifier.background(MaterialTheme.colorScheme.surfaceContainer)
|
||||||
) {
|
) {
|
||||||
var modifier: Modifier = Modifier
|
Box (
|
||||||
if (isLandscape(LocalConfiguration.current)) {
|
if (isLandscape)
|
||||||
modifier = modifier.weight(1f).fillMaxWidth()
|
Modifier
|
||||||
}
|
.weight(1f)
|
||||||
Box (modifier) {
|
.fillMaxWidth()
|
||||||
|
else
|
||||||
|
Modifier
|
||||||
|
) {
|
||||||
CommonPageList(pageListState, modifier = Modifier.fillMaxWidth())
|
CommonPageList(pageListState, modifier = Modifier.fillMaxWidth())
|
||||||
|
|
||||||
if (pageListButton != null) {
|
if (pageListButton != null) {
|
||||||
Box (Modifier
|
val alignment = if (isLandscape) Alignment.BottomEnd else Alignment.CenterEnd
|
||||||
.align(Alignment.BottomEnd)
|
Box(
|
||||||
.padding(horizontal = 8.dp, vertical = 16.dp)
|
Modifier
|
||||||
|
.align(alignment)
|
||||||
|
.padding(horizontal = 8.dp, vertical = 16.dp)
|
||||||
) {
|
) {
|
||||||
pageListButton()
|
pageListButton()
|
||||||
}
|
}
|
||||||
@@ -105,7 +115,7 @@ fun DocumentBar(
|
|||||||
BottomAppBar(
|
BottomAppBar(
|
||||||
containerColor = MaterialTheme.colorScheme.surfaceContainerHigh,
|
containerColor = MaterialTheme.colorScheme.surfaceContainerHigh,
|
||||||
) {
|
) {
|
||||||
if (isLandscape(LocalConfiguration.current)) {
|
if (isLandscape) {
|
||||||
Column(
|
Column(
|
||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
modifier = Modifier.fillMaxWidth()
|
modifier = Modifier.fillMaxWidth()
|
||||||
|
|||||||
Reference in New Issue
Block a user