Jetpack Compose: Getting Started

Aug 1 2023 · Kotlin 1.8.10, Android 13, Android Studio Flamingo

Part 2: Layout Your App

09. Organize Your Code

Episode complete

Play next episode

About this episode
Leave a rating/review
See forum comments
Cinema mode Mark complete Download course materials
Previous episode: 08. Add Spacers Next episode: 10. Challenge: Add a TextField

Get immediate access to this and 4,000+ other videos and books.

Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and 4,000+ professional videos in a single subscription, it's simply the best investment you can make in your development career.

Learn more Already a subscriber? Sign in.

Heads up... You've reached locked video content where the transcript will be shown as obfuscated text.

Thus far, we have been writing our code in different files contained within different packages.

Error: This image is missing a width attribute

Please provide one in the form of ![width=50%](

Bottom Navigation Bar

Let us create a new component that will be used to display the bottom navigation bar in our app.

fun BottomBarItem(
    modifier: Modifier = Modifier,
    title: String,
) {
      text = title,
      modifier = modifier,
      fontStyle = FontStyle.Italic,
      fontSize = 10.sp)
fun BottomNavBar() {
  Box(modifier = Modifier

    Row(modifier = Modifier
        horizontalArrangement = Arrangement.SpaceEvenly,
        verticalAlignment = Alignment.CenterVertically) {

      BottomBarItem(title = "Home")

      BottomBarItem(title = "Search")

      BottomBarItem(title = "Profile")



Food Detail Screen

Let us create a new file inside the screens package called FoodDetailScreen.kt. This file will contain the FoodDetailScreen Composable.

fun FoodDetails(
    foodId: Int? = 0
) {
    val food = getFood()[ foodId ?: 0]

        modifier = Modifier
            .background(color = Color.White)

            modifier = Modifier
                    painter = painterResource(id = food.banner),
                    contentScale = ContentScale.FillBounds




The theme package, found within ui, contains files that will be used to store the theme of our app.