Android MVVM 解读 1. 大纲

0. Background info

  1. Android MVVM Design Pattern
  2. Guide to app architecture
  3. Better Android Apps Using MVVM with Clean Architecture

1. LifeCycle

1.1. Handling Lifecycles with Lifecycle-Aware Components

MVVM

1.1.1 Activity

SupportActivity
insert ReportFragment

1.1.2 Fragment

support.v4.app.Fragment

1.1.3 Service

  1. LifecycleService
  2. ServiceLifecycleDispatcher

1.2. LifeCycle Relative Class

  1. LifeCycle
  2. LifecycleRegistry

2. Observer

3. LiveData

Data --> LiveData

RelativeClass

  1. LiveData
  2. MediatorLiveData
  3. ComputableLiveData
  4. Transformations

4. ViewModel

5. DataBinding

  1. 通过annotation 生成对应的DataBinderMapperImpl和DataBindingImpl

  2. findViewById,在DataBinding中,已经完成

  3. DataBindingComponent

    DataBindingComponent 问题答疑

5. View

posted @ 2020-02-14 21:18  Panda Pan  阅读(12)  评论(0编辑  收藏  举报