Tutorial by Examples

Start with a properly configured gradle project. In your project-local (not top-level) build.gradle append extensions plugin declaration below your Kotlin plugin, on top-level indentation level. buildscript { ... } apply plugin: "com.android.application" ... apply plugin: &quo...
Assuming we have an activity with an example layout called activity_main.xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layou...
Android extensions also work with multiple Android Product Flavors. For example if we have flavors in build.gradle like so: android { productFlavors { paid { ... } free { ... } } } And for example, only the free flavor has ...
mView.afterMeasured { // inside this block the view is completely drawn // you can get view's height/width, it.height / it.width } Under the hood inline fun View.afterMeasured(crossinline f: View.() -> Unit) { viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlob...

Page 1 of 1