当前位置:网站首页>When the interviewer opens his mouth, he comes to compose. Is this the case now?
When the interviewer opens his mouth, he comes to compose. Is this the case now?
2022-06-11 02:34:00 【Programmer Yidong】
Preface
stay Android in ,UI The history of the toolkit can be traced back to at least 10 Years ago , Since then , Things have changed a lot , For example, the equipment we use , User expectations , And what developers are using for them Development tools and language expectations .Google in the light of Many adjustments have been made to different problems , however Only in UI In terms of construction , The first set UI The construction system has been used up to now , Almost no adjustments have been made .

However, in 2019 Year of google I/O At the conference ,Jetpack For the first time, the team introduced Jetpack Compose, This is a kind of all-new Android UI Component library .
Google Why build Compose
Jetpack Compose yes Google from 17 Year to 21 year ** It took five years to build , Used to build Android Native interface new UI tool kit .**Android It was born many years ago ,UI The system is already mature , Why rebuild a wheel like this ?
as everyone knows ,Android Traditional imperative UI The development has the following problems :
XML Lengthy layout 、 tedious : Encountered complex layout , You can't see the whole screen vertically
View The nesting of programming methods has a performance impact : Unreasonable layout results in double measurement performance
Manually updating the view is complicated 、 Fallible
Declarative interface models are becoming increasingly popular : This way can simplify UI Build and update steps for , Only make the necessary changes
But it is born by following the trend Compose It not only solves these problems but also has more advantages :
declarative UI: Only responsible for describing the interface ,Compose The system is responsible for the rest of the work
State driven : The interface is automatically updated with the status
Efficient rendering : Fixed measurement , Hierarchical nesting performance is still O(n)
combination AS Of Preview The view can be viewed in real time and interacted directly UI
Compatible with tradition View Tree programming , Can be mixed
Have Jetpack The strong cooperation of the framework
be based on Kotlin, The code is concise , A lot of Kotlin exclusive API
Jetpack Compose Is it necessary to learn ?
** declarative UI The eldest brother Flutter ** It's been a long time , To learn Compose Is there any point ,Flutter still Compose? My answer is : If you will continue to Android platform ,Compose You have to be able to !
First Compose yes Jetpack The new of the series UI library ,Compose yes Jetpack One of the members of the series , So it can be applied to Android Interface development , but **Compose yes Android UI The future of ,** At this stage, you can not , Certainly not in the future !
Compose Purpose of birth : Just to redefine Android On UI The way of writing , in order to Improve Android Native UI Development efficiency , Give Way Android Of UI The development method can keep up with the pace of the times .
How to play Jetpack Compose
compose As a new UI frame , so to speak Rendering 、 Layout 、 Touch algorithm and UI How to write it It's all new ! However, from 1.0 There are no comprehensive resources on the market after the release of the version , There are some difficulties in learning !
In order to make everyone efficient , Fast , Overall learning Compose, Xiaobian has collected and sorted out GitHub Open source project Jetpack compose Project practice manual , Let's share it with you today . Let you stand in the perspective of Google engineers , Depth of understanding Compose The bottom layer and how to solve the actual project !

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

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
- The opening
- Draw page
- Painting background
- Painting content
- ……

use Compose Quickly build a “ The movie App”
- finished product
- Implementation scheme
- actual combat
- Insufficient
- ……

For reasons of length , This pure handwritten note has been organized into PDF file , You need this 《Android Jetpack compose Project practice manual 》 The complete document can be scanned below CSDN Official authentication QR code is enough 100% Free access !

边栏推荐
- Unity serial port communication
- A digit DP
- Metal organic framework MOF Al (Diba), MOF Zr (Diba), MOF Fe (Diba) loaded with curcumin / carboxybenzylpenicillin /mtx methotrexate / paclitaxel ptx/ DOX / cisplatin cddp/cpt camptothecin and other d
- Xampp is used under M1 chip, and the installation extension error
- 软件测试英语常见词汇
- SQL | 计算总和
- 优化调度(火电、风能、储能)【matlab代码实现】
- Principle of everything for fast search
- Colab报错:ImportError: cannot import name ‘_check_savefig_extra_args‘ from ‘matplotlib.backend_bases‘
- 年金保險理財產品可以複利嗎?利率是多少?
猜你喜欢

A collection of common ADB commands for app testing

Jetpack compose scaffold and topappbar (top navigation)

Why is the trend chart of precious metal silver strong?

贵金属白银行情走势图缘何强势?

Unity animator rewind

Li Kou brushing questions - hash table
![[3.delphi common components] 6 scroll bar](/img/55/891e56de4500a9128ac89e3c5b1721.jpg)
[3.delphi common components] 6 scroll bar

Bingbing learning notes: find the greatest common divisor and the least common multiple. Complex version reverse string

The diligent is the laziest

Nodejs send mail
随机推荐
Web watermark
When a logical deletion encounters a unique index, what are the problems and solutions?
常见漏洞的防御措施整理
1031. 两个非重叠子数组的最大和
优化调度(火电、风能、储能)【matlab代码实现】
Project load failed
STC8A8K64D4 EEPROM读写失败
Sd3.0 notes
ADVANCE.AI首席执行官寿栋将在2022新兴市场品牌出海线上峰会分享跨境电商运用AI技术合规
How to read PMBOK guide in 3 steps (experience + data sharing)
如何3步精读《PMBOK指南》(经验+资料分享)
92. CompletableFuture 实战
【无标题】
[3.delphi common components] 5 List class component
Modify release opening animation
贵金属白银和现货白银之间是什么关系
心态不能崩......
Find - (block find)
What do you know about the set class? Soul questions from Volume I
查看Redis内数据,除了命令行和客户端,你还有第三种选择