当前位置:网站首页>Ali's ten-year technical experts jointly created the "latest" jetpack compose project combat drill (with demo)

Ali's ten-year technical experts jointly created the "latest" jetpack compose project combat drill (with demo)

2022-04-23 04:28:00 Programmer - Wu Yanzu

Preface

Android Jetpack The collection of components can help us write a lot of repetitive code , And can simplify complex tasks , Let's have BUG Reduce , So that we can focus more on business logic , Focus on building the application itself .

The specific benefits of using this architecture are as follows

  • UI Decoupled from business logic .
  • Effectively avoid life cycle component memory leakage .
  • Improve module testability .
  • Improve application stability , Effectively reduce the occurrence probability of the following abnormalities .
  • Can not perform this action after onSaveInstanceState
  • WindowManager$BadTokenException, is your activity running?
  • OOM 、 NullPointerException
  • ……

These benefits make it easier for us developers to develop excellent Android application , Finally push Android Rapid development of .

Especially in UI In terms of development , It 's been a long time , Officially released last year Compose It also brings great convenience to developers . As declarative UI The representative of the , Compose Indeed, it has many unique advantages :

  • declarative UI, There is no need to refresh the data manually
  • Get rid of XML , Completely removed the mixed writing (xml+Java、kotlin) The limitations of
  • Super compatibility , Most common libraries ( Such as Navigation、ViewModel and Kotlin coroutines ) All apply to Compose,Compose Be able to work with existing View Systems coexist , You can introduce for an existing project Compose
  • Accelerate development , It provides us with a lot of out of the box Material Components , If APP It is used. material Design words , So use Jetpack Compose It can save you a lot of energy .
  • Reduce the number of codes , Reduce bug Appearance
  • Fully functional , Can completely cover Android All existing system capabilities
  • Real-time Preview ,Compose The preview mechanism can be the same as the real machine , True what you see is what you get

Compose Realized Google Its original intention , Major factories are also right Compose be profuse in praise

To help you better understand Compose, Get started and practice as soon as possible , Here I'd like to introduce to you a powerful share of Alibaba bosses 《Jetpack Compose From entry to mastery 》, Hand in hand to show you Compose The style of .

The purpose of this information is to give hope to know 、 Study 、 application Jetpack Compose A reference for my little partner , Hope to help you who are studying ! need 《Jetpack Compose From entry to mastery 》 The full version of the little partner can click on the card at the end of the text to get it for free ! Guarantee free sharing

《Jetpack Compose From entry to mastery 》

Catalog

Chapter one First time to know Jetpack Compose

Why do we need a new UI Tools
Jetpack Compose Focus on

  • Accelerate development
  • Powerful UI Tools
  • Intuitive Kotlin API

API Design

Compose API Principles

  • Everything is a function
  • Top level function (Top-level function)
  • Combination over inheritance
  • Trust a single source

Deepen understanding Compose

  • Core
  • Foundation
  • Material

slot API

Chapter two Jetpack Compose structure Android UI

Android Jetpack Compose The best guide to getting started

  • Jetpack Compose Environmental preparation and Hello World Layout
  • Use Material design Design
  • Compose Real time preview of the layout
  • ……

Go into detail Jetpack Compose | Optimize UI structure

  • Compose The problem solved
  • Composable Function analysis
  • declarative UI
  • Combine vs Inherit
  • encapsulation
  • restructuring
  • ……

Go into detail Jetpack Compose | Realization principle

  • @Composable What does annotation mean ?
  • Execution mode
  • Positional Memoization ( Place memory )
  • Store parameters
  • restructuring
  • ……

The third chapter Jetpack Compose Project practice ( attach Demo)

Jetpack Compose application 1

  • Preparation before start
  • establish DEMO
  • Problems encountered

Jetpack Compose application 2

  • Jetpack Compose The application makes a countdown timer
  • data structure
  • Countdown function
  • The state pattern
  • Compose Layout
  • Draw the clock

use Jetpack Compose Write a play Android App

  • preparation
  • Introduce dependencies
  • newly build Activity
  • establish Compose
  • PlayTheme
  • Draw page
  • Bottom navigation bar
  • Management status
  • Add a page

use Compose Android Write a weather app

  • Draw page
  • Painting background
  • Painting content
  • ……

use Compose Quickly build a “ The movie App

  • finished product
  • Implementation scheme
  • actual combat
  • Insufficient
  • ……

Limited space , need 《Jetpack Compose From entry to mastery 》 The full version of the little partner can click on the card below to get it for free ! Guarantee free sharing

版权声明
本文为[Programmer - Wu Yanzu]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230423543221.html