Upload files to "Tugas-3_KartuNama"
This commit is contained in:
		
							parent
							
								
									777f9620f2
								
							
						
					
					
						commit
						e89068c4b5
					
				
							
								
								
									
										62
									
								
								Tugas-3_KartuNama/MainActivity.kt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										62
									
								
								Tugas-3_KartuNama/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 = "Yosep Gamaliel Mulia",
 | 
			
		||||
                job = "Student",
 | 
			
		||||
                phone = "+62 85172189686",
 | 
			
		||||
                email = "202310715105@mhs.ubharajaya.ac.id"
 | 
			
		||||
            )
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@Composable
 | 
			
		||||
fun BusinessCard(name: String, job: String, phone: String, email: String) {
 | 
			
		||||
    Box(
 | 
			
		||||
        modifier = Modifier
 | 
			
		||||
            .fillMaxSize()
 | 
			
		||||
            .background(Color(0xFF0D47A1)),
 | 
			
		||||
        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
										
									
								
								Tugas-3_KartuNama/Tugas-3_KartuNama.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Tugas-3_KartuNama/Tugas-3_KartuNama.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 283 KiB  | 
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user