A nice stop sign

Day 1

11 Mar 2021


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())


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

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.


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.

fun Counter() {

val count = remember { mutableStateOf(0) }

Button(onClick = { count.value++ }) {
Text("I've been clicked ${count.value} times")

I feel like the actual variable is not going to be inside of the Composable function. I’ll try to pass the counter, which is a MutableState<Int>, as a parameter to the Counter function.

Ok, a wrong approach.

The value should be passed and I feel like there should be a listener for the click events. We cannot leave any logic in the Composable function.

I’ll pass this part for now. (Shhh, couldn’t figure out it yet.)


State Hoisting… No, it is not a typo (at least that was what I thought.) What I was just saying is here. I’ll leave the rest to the 3rd day.





Android Developer @Teckro.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Code, Community, Future — A year in review for Numba (2020)

Plutos Network

Data Structures — Linked List

Integrate Java Code Coverage with Integration Tests

2D Shooter: A Display for Waves

MicroZed Chronicles: PYNQ, RFSoC & SDFEC

Laracon 2017 – A Recap (And Links Galore)

Flutter Bloc for beginners: building a countdown timer using flutter bloc (part 1)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
efe budak

efe budak

Android Developer @Teckro.com

More from Medium

Android Protobuf with kotlin and Wire

Navigation in Jetpack Compose Android

Android Jetpack Compose

Why you should embrace Android Compose?