commit 73c2e21b30f7445581643d0768ac6fb5f9a19842 Author: 202310715200 INDRIS ALPASELA <202310715200@mhs.ubharajaya.ac.id> Date: Thu Sep 25 12:04:26 2025 +0700 Upload files to "/" TUGAS 1-ANDROID STUDIO- PEMROGRAMAN PERANGKAT BERGERAK-INDRIS ALPASELA diff --git a/MainActivity.kt b/MainActivity.kt new file mode 100644 index 0000000..0eb6e95 --- /dev/null +++ b/MainActivity.kt @@ -0,0 +1,47 @@ +package com.example.tugas1 + +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import androidx.activity.enableEdgeToEdge +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.padding +import androidx.compose.material3.Scaffold +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview +import com.example.tugas1.ui.theme.Tugas1Theme + +class MainActivity : ComponentActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + enableEdgeToEdge() + setContent { + Tugas1Theme { + Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding -> + Greeting( + name = "Android", + modifier = Modifier.padding(innerPadding) + ) + } + } + } + } +} + +@Composable +fun Greeting(name: String, modifier: Modifier = Modifier) { + Text( + text = "Hello $name!", + modifier = modifier + ) +} + +@Preview(showBackground = true) +@Composable +fun GreetingPreview() { + Tugas1Theme { + Greeting("Indris ") + } +} \ No newline at end of file