I’m learning jetpack compose and i’m at level 0 only ig. Here, i put fun’Description’ & ‘Contact’ under a column. Description contains the (Full Name,title,image) & Contact contains (no.,mail,id).
I need to put space between these as shown in image.
enter image description here
Help me to use some modifier element for that purpose other than what i have used i.e padding separately for Description and Contacts.
@Composable
fun Card(name: String,role : String, modifier: Modifier = Modifier) {
Column(
verticalArrangement = Arrangement.Center
) {
Description(name = name, role = role)
Contact(modifier= Modifier)
}
}
@Composable
fun Description(name :String, role :String,modifier: Modifier=Modifier) {
val image = painterResource(R.drawable.android_logo_0)
Column(
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally,
modifier= Modifier.padding(
top = 100.dp
)
) {
Image(
painter = image,
contentDescription = null
)
Text(
text = name,
fontWeight = FontWeight.ExtraBold,
fontSize = 40.sp
)
Text(
text = role,
fontSize = 20.sp,
color = Color(0xFF155115)
)
}
}
@Composable
fun Contact( modifier: Modifier = Modifier){
Column(
modifier= Modifier.padding(
bottom = 0.dp,
top = 210.dp,
start = 70.dp
)
)
{
ContactCard(name = "[email protected]", icon = R.drawable.baseline_email_black_24dp,modifier= Modifier)
ContactCard(name = "abc", icon = R.drawable.circle_linkedin_512,modifier= Modifier)
ContactCard(name = "123456", icon = R.drawable.baseline_call_black_24dp,modifier= Modifier)
}
}
New contributor
Priyanshu Raj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.