added SettingsActivity
This commit is contained in:
parent
912213e287
commit
0d1e392281
|
@ -15,7 +15,8 @@
|
|||
<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"
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ fun BreezeTheme(
|
|||
if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
|
||||
}
|
||||
|
||||
darkTheme -> DarkColorScheme
|
||||
darkTheme -> LightColorScheme
|
||||
else -> LightColorScheme
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue