MVVM rapid development.
- 启用databinding
buildFeatures {
viewBinding true
dataBinding true
}
- 依赖Library
在根目录的build.gradle中加入
allprojects {
repositories {
// ...
maven { url 'https://jitpack.io' }
}
}
在主项目app的build.gradle中依赖
dependencies {
// mvvm core
implementation 'com.github.bravetou.MVVMRapid:mvvmrapid:$version'
// mvvm recyclerView
implementation 'com.github.bravetou.MVVMRapid:mvvmrapid-rv:$version'
// no reflection viewBinding delegate
implementation 'com.github.bravetou.MVVMRapid:binding-delegate-no-reflection:$version'
// reflect viewBinding delegate
implementation 'com.github.bravetou.MVVMRapid:binding-delegate-reflect:$version'
}
- 配置Application