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

The Power of JetCompose

The Power of JetCompose

The definition and Why do we need jetpack Compose, UI elements of JetPack Compose

Avatar for Nwokocha wisdom maduabuchi

Nwokocha wisdom maduabuchi

November 16, 2019
Tweet

More Decks by Nwokocha wisdom maduabuchi

Other Decks in Programming

Transcript

  1. TABLE OF CONTENT • What is Jetpack Compose • Why

    do we need jetpack Compose • UI Elements of Jetpack Compose • Simple HelloWorld app with Jetpack Compose
  2. WHAT IS JETCOMPOSE • Jetpack Compose is a modern toolkit

    for building native Android UI. Jetpack Compose simplifies and accelerates UI development on Android with less code, powerful tools, and intuitive Kotlin APIs.
  3. • Concise and Idiomatic Kotlin — Built with the benefits

    that Kotlin brings • Declarative — Fully declarative for defining UI components • Compatible — Compatible with existing views • Enable Beautiful Apps — Designed with Material Design • 100% Kotlin – written in Kotlin programming language WHY DO WE NEED JETCOMPOSE
  4. • Accelerate Development — writing less code and using tools

    • One codebase- No need to write XML anymore.
  5. UI ELEMENTS OF JETCOMPOSE • Composable function (@Composable) : These

    functions let you define your app's UI programmatically by describing its shape and data dependencies. • @Preview Annotation : the preview annotation lets you preview your composable functions within the IDE, instead of needing to download the app to an Android device or emulator. • Column function : The Column() function lets you stack elements vertically. The default settings stack all the children directly, one after another, with no spacing.
  6. ▪ Row () : function lets you stack elements horizontally.

    The default settings stack all the children directly next to each other, with no spacing. ▪ Center () : A layout that takes a child and centers it within itself. The layout will be as large as possible for finite incoming constraints or wrap content otherwise. ▪ Text () : function that outputs a text element to your blank activity ▪ Button (): function thats outputs a button element to your blank activity