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

View File

@ -4,13 +4,23 @@ import android.os.Bundle
import androidx.activity.ComponentActivity import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge 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.fillMaxSize
import androidx.compose.foundation.layout.padding 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.Scaffold
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview 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 import com.module.breeze.ui.theme.BreezeTheme
class SettingsActivity : ComponentActivity() { class SettingsActivity : ComponentActivity() {
@ -20,8 +30,7 @@ class SettingsActivity : ComponentActivity() {
setContent { setContent {
BreezeTheme { BreezeTheme {
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding -> Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
Greeting( Settings(
name = "Android",
modifier = Modifier.padding(innerPadding) modifier = Modifier.padding(innerPadding)
) )
} }
@ -31,17 +40,37 @@ class SettingsActivity : ComponentActivity() {
} }
@Composable @Composable
fun Greeting(name: String, modifier: Modifier = Modifier) { fun Settings(modifier: Modifier = Modifier) {
Text( Navigation(iconStyle.Home, "Home Icon")
text = "Hello $name!", Column(
modifier = modifier 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) @Preview(showBackground = true)
@Composable @Composable
fun GreetingPreview2() { fun GreetingPreview2() {
BreezeTheme { BreezeTheme {
Greeting("Android") Settings()
} }
} }

View File

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