Extension Functions in Kotlin

Extension functions in Kotlin: Extend the Android Framework (KAD 08)

Extension functions are a really cool feature that Kotlin provides, and that you’ll find yourself using a lot when writing Android Apps. We have to admit that the Android Framework sometimes makes things a bit difficult, and in Java, the only solution we have left is to create wrappers that do things as we want, …

Extension functions in Kotlin: Extend the Android Framework (KAD 08) Read More »

Lambdas in Kotlin, and how they simplify Android development (KAD 07)

Lambdas are one of the most powerful tools in Kotlin, and in any other modern language, since it allows modelling functions in a much simpler way. The only way we can do this in Java 6 is by declaring interfaces with a single method, and creating anonymous objects that implement those interfaces. Lambdas, and specially …

Lambdas in Kotlin, and how they simplify Android development (KAD 07) Read More »

Custom Views in Android with Kotlin (KAD 06)

[et_pb_section bb_built=”1″ admin_label=”section” inner_width=”auto” inner_max_width=”none”][et_pb_row admin_label=”row” background_position=”top_left” background_repeat=”repeat” background_size=”initial” width=”80%” max_width=”1080px”][et_pb_column type=”4_4″][et_pb_text background_position=”top_left” background_repeat=”repeat” background_size=”initial” _builder_version=”3.23.1″ text_text_shadow_horizontal_length=”text_text_shadow_style,%91object Object%93″ text_text_shadow_horizontal_length_tablet=”0px” text_text_shadow_vertical_length=”text_text_shadow_style,%91object Object%93″ text_text_shadow_vertical_length_tablet=”0px” text_text_shadow_blur_strength=”text_text_shadow_style,%91object Object%93″ text_text_shadow_blur_strength_tablet=”1px” link_text_shadow_horizontal_length=”link_text_shadow_style,%91object Object%93″ link_text_shadow_horizontal_length_tablet=”0px” link_text_shadow_vertical_length=”link_text_shadow_style,%91object Object%93″ link_text_shadow_vertical_length_tablet=”0px” link_text_shadow_blur_strength=”link_text_shadow_style,%91object Object%93″ link_text_shadow_blur_strength_tablet=”1px” ul_text_shadow_horizontal_length=”ul_text_shadow_style,%91object Object%93″ ul_text_shadow_horizontal_length_tablet=”0px” ul_text_shadow_vertical_length=”ul_text_shadow_style,%91object Object%93″ ul_text_shadow_vertical_length_tablet=”0px” ul_text_shadow_blur_strength=”ul_text_shadow_style,%91object Object%93″ ul_text_shadow_blur_strength_tablet=”1px” ol_text_shadow_horizontal_length=”ol_text_shadow_style,%91object Object%93″ ol_text_shadow_horizontal_length_tablet=”0px” ol_text_shadow_vertical_length=”ol_text_shadow_style,%91object Object%93″ ol_text_shadow_vertical_length_tablet=”0px” ol_text_shadow_blur_strength=”ol_text_shadow_style,%91object Object%93″ ol_text_shadow_blur_strength_tablet=”1px” quote_text_shadow_horizontal_length=”quote_text_shadow_style,%91object Object%93″ quote_text_shadow_horizontal_length_tablet=”0px” …

Custom Views in Android with Kotlin (KAD 06) Read More »

Classes in Kotlin: More power with less effort (KAD 03)

Classes in Kotlin are as simple as possible so that you can express the maximum amount of logic with the less code possible. I’ll show quickly how you can start writing Kotlin classes, and the differences with Java classes. 1. Declare the class class Person It’s as easy as using the reserved word class and the name of …

Classes in Kotlin: More power with less effort (KAD 03) Read More »

Create your first Android project using Kotlin (KAD 01)

Today I’m starting a set of 30 articles about Kotlin for Android Developers (KAD). In these articles I’ll be talking about the most important parts of the language and how they apply to Android development. From the very beginning, so if you’ve heard about Kotlin but never tried, then this articles are perfect for you. …

Create your first Android project using Kotlin (KAD 01) Read More »

Kotlin recipes for Android (I): OnGlobalLayoutListener

Today a mate asked me how he could do an OnGlobalLayoutListener properly without incurring in the need of too much boilerplate. This was a tricky question because of a couple of things, let’s see it a little more deeply. What is OnGlobalLayoutListener for? This listener is available for any view’s ViewTreeObserver and it’s quite often …

Kotlin recipes for Android (I): OnGlobalLayoutListener Read More »