components, tools and architectural guidance to accelerate your Android app development.” (Google) “... makes it far easier for you to build robust, high quality apps with less code.” (Google)
sich geändert Quelle: Google - android-developers.googleblog.com • Re-Branding bestehender Komponenten • Refactoring von Support-Libraries • 5 neue Komponenten
zu androidx.* • MinSDK unabhängige Benennung • Semantic Versioning • Bundled in APK “When working with any recent release of the support library, you should not assume that the the v# package notation indicates a minimum API support level.” (Google)
concise, pleasant, and idiomatic by leveraging Kotlin language features such as extension functions/properties, lambdas, named parameters, and parameter default values. ” (Google)
concise, pleasant, and idiomatic by leveraging Kotlin language features such as extension functions/properties, lambdas, named parameters, and parameter default values. ” (Google) Android KTX does not add any new features to the existing Android APIs. ” (Google)
val x = point.x val y = point.y normal: inline operator fun Point.component1() = this.x inline operator fun Point.component2() = this.y the magic: val point = Point(21, 42)
r = yellow.red val g = yellow.green val b = yellow.blue val a = yellow.alpha normal: inline operator fun @receiver:ColorInt Int.component1() = (this shr 24) and 0xff inline operator fun @receiver:ColorInt Int.component2() = (this shr 16) and 0xff inline operator fun @receiver:ColorInt Int.component3() = (this shr 8) and 0xff inline operator fun @receiver:ColorInt Int.component4() = this and 0xff the magic: // a, r, g, b val yellow = Color.argb(255, 255, 255, 0)
} //not just Code-Golf not in KTX: button.setOnClickListener(object: View.OnClickListener{ override fun onClick(v: View?) { stuff() } }) normal: val button = view.findViewById<Button>(R.id.buttonPanel) button.setOnClickListener{ stuff() } still normal:
Navigationspfade werden in “Navigation Graph” definiert • XML oder grafischer Editor • Automatisch generierte FragmentTransactions • Backstack management • Material Design Extensions & Typesafe Fragment Args • Implementiert “Guiding Principles of Navigation”