Kotlin Coroutines makes async programming easy, leaving all problems inside library code. Programmer can focused on code writing.
I prepearing simple project: Retrofit Service, 1 Activity, 1 Adapter, 1 Model.

build.gradle in app level: RecyclerView, Coroutines, Retrofit

Model: (I used old friend – JSONPlaceholder)

Adapter and holder (by the way, take a loot to LayoutContainer, it allows access to View through Kotlin Extensions, but we need   androidExtensions -> experimental = true block in build.gradle)

Retrofit API-interface:

And finally, Activity and layouts:

That’s all, folks. All code (with little clarifications) on my GitHub.

Leave a Reply

Close Menu