feat(ui): add version number to start screen
app/build.gradle.kts: - Enabled buildConfig in buildFeatures to expose VERSION_NAME app/src/main/java/de/krisenvorrat/app/MainActivity.kt: - Replaced plain Text greeting with centered Column layout - Shows app title 'Krisenvorrat' (headlineLarge) and version 'v1.0' via BuildConfig.VERSION_NAME (bodyMedium, onSurfaceVariant) Verified: built, deployed to emulator, and confirmed via screenshot.
This commit is contained in:
parent
9ea57f89a5
commit
c818b0d46e
2 changed files with 22 additions and 4 deletions
|
|
@ -39,6 +39,7 @@ android {
|
|||
}
|
||||
buildFeatures {
|
||||
compose = true
|
||||
buildConfig = true
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,11 +4,15 @@ 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.fillMaxSize
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
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 dagger.hilt.android.AndroidEntryPoint
|
||||
|
|
@ -22,10 +26,23 @@ class MainActivity : ComponentActivity() {
|
|||
setContent {
|
||||
KrisenvorratTheme {
|
||||
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
|
||||
Text(
|
||||
text = "Krisenvorrat",
|
||||
modifier = Modifier.padding(innerPadding)
|
||||
)
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(innerPadding),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
verticalArrangement = Arrangement.Center
|
||||
) {
|
||||
Text(
|
||||
text = "Krisenvorrat",
|
||||
style = MaterialTheme.typography.headlineLarge
|
||||
)
|
||||
Text(
|
||||
text = "v${BuildConfig.VERSION_NAME}",
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue