Android MVVM 解读 1. 大纲
0. Background info
- Android MVVM Design Pattern
- Guide to app architecture
- 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
- LifecycleService
- ServiceLifecycleDispatcher
1.2. LifeCycle Relative Class
- LifeCycle
- LifecycleRegistry
2. Observer
3. LiveData
Data --> LiveData
RelativeClass
- LiveData
- MediatorLiveData
- ComputableLiveData
- Transformations
4. ViewModel
5. DataBinding
-
通过annotation 生成对应的DataBinderMapperImpl和DataBindingImpl
-
findViewById,在DataBinding中,已经完成
-
DataBindingComponent 问题答疑