Update Progress Final Business Card
This commit is contained in:
		
							parent
							
								
									4ead6bbe1f
								
							
						
					
					
						commit
						c65c9be172
					
				@ -23,6 +23,13 @@ import androidx.compose.ui.Alignment
 | 
			
		||||
import androidx.compose.foundation.Image
 | 
			
		||||
import androidx.compose.foundation.layout.Box
 | 
			
		||||
import androidx.compose.ui.res.painterResource
 | 
			
		||||
import androidx.compose.foundation.layout.Row
 | 
			
		||||
import androidx.compose.foundation.layout.Spacer
 | 
			
		||||
import androidx.compose.foundation.layout.height
 | 
			
		||||
import androidx.compose.foundation.layout.width
 | 
			
		||||
import androidx.compose.foundation.layout.size
 | 
			
		||||
import androidx.compose.ui.text.font.FontWeight
 | 
			
		||||
import androidx.compose.ui.layout.ContentScale
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -32,16 +39,11 @@ class MainActivity : ComponentActivity() {
 | 
			
		||||
        super.onCreate(savedInstanceState)
 | 
			
		||||
        setContent {
 | 
			
		||||
            NameCardTheme {
 | 
			
		||||
                // A surface container using the 'background' color from the theme
 | 
			
		||||
                Surface(
 | 
			
		||||
                    modifier = Modifier.fillMaxSize(),
 | 
			
		||||
                    color = MaterialTheme.colorScheme.background
 | 
			
		||||
                ) {
 | 
			
		||||
                    Greeting(
 | 
			
		||||
                        message = "Happy Birthday Do!",
 | 
			
		||||
                        from = "From Arique",
 | 
			
		||||
                        modifier = Modifier.padding(8.dp)
 | 
			
		||||
                    )
 | 
			
		||||
                    BusinessCard()
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
@ -49,34 +51,94 @@ class MainActivity : ComponentActivity() {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@Composable
 | 
			
		||||
fun Greeting(message: String, from:String, modifier: Modifier = Modifier) {
 | 
			
		||||
    val image = painterResource(R.drawable.oip)
 | 
			
		||||
fun BusinessCard(modifier: Modifier = Modifier) {
 | 
			
		||||
    val image = painterResource(R.drawable.ariq)
 | 
			
		||||
    val background = painterResource(R.drawable.background)
 | 
			
		||||
 | 
			
		||||
    Image(
 | 
			
		||||
        painter = image,
 | 
			
		||||
        painter = background,
 | 
			
		||||
        contentDescription = null,
 | 
			
		||||
        contentScale = ContentScale.Crop,
 | 
			
		||||
        modifier = Modifier.fillMaxSize()
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
    Column(verticalArrangement = Arrangement.Center, modifier = modifier) {
 | 
			
		||||
    Column(
 | 
			
		||||
        modifier = modifier.fillMaxSize(),
 | 
			
		||||
        verticalArrangement = Arrangement.Center,
 | 
			
		||||
        horizontalAlignment = Alignment.CenterHorizontally
 | 
			
		||||
    ) {
 | 
			
		||||
        Image(
 | 
			
		||||
            painter = image,
 | 
			
		||||
            contentDescription = null,
 | 
			
		||||
            modifier = Modifier.size(150.dp)
 | 
			
		||||
        )
 | 
			
		||||
        Spacer(modifier = Modifier.height(16.dp))
 | 
			
		||||
        Text(
 | 
			
		||||
            text = message,
 | 
			
		||||
            fontSize = 100.sp,
 | 
			
		||||
            lineHeight = 116.sp,
 | 
			
		||||
            textAlign = TextAlign.Center
 | 
			
		||||
            text = "Raihan Ariq Muzakki",
 | 
			
		||||
            fontSize = 32.sp,
 | 
			
		||||
            fontWeight = FontWeight.Bold
 | 
			
		||||
        )
 | 
			
		||||
        Text(
 | 
			
		||||
            text = from,
 | 
			
		||||
            fontSize = 36.sp,
 | 
			
		||||
            modifier = Modifier
 | 
			
		||||
                .padding(16.dp)
 | 
			
		||||
                .align(alignment = Alignment.End)
 | 
			
		||||
            text = "Data Scientist",
 | 
			
		||||
            fontSize = 24.sp
 | 
			
		||||
        )
 | 
			
		||||
        Spacer(modifier = Modifier.height(100.dp))
 | 
			
		||||
        ContactInfo()
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@Composable
 | 
			
		||||
fun ContactInfo(modifier: Modifier = Modifier) {
 | 
			
		||||
    val icon_telp = painterResource(R.drawable.telepon)
 | 
			
		||||
    val icon_insta = painterResource(R.drawable.instagram)
 | 
			
		||||
    val icon_mail = painterResource(R.drawable.mail)
 | 
			
		||||
 | 
			
		||||
    Column(modifier = modifier) {
 | 
			
		||||
        Row(verticalAlignment = Alignment.CenterVertically) {
 | 
			
		||||
            Image(
 | 
			
		||||
                painter = icon_telp,
 | 
			
		||||
                contentDescription = null,
 | 
			
		||||
                modifier = Modifier.size(24.dp)
 | 
			
		||||
            )
 | 
			
		||||
            Spacer(modifier = Modifier.width(16.dp))
 | 
			
		||||
            Text(
 | 
			
		||||
                text = "+62 (859) 3024 6632",
 | 
			
		||||
                fontSize = 18.sp
 | 
			
		||||
            )
 | 
			
		||||
        }
 | 
			
		||||
        Spacer(modifier = Modifier.height(8.dp))
 | 
			
		||||
        Row(verticalAlignment = Alignment.CenterVertically) {
 | 
			
		||||
            Image(
 | 
			
		||||
                painter = icon_insta,
 | 
			
		||||
                contentDescription = null,
 | 
			
		||||
                modifier = Modifier.size(24.dp)
 | 
			
		||||
            )
 | 
			
		||||
            Spacer(modifier = Modifier.width(16.dp))
 | 
			
		||||
            Text(
 | 
			
		||||
                text = "@aaarique",
 | 
			
		||||
                fontSize = 18.sp
 | 
			
		||||
            )
 | 
			
		||||
        }
 | 
			
		||||
        Spacer(modifier = Modifier.height(8.dp))
 | 
			
		||||
        Row(verticalAlignment = Alignment.CenterVertically) {
 | 
			
		||||
            Image(
 | 
			
		||||
                painter = icon_mail,
 | 
			
		||||
                contentDescription = null,
 | 
			
		||||
                modifier = Modifier.size(24.dp)
 | 
			
		||||
            )
 | 
			
		||||
            Spacer(modifier = Modifier.width(16.dp))
 | 
			
		||||
            Text(
 | 
			
		||||
                text = "raihanariq-work395@gmail.com",
 | 
			
		||||
                fontSize = 18.sp
 | 
			
		||||
            )
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@Preview(showBackground = true)
 | 
			
		||||
@Composable
 | 
			
		||||
fun GreetingPreview() {
 | 
			
		||||
fun BusinessCardPreview() {
 | 
			
		||||
    NameCardTheme {
 | 
			
		||||
        Greeting("Happy Birthday Dia!", from = "Arique")
 | 
			
		||||
        BusinessCard()
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user