commit fc69c07e3044341219f7fb335c68093953318d91 Author: 202310715213 MUHAMMAD FADILLAH <202310715213@mhs.ubharajaya.ac.id> Date: Thu Oct 16 14:03:21 2025 +0700 Upload files to "/" diff --git a/MainActivity.kt b/MainActivity.kt new file mode 100644 index 0000000..8d001a5 --- /dev/null +++ b/MainActivity.kt @@ -0,0 +1,47 @@ +package com.example.helloword + +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.helloword.ui.theme.HelloWordTheme + +class MainActivity : ComponentActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + enableEdgeToEdge() + setContent { + HelloWordTheme { + Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding -> + Greeting( + name = "world", + modifier = Modifier.padding(innerPadding) + ) + } + } + } + } +} + +@Composable +fun Greeting(name: String, modifier: Modifier = Modifier) { + Text( + text = "Hello $name!", + modifier = modifier + ) +} + +@Preview(showBackground = true) +@Composable +fun GreetingPreview() { + HelloWordTheme { + Greeting("Muhammad Fadillah") + } +} \ No newline at end of file