In my previous post Kotlin “By” Class Delegation: Favor Composition Over Inheritance I covered using by keyword for class delegations. You can easily reuse and compose existing concrete implementations in your code. In this post I will be going over using the same by keyword for properties and how you can use them to create reusable code and reduce awkward boilerplate code. I will also include some Android specific samples with delegated properties.

Continue reading

Writing custom views or view groups is quite common nowadays, but sometimes it can be really cumbersome. You have to write overloaded constructors so that they would work properly in layout editor, or you define and implement some interfaces so that you don’t have to copy and paste the same code in different subclasses. With Kotlin we can easily avoid those common pain points when writing custom views and still enjoy full interoperability with Android!

Continue reading

Author's picture

Eric Lin

A software engineer who does Android, Server(less), and Kotlin development and enjoys learning new technologies

Software Engineer

Mountain View, CA