Extracted DesktopLayout()
This commit is contained in:
parent
f19a23cbc8
commit
dd95a66acd
|
@ -12,9 +12,7 @@ import androidx.compose.ui.text.TextStyle
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import net.codinux.banking.ui.appskeleton.AppContent
|
import net.codinux.banking.ui.appskeleton.*
|
||||||
import net.codinux.banking.ui.appskeleton.BottomBar
|
|
||||||
import net.codinux.banking.ui.appskeleton.SideMenuContent
|
|
||||||
import net.codinux.banking.ui.config.Colors
|
import net.codinux.banking.ui.config.Colors
|
||||||
import net.codinux.banking.ui.config.DI
|
import net.codinux.banking.ui.config.DI
|
||||||
import net.codinux.log.LoggerFactory
|
import net.codinux.log.LoggerFactory
|
||||||
|
@ -97,21 +95,7 @@ fun App() {
|
||||||
if (isMobile) {
|
if (isMobile) {
|
||||||
AppContent(scaffoldPadding, uiState, uiSettings, snackbarHostState, isMobile)
|
AppContent(scaffoldPadding, uiState, uiSettings, snackbarHostState, isMobile)
|
||||||
} else {
|
} else {
|
||||||
Row(Modifier.fillMaxSize()) {
|
DesktopLayout(scaffoldPadding, uiState, uiSettings, snackbarHostState, desktopDrawerWidth)
|
||||||
Column(Modifier.width(desktopDrawerWidth)) {
|
|
||||||
SideMenuContent()
|
|
||||||
}
|
|
||||||
|
|
||||||
Column(Modifier.fillMaxSize().weight(1f).padding(start = 6.dp)) {
|
|
||||||
Row(Modifier.fillMaxWidth().weight(1f)) {
|
|
||||||
AppContent(scaffoldPadding, uiState, uiSettings, snackbarHostState, isMobile)
|
|
||||||
}
|
|
||||||
|
|
||||||
Row(Modifier.fillMaxWidth()) {
|
|
||||||
BottomBar(false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
package net.codinux.banking.ui.appskeleton
|
||||||
|
|
||||||
|
import androidx.compose.foundation.layout.*
|
||||||
|
import androidx.compose.material.SnackbarHostState
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.unit.Dp
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import net.codinux.banking.ui.settings.UiSettings
|
||||||
|
import net.codinux.banking.ui.state.UiState
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun DesktopLayout(
|
||||||
|
scaffoldPadding: PaddingValues,
|
||||||
|
uiState: UiState,
|
||||||
|
uiSettings: UiSettings,
|
||||||
|
snackbarHostState: SnackbarHostState,
|
||||||
|
desktopDrawerWidth: Dp
|
||||||
|
) {
|
||||||
|
Row(Modifier.fillMaxSize()) {
|
||||||
|
Column(Modifier.width(desktopDrawerWidth)) {
|
||||||
|
SideMenuContent()
|
||||||
|
}
|
||||||
|
|
||||||
|
Column(Modifier.fillMaxSize().weight(1f).padding(start = 6.dp)) {
|
||||||
|
Row(Modifier.fillMaxWidth().weight(1f)) {
|
||||||
|
AppContent(scaffoldPadding, uiState, uiSettings, snackbarHostState, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
Row(Modifier.fillMaxWidth()) {
|
||||||
|
BottomBar(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue