Upload files to "Tugas3"
This commit is contained in:
		
							parent
							
								
									2e3f785662
								
							
						
					
					
						commit
						77301f8a5d
					
				
							
								
								
									
										62
									
								
								Tugas3/MainActivity.kt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										62
									
								
								Tugas3/MainActivity.kt
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,62 @@
 | 
				
			|||||||
 | 
					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)
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										
											BIN
										
									
								
								Tugas3/Screenshot 2025-10-16 123442.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Tugas3/Screenshot 2025-10-16 123442.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 299 KiB  | 
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user