package com.example.appdeployment
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Button
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
class DeploymentActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
MaterialTheme {
Surface(modifier = Modifier.padding(16.dp)) {
DeploymentScreen(onClose = { finish() })
}
}
}
}
}
@Composable
fun DeploymentScreen(onClose: () -> Unit) {
Column {
Text(text = "App Deployment", style = MaterialTheme.typography.headlineMedium)
Spacer(modifier = Modifier.height(16.dp))
Text(text = "1. Makes app available to users")
Text(text = "2. Ensures users get latest features")
Text(text = "3. Fixes bugs and errors")
Text(text = "4. Allows easy updates")
Spacer(modifier = Modifier.height(24.dp))
Button(onClick = onClose) {
Text(text = "Close")
}
}
}This screen uses a simple vertical list to show four clear reasons why deployment is important for delivering apps to users. The title uses a headline style for emphasis. Each reason is a separate text line for clarity. The Close button calls the activity's finish() method to close the screen, mimicking a real app behavior. This teaches how to display information and handle a button click in Android with Kotlin and Jetpack Compose.