Seção de Avatar, Nome e Biografia
Monte o cabeçalho com imagem e texto.
Seção de Avatar, Nome e Biografia é uma aula grátis de Jetpack Compose Academy no CoddyKit. Esta é a aula 2 de 4. Você pode ler a aula completa abaixo gratuitamente — depois pratica ao vivo no navegador com um editor de código integrado e um tutor de IA 24/7. Faz parte do caminho de aprendizado de Jetpack Compose Academy, e seu progresso é sincronizado entre a web e o app CoddyKit. O curso de Jetpack Compose Academy inclui 4 aulas no total.
Partes desta aula ainda não foram traduzidas e aparecem em inglês.
Build the Header First
Time to make the sketch real. You will start at the top of the card with the header: the avatar, the name, and a short bio. 👤
The Avatar Image
The avatar is an Image Composable that draws a drawable resource. Give it a clear size so it never balloons to fill the screen.
Image(
painter = painterResource(R.drawable.avatar),
contentDescription = "Profile photo"
)Make It a Circle
Profile photos look best as circles. Chain clip with CircleShape on the Image modifier to round it into a perfect avatar.
Image(
painter = painterResource(R.drawable.avatar),
contentDescription = "Profile photo",
modifier = Modifier.size(96.dp).clip(CircleShape)
)Add the Name
Below the avatar comes the display name. A simple Text Composable shows the string the user will read first.
Text(text = "Ada Lovelace")Style the Name
Names should stand out. Pass a style from MaterialTheme typography so the name looks like a proper heading.
Text(
text = "Ada Lovelace",
style = MaterialTheme.typography.titleLarge
)The Bio Text
Under the name, add a one-line bio with another Text. Use a smaller, softer style so it reads as a subtitle, not a headline.
Text(
text = "Building delightful apps.",
style = MaterialTheme.typography.bodyMedium
)Stack Them in a Column
Avatar, name, and bio stack vertically, so wrap all three in a Column. The order you write them is the order they appear.
Column {
Image(/* avatar */)
Text("Ada Lovelace")
Text("Building delightful apps.")
}Center Everything
Headers feel balanced when centered. Set horizontalAlignment to CenterHorizontally on the Column to line up the avatar and text.
Column(
horizontalAlignment = Alignment.CenterHorizontally
) { /* ... */ }Add Vertical Spacing
Cramped headers look messy. Use Arrangement.spacedBy on the Column to drop a consistent gap between the avatar, name, and bio.
Column(
verticalArrangement = Arrangement.spacedBy(8.dp)
) { /* ... */ }Pad the Header
Give the whole section room to breathe by adding padding to the Column modifier. Edges should never touch the screen frame.
Column(
modifier = Modifier.padding(16.dp)
) { /* ... */ }Header Section Done
You now have a clean header: a circular avatar, a bold name, and a soft bio, centered and spaced. The top of your card is finished. 🎉
Quick Check
How do you turn a square photo into a round avatar?
Recap: The Header
You built the header inside a centered Column: a clipped circular avatar, a styled name, and a subtle bio, all padded and spaced. Next you will add the stats row.
Perguntas Frequentes
A aula “Seção de Avatar, Nome e Biografia” é grátis?
Sim — o texto completo de “Seção de Avatar, Nome e Biografia” é grátis para ler aqui na web. Para praticá-la interativamente (um editor de código integrado e um tutor de IA 24/7) e desbloquear o restante do curso de Jetpack Compose Academy, atualize para CoddyKit PRO. O curso de Jetpack Compose Academy inclui 4 aulas no total.
O que vou aprender em “Seção de Avatar, Nome e Biografia”?
Monte o cabeçalho com imagem e texto. Você pratica Jetpack Compose Academy com código prático que executa diretamente no navegador, e um tutor de IA 24/7 responde suas dúvidas enquanto trabalha na aula.
Preciso ter experiência prévia para começar Jetpack Compose Academy?
Nenhuma experiência prévia é necessária. Jetpack Compose Academy no CoddyKit é estruturado para alunos iniciantes até avançados, então você pode começar aqui ou desde o início e aprender no seu ritmo. Esta é a aula 2 de 4.
Quanto tempo leva a aula “Seção de Avatar, Nome e Biografia”?
A maioria das aulas CoddyKit leva cerca de 5–10 minutos. Cada uma é compacta e interativa, então você faz progresso constante e retoma exatamente de onde parou entre web e app.
Posso escrever e executar código nesta aula de Jetpack Compose Academy?
Sim. Cada aula de Jetpack Compose Academy inclui um editor de código integrado, então você escreve e executa código real direto no navegador e recebe feedback de IA instantaneamente — nenhuma configuração local necessária.
Todas as aulas deste curso
- Esboçando o Layout do Cartão de Perfil
- Seção de Avatar, Nome e Biografia
- Linha de Estatísticas e Botão Seguir
- Extraindo Composables Reutilizáveis