![]() |
VOOZH | about |
Jetpack Compose is a modern UI toolkit that is designed to simplify UI development in Android. It consists of a reactive programming model with conciseness and ease of Kotlin programming language. It is fully declarative so that you can describe your UI by calling some series of functions that will transform your data into a UI hierarchy. When the data changes or is updated then the framework automatically recalls these functions and updates the view for you.
Prerequisites:
To create a new project in the Android Studio, please refer to How to Create a new Project in Android Studio with Jetpack Compose.
There are some resources like colors, image assets, fonts, and some little things. You can easily find them otherwise just get them from the GitHub repo.
BottomMenuContent.kt:
This section has five fields, so create five variables of their types. The fields you can see in the code as well.
Course.kt:
PathUtil.kt
Instead of cluttering MainActivity.kt, we break the UI into reusable functions for better maintainability.
Once structured, simply pass the course data:
CourseItem(course = courses[it])HomeScreen.kt:
Now add fun HomeScreen() that contains all the functions, in MainActivity as