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.Image
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.ui.res.painterResource
|
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)
|
super.onCreate(savedInstanceState)
|
||||||
setContent {
|
setContent {
|
||||||
NameCardTheme {
|
NameCardTheme {
|
||||||
// A surface container using the 'background' color from the theme
|
|
||||||
Surface(
|
Surface(
|
||||||
modifier = Modifier.fillMaxSize(),
|
modifier = Modifier.fillMaxSize(),
|
||||||
color = MaterialTheme.colorScheme.background
|
color = MaterialTheme.colorScheme.background
|
||||||
) {
|
) {
|
||||||
Greeting(
|
BusinessCard()
|
||||||
message = "Happy Birthday Do!",
|
|
||||||
from = "From Arique",
|
|
||||||
modifier = Modifier.padding(8.dp)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -49,34 +51,94 @@ class MainActivity : ComponentActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun Greeting(message: String, from:String, modifier: Modifier = Modifier) {
|
fun BusinessCard(modifier: Modifier = Modifier) {
|
||||||
val image = painterResource(R.drawable.oip)
|
val image = painterResource(R.drawable.ariq)
|
||||||
|
val background = painterResource(R.drawable.background)
|
||||||
|
|
||||||
Image(
|
Image(
|
||||||
painter = image,
|
painter = background,
|
||||||
contentDescription = null,
|
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(
|
||||||
text = message,
|
text = "Raihan Ariq Muzakki",
|
||||||
fontSize = 100.sp,
|
fontSize = 32.sp,
|
||||||
lineHeight = 116.sp,
|
fontWeight = FontWeight.Bold
|
||||||
textAlign = TextAlign.Center
|
|
||||||
)
|
)
|
||||||
Text(
|
Text(
|
||||||
text = from,
|
text = "Data Scientist",
|
||||||
fontSize = 36.sp,
|
fontSize = 24.sp
|
||||||
modifier = Modifier
|
|
||||||
.padding(16.dp)
|
|
||||||
.align(alignment = Alignment.End)
|
|
||||||
)
|
)
|
||||||
|
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)
|
@Preview(showBackground = true)
|
||||||
@Composable
|
@Composable
|
||||||
fun GreetingPreview() {
|
fun BusinessCardPreview() {
|
||||||
NameCardTheme {
|
NameCardTheme {
|
||||||
Greeting("Happy Birthday Dia!", from = "Arique")
|
BusinessCard()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user