A nice stop sign

Day 1

11 Mar 2021

21:38

I have jumped into the next step and saw the modifier.

  • The first thing I realized is, there is NO Modifier.margin 😱
  • The second thing; 16.dp which I really like. Here is its code;
inline val Int.dp: Dp get() = Dp(value = this.toFloat())

22:02

RIP RecyclerView… Maybe it is early to say it but look at this code, please.

@Composable
fun MyScreenContent(names: List<String> = listOf("Android", "there")) {
Column {
for (name in names) {
Greeting(name = name)
Divider(color = Color.Black)
}
}
}

Right now I’m not able to visualize it in my mind but pretty sure Composables should be able to do anything you can do with a RecyclerView.

22:17

Reacting to the state of the application is the next step. remember and mutableStateOf are methods that are used to have the “LiveData” of the Composable. Learned that there is a Kotlin compiler plugin to be able to update the UI when the data is changed. It is optimized too. Great so far.

@Composable
fun Counter() {

val count = remember { mutableStateOf(0) }

--

--