Skip to content

bravetou/MVVMRapid

Repository files navigation

MVVMRapid


介绍

MVVM rapid development.


使用说明


  1. 启用databinding
buildFeatures {
    viewBinding true
    dataBinding true
}

  1. 依赖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'
}

  1. 配置Application
  • 继承CommonApp
  • 自定义Application可以参照CommonApp中的方法添加到自定义Application中