Table of Contents

Jetpack Compose Tutorial

Jetpack Compose Tutorial is small Android Jetpack Compose tutorial by Google → good to start

Lesson 1: Composable functions

Lesson 2: Layouts

@Composable
fun MessageCard(msg: Message) {
    Column {
        Text(text = msg.author)
        Text(text = msg.body)
    }
}
@Composable
fun MessageCard(msg: Message) {
    // Add padding around our message
    Row(modifier = Modifier.padding(all = 8.dp)) {
        Image(
            painter = painterResource(R.drawable.profile_picture),
            contentDescription = "Contact profile picture",
            modifier = Modifier
                // Set image size to 40 dp
                .size(40.dp)
                // Clip image to be shaped as a circle
                .clip(CircleShape)
        )
 
        // Add a horizontal space between the image and the column
        Spacer(modifier = Modifier.width(8.dp))
 
        Column {
            Text(text = msg.author)
            // Add a vertical space between the author and message texts
            Spacer(modifier = Modifier.height(4.dp))
            Text(text = msg.body)
        }
    }
}

Lesson 3: Material design

Lesson 4: Lists and animations