developer.android.com/codelabs/basic-android-kotlin-compose-build-a-dice-roller-app?authuser=1&continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-2-pathway-2%3Fauthuser%3D1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-build-a-dice-roller-app
1 Users
0 Comments
6 Highlights
0 Notes
Tags
Top Highlights
Compose uses a Modifier object, which is a collection of elements that decorate or modify the behavior of Compose UI elements. You use this to style the UI components of the Dice Roller app's components.
Chain a fillMaxSize() method onto the Modifier object so that the layout fills the entire screen.
The wrapContentSize() method specifies that the available space should at least be as large as the components inside of it.
The Column() function is a composable layout that places its children in a vertical sequence.
A lambda is a function literal, which is a function like any other, but instead of being declared separately with the fun keyword, it is written inline and passed as an expression.
Composables are stateless by default, which means that they don't hold a value and can be recomposed any time by the system, which results in the value being reset. However, Compose provides a convenient way to avoid this. Composable functions can store an object in memory using the remember composable. Make the result variable a remember composable. The remember composable requires a function to be passed. In the remember composable body, pass in a mutableStateOf() function and then pass the function a 1 argument. The mutableStateOf() function returns an observable.
Glasp is a social web highlighter that people can highlight and organize quotes and thoughts from the web, and access other like-minded people’s learning.