mirror of
https://github.com/mollyim/monero-wallet-sdk.git
synced 2025-01-11 23:49:31 -05:00
demo: add title to settings screen
This commit is contained in:
parent
c09e3a7894
commit
979e547346
@ -9,6 +9,7 @@ import androidx.compose.material3.*
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.input.nestedscroll.nestedScroll
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
@ -17,6 +18,7 @@ import androidx.lifecycle.viewmodel.compose.viewModel
|
||||
import im.molly.monero.demo.data.model.RemoteNode
|
||||
import im.molly.monero.demo.data.model.UserSettings
|
||||
import im.molly.monero.demo.data.model.toSocketAddress
|
||||
import im.molly.monero.demo.ui.component.Toolbar
|
||||
import im.molly.monero.demo.ui.theme.AppIcons
|
||||
import im.molly.monero.demo.ui.theme.AppTheme
|
||||
|
||||
@ -39,6 +41,7 @@ fun SettingsRoute(
|
||||
)
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
private fun SettingsScreen(
|
||||
settingsUiState: SettingsUiState,
|
||||
@ -49,14 +52,27 @@ private fun SettingsScreen(
|
||||
onChangeSocksProxy: (String) -> Unit = {},
|
||||
onValidateSocksProxy: (String) -> Boolean = { true },
|
||||
) {
|
||||
val scrollBehavior = TopAppBarDefaults.enterAlwaysScrollBehavior()
|
||||
Scaffold(
|
||||
modifier = Modifier.nestedScroll(scrollBehavior.nestedScrollConnection),
|
||||
topBar = {
|
||||
Toolbar(
|
||||
title = "Settings",
|
||||
scrollBehavior = scrollBehavior,
|
||||
)
|
||||
},
|
||||
) { padding ->
|
||||
Column(
|
||||
modifier = modifier
|
||||
.fillMaxSize()
|
||||
.padding(padding)
|
||||
.verticalScroll(rememberScrollState())
|
||||
) {
|
||||
when (settingsUiState) {
|
||||
SettingsUiState.Loading -> {
|
||||
// TODO: Add loading wheel
|
||||
}
|
||||
|
||||
is SettingsUiState.Success -> {
|
||||
SettingsSection(
|
||||
header = {
|
||||
@ -73,7 +89,7 @@ private fun SettingsScreen(
|
||||
remoteNodes = settingsUiState.remoteNodes,
|
||||
onEditRemoteNode = onEditRemoteNode,
|
||||
onDeleteRemoteNode = onDeleteRemoteNode,
|
||||
modifier = Modifier.padding(start = 24.dp),
|
||||
modifier = Modifier.padding(start = 24.dp, bottom = 16.dp),
|
||||
)
|
||||
SettingsSection(
|
||||
header = {
|
||||
@ -94,6 +110,7 @@ private fun SettingsScreen(
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun SettingsSection(
|
||||
@ -104,7 +121,7 @@ private fun SettingsSection(
|
||||
Column(
|
||||
modifier = modifier.padding(horizontal = 24.dp),
|
||||
) {
|
||||
Divider(Modifier.padding(bottom = 24.dp))
|
||||
HorizontalDivider(Modifier.padding(bottom = 16.dp))
|
||||
Row(
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
|
Loading…
Reference in New Issue
Block a user