- use
enum classes
to specify a fixed number of options. The options are called constants. They are (objects) and are declared in caps.enum class Sport { BASKETBALL, FOOTBALL, RALLY }
- use a
data class
to create objects with no methods, only propertiesdata class Player ( val name: String, val sport: Sport, val team: String, )
- use a regular class to create objects with properties and methods
- use a
LazyColumn
to display a scrollable list of itemsLazyColumn { // pass the list of items to display to items property items(affirmationList) {listItem -> // items property lambda function iterates over each list item in the list // and passes each one to a reusable AffirmationCard to be displayed in the UI AffirmationCard(affirmationObj = listItem) } }
2kelvin / affirmations-app Goto Github PK
View Code? Open in Web Editor NEWJetpack Compose afirmations app to learn all about scrollable lists