wip
This commit is contained in:
@@ -96,11 +96,15 @@ aboutLibraries {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'androidx.compose.material3:material3:1.4.0'
|
implementation 'androidx.compose.material3:material3:1.4.0'
|
||||||
|
implementation "androidx.compose.material:material:1.9.2"
|
||||||
|
implementation 'androidx.compose.material:material-icons-extended:1.7.8'
|
||||||
implementation 'androidx.navigation:navigation-compose:2.9.5'
|
implementation 'androidx.navigation:navigation-compose:2.9.5'
|
||||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs_nio:2.1.5'
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs_nio:2.1.5'
|
||||||
|
|
||||||
|
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0'
|
||||||
|
|
||||||
implementation 'androidx.preference:preference-ktx:1.2.1'
|
implementation 'androidx.preference:preference-ktx:1.2.1'
|
||||||
implementation 'androidx.compose.ui:ui'
|
implementation 'androidx.compose.ui:ui'
|
||||||
implementation "androidx.compose.material:material:1.9.2"
|
|
||||||
implementation "androidx.activity:activity-ktx:1.11.0"
|
implementation "androidx.activity:activity-ktx:1.11.0"
|
||||||
|
|
||||||
implementation 'androidx.compose.ui:ui-tooling-preview'
|
implementation 'androidx.compose.ui:ui-tooling-preview'
|
||||||
|
@@ -19,13 +19,15 @@ import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
|||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import net.helcel.beans.R
|
import net.helcel.beans.R
|
||||||
import net.helcel.beans.activity.sub.EditPlaceScreen
|
import net.helcel.beans.activity.sub.EditPlaceScreen
|
||||||
import net.helcel.beans.countries.World
|
import net.helcel.beans.countries.World
|
||||||
|
|
||||||
|
@Preview
|
||||||
@Composable
|
@Composable
|
||||||
fun EditScreen(onExit:()->Unit) {
|
fun EditScreen(onExit:()->Unit = {}) {
|
||||||
SysTheme {
|
SysTheme {
|
||||||
Scaffold(
|
Scaffold(
|
||||||
topBar = {
|
topBar = {
|
||||||
|
@@ -18,6 +18,7 @@ import androidx.compose.material.TopAppBar
|
|||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.filled.DateRange
|
import androidx.compose.material.icons.filled.DateRange
|
||||||
import androidx.compose.material.icons.filled.Edit
|
import androidx.compose.material.icons.filled.Edit
|
||||||
|
import androidx.compose.material.icons.filled.Percent
|
||||||
import androidx.compose.material.icons.filled.Settings
|
import androidx.compose.material.icons.filled.Settings
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.remember
|
import androidx.compose.runtime.remember
|
||||||
@@ -82,7 +83,7 @@ class MainScreen : ComponentActivity() {
|
|||||||
Icon(Icons.Default.Edit, contentDescription = "Edit")
|
Icon(Icons.Default.Edit, contentDescription = "Edit")
|
||||||
}
|
}
|
||||||
IconButton(onClick = { nav.navigate("stats") }){
|
IconButton(onClick = { nav.navigate("stats") }){
|
||||||
Icon(Icons.Default.DateRange, contentDescription = "Stats")
|
Icon(Icons.Default.Percent, contentDescription = "Stats")
|
||||||
}
|
}
|
||||||
IconButton(onClick = { nav.navigate("settings") }) {
|
IconButton(onClick = { nav.navigate("settings") }) {
|
||||||
Icon(Icons.Default.Settings, contentDescription = "Settings")
|
Icon(Icons.Default.Settings, contentDescription = "Settings")
|
||||||
|
@@ -118,9 +118,10 @@ fun settingsNav(): NavHostController {
|
|||||||
return navController
|
return navController
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Preview
|
||||||
@Composable
|
@Composable
|
||||||
fun SettingsMainScreen(onExit: ()->Unit = {}) {
|
fun SettingsMainScreen(onExit: ()->Unit = {}) {
|
||||||
var nav: NavHostController? = null
|
val nav: NavHostController = settingsNav()
|
||||||
SysTheme {
|
SysTheme {
|
||||||
Scaffold(
|
Scaffold(
|
||||||
topBar = {
|
topBar = {
|
||||||
@@ -128,7 +129,7 @@ fun SettingsMainScreen(onExit: ()->Unit = {}) {
|
|||||||
title = { Text(stringResource(R.string.action_settings)) },
|
title = { Text(stringResource(R.string.action_settings)) },
|
||||||
navigationIcon = {
|
navigationIcon = {
|
||||||
IconButton(onClick = {
|
IconButton(onClick = {
|
||||||
if(nav!=null && !nav!!.popBackStack())
|
if(!nav.popBackStack())
|
||||||
onExit()
|
onExit()
|
||||||
}) {
|
}) {
|
||||||
Icon(
|
Icon(
|
||||||
@@ -141,13 +142,12 @@ fun SettingsMainScreen(onExit: ()->Unit = {}) {
|
|||||||
}
|
}
|
||||||
) { innerPadding ->
|
) { innerPadding ->
|
||||||
Box(modifier = Modifier.padding(innerPadding)) {
|
Box(modifier = Modifier.padding(innerPadding)) {
|
||||||
nav = settingsNav()
|
SettingsScreen()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Preview
|
|
||||||
@Composable
|
@Composable
|
||||||
fun SettingsScreen(navController: NavHostController = settingsNav()) {
|
fun SettingsScreen(navController: NavHostController = settingsNav()) {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
|
Reference in New Issue
Block a user