Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Exploring Kotlin + Anko

Exploring Kotlin + Anko

Brief Introduction to Kotlin & Anko, a replacement to XML views used in Android.

Rakshak R.Hegde

September 03, 2016
Tweet

More Decks by Rakshak R.Hegde

Other Decks in Programming

Transcript

  1. Anko... Wut? verticalLayout { val name = editText() button("Say Hello")

    { onClick { toast("Hello, ${name.text}!") } } }
  2. What I’ll cover, hopefully :) 1. Kotlin & Anko 2.

    How to use Anko in Activity 3. Makin’ it modular - AnkoComponents 4. How Anko works - Extension funcs & Lambdas
  3. 1. Set. Up. > New Project in Android Studio >

    Kotlin Plugin > Configure Kotlin ⌘⌥A > Summon Anko > Install DSL Preview Plugin > sudo rm -rf / # fo shitzengiggles
  4. Pick n Choose, Runtime Configs - Screen Size - Density

    - Orientation - Right to Left languages/locales - API Qualifiers - doIfSdk / doFromSdk
  5. I wanna talk about... ➔ AnkoComponents vs XML ➔ Styles

    & Themes ➔ Paint & Performance ➔ Kotlin Delegates ➔ All types of drawables - Bitmap, 9-Patch, LayerList, ColorStateList, Shape Drawable, Selectors, Color Drawable, VectorDrawable ➔ Accessibility - Screen Reader ➔ AnimatedVectorDrawable ➔ Dieting Apps - Lean Apks ➔ Flow + Mortar