diff --git a/app/src/main/java/com/example/helloworld2/MainActivity.kt b/app/src/main/java/com/example/helloworld2/MainActivity.kt index 1f98691..885324b 100644 --- a/app/src/main/java/com/example/helloworld2/MainActivity.kt +++ b/app/src/main/java/com/example/helloworld2/MainActivity.kt @@ -1,5 +1,6 @@ +//NAMA : INDRIS ALPASELA +//NPM : 202310715200 package com.example.helloworld2 - import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent @@ -15,10 +16,12 @@ import androidx.compose.ui.graphics.Brush import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign -import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.example.helloworld2.ui.theme.HelloWorld2Theme +import androidx.compose.foundation.Image +import androidx.compose.ui.draw.clip +import androidx.compose.ui.res.painterResource class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { @@ -39,7 +42,6 @@ class MainActivity : ComponentActivity() { @Composable fun GreetingScreen(name: String) { - // Background gradasi warna Box( modifier = Modifier .fillMaxSize() @@ -50,7 +52,6 @@ fun GreetingScreen(name: String) { ), contentAlignment = Alignment.Center ) { - // Card di tengah Card( modifier = Modifier .padding(20.dp) @@ -66,6 +67,16 @@ fun GreetingScreen(name: String) { .fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally ) { + // 🖼️ Tambah gambar di atas teks + Image( + painter = painterResource(id = R.drawable.profile), + contentDescription = "Profile Picture", + modifier = Modifier + .size(120.dp) + .padding(bottom = 16.dp) + .clip(RoundedCornerShape(60.dp)) + ) + Text( text = "Hello, $name 👋", fontSize = 28.sp, @@ -80,15 +91,20 @@ fun GreetingScreen(name: String) { color = Color.Gray, textAlign = TextAlign.Center ) + Text( + text = "Email : indris.alpasela06@gmail.com", + fontSize = 16.sp, + color = Color.Gray, + textAlign = TextAlign.Center + ) + Text( + text = "No HP : 081219269099", + fontSize = 16.sp, + color = Color.Gray, + textAlign = TextAlign.Center + ) } } } } -@Preview(showBackground = true, showSystemUi = true) -@Composable -fun GreetingPreview() { - HelloWorld2Theme { - GreetingScreen("Android Dev") - } -} diff --git a/app/src/main/res/drawable/profile.jpg b/app/src/main/res/drawable/profile.jpg new file mode 100644 index 0000000..ae509da Binary files /dev/null and b/app/src/main/res/drawable/profile.jpg differ