63 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			Kotlin
		
	
	
	
	
	
			
		
		
	
	
			63 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			Kotlin
		
	
	
	
	
	
package com.example.kartunama
 | 
						|
 | 
						|
import android.os.Bundle
 | 
						|
import androidx.activity.ComponentActivity
 | 
						|
import androidx.activity.compose.setContent
 | 
						|
import androidx.compose.foundation.background
 | 
						|
import androidx.compose.foundation.layout.*
 | 
						|
import androidx.compose.foundation.shape.RoundedCornerShape
 | 
						|
import androidx.compose.material3.Card
 | 
						|
import androidx.compose.material3.CardDefaults
 | 
						|
import androidx.compose.material3.Text
 | 
						|
import androidx.compose.runtime.Composable
 | 
						|
import androidx.compose.ui.Alignment
 | 
						|
import androidx.compose.ui.Modifier
 | 
						|
import androidx.compose.ui.graphics.Color
 | 
						|
import androidx.compose.ui.text.font.FontWeight
 | 
						|
import androidx.compose.ui.unit.dp
 | 
						|
import androidx.compose.ui.unit.sp
 | 
						|
 | 
						|
class MainActivity : ComponentActivity() {
 | 
						|
    override fun onCreate(savedInstanceState: Bundle?) {
 | 
						|
        super.onCreate(savedInstanceState)
 | 
						|
        setContent {
 | 
						|
            BusinessCard(
 | 
						|
                name = "Fazri Abdurrahman",
 | 
						|
                job = "Android Developer",
 | 
						|
                phone = "+62 812-3456-7890",
 | 
						|
                email = "fazri@example.com"
 | 
						|
            )
 | 
						|
        }
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
@Composable
 | 
						|
fun BusinessCard(name: String, job: String, phone: String, email: String) {
 | 
						|
    Box(
 | 
						|
        modifier = Modifier
 | 
						|
            .fillMaxSize()
 | 
						|
            .background(Color(0xFF388E3C)),
 | 
						|
        contentAlignment = Alignment.Center
 | 
						|
    ) {
 | 
						|
        Card(
 | 
						|
            modifier = Modifier
 | 
						|
                .padding(20.dp)
 | 
						|
                .fillMaxWidth(0.9f),
 | 
						|
            shape = RoundedCornerShape(16.dp),
 | 
						|
            elevation = CardDefaults.cardElevation(defaultElevation = 8.dp),
 | 
						|
            colors = CardDefaults.cardColors(containerColor = Color.White)
 | 
						|
        ) {
 | 
						|
            Column(
 | 
						|
                modifier = Modifier.padding(20.dp),
 | 
						|
                horizontalAlignment = Alignment.CenterHorizontally
 | 
						|
            ) {
 | 
						|
                Text(text = name, fontSize = 26.sp, fontWeight = FontWeight.Bold, color = Color(0xFF0D47A1))
 | 
						|
                Text(text = job, fontSize = 18.sp, color = Color.DarkGray)
 | 
						|
                Spacer(modifier = Modifier.height(16.dp))
 | 
						|
                Text(text = "📞 $phone", fontSize = 16.sp)
 | 
						|
                Text(text = "✉️ $email", fontSize = 16.sp)
 | 
						|
            }
 | 
						|
        }
 | 
						|
    }
 | 
						|
}
 |