January 2018
Intermediate to advanced
434 pages
14h 1m
English
Let's see the implementation of the preceding two helper methods:
inline fun doIfSdk(version: Int, f: () -> Unit) { if (Build.VERSION.SDK_INT == version) f()}
inline fun doFromSdk(version: Int, f: () -> Unit) { if (Build.VERSION.SDK_INT >= version) f()}
As you can see, it's just old Android SDK code behind the hood. The doFromSdk and doIfSdk are just the syntactic sugars on top of it.
Read now
Unlock full access