added SettingsActivity

This commit is contained in:
Lorenz Hohermuth 2025-03-19 13:20:07 +01:00
parent 912213e287
commit 0d1e392281
3 changed files with 43 additions and 13 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" >
xmlns:tools="http://schemas.android.com/tools">
<application
android:allowBackup="true"
@ -11,16 +11,17 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Breeze"
tools:targetApi="31" >
tools:targetApi="31">
<activity
android:name=".SettingsActivity"
android:exported="false"
android:label="@string/title_activity_settings" />
android:label="@string/title_activity_settings"
android:theme="@style/Theme.Breeze" />
<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.Breeze" >
android:theme="@style/Theme.Breeze">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

View File

@ -4,13 +4,23 @@ import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material.icons.outlined.Home
import androidx.compose.material.icons.outlined.Map
import androidx.compose.material3.Icon
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.module.breeze.ui.theme.BreezeTheme
class SettingsActivity : ComponentActivity() {
@ -20,8 +30,7 @@ class SettingsActivity : ComponentActivity() {
setContent {
BreezeTheme {
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
Greeting(
name = "Android",
Settings(
modifier = Modifier.padding(innerPadding)
)
}
@ -31,17 +40,37 @@ class SettingsActivity : ComponentActivity() {
}
@Composable
fun Greeting(name: String, modifier: Modifier = Modifier) {
Text(
text = "Hello $name!",
modifier = modifier
fun Settings(modifier: Modifier = Modifier) {
Navigation(iconStyle.Home, "Home Icon")
Column(
modifier = Modifier.fillMaxSize(),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally
)
{
Row(
verticalAlignment = Alignment.CenterVertically
)
{
Icon(
imageVector = iconStyle.Map,
contentDescription = "Configured Locations Icon",
modifier = Modifier.size(40.dp)
)
Text(
text = "Configured Locations",
fontWeight = breezeFontWeight,
fontSize = 22.sp
)
}
}
}
@Preview(showBackground = true)
@Composable
fun GreetingPreview2() {
BreezeTheme {
Greeting("Android")
Settings()
}
}

View File

@ -46,7 +46,7 @@ fun BreezeTheme(
if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
}
darkTheme -> DarkColorScheme
darkTheme -> LightColorScheme
else -> LightColorScheme
}