kotlin+jetpack MvvM

曹旭
2023-12-01

 kotlin+jectpack mvvm的简单demo

demi地址

  1. 基于koltin (kotlin Android开发必须入坑)
  2. jetpack 

注意点

  1. retrofit2  版本2.6 才能使用携程
 //===============JetPack==================
    implementation 'androidx.navigation:navigation-fragment:2.3.1'
    implementation 'androidx.navigation:navigation-ui:2.3.1'
    implementation 'androidx.navigation:navigation-fragment-ktx:2.3.1'
    implementation 'androidx.navigation:navigation-ui-ktx:2.3.1'
    implementation 'com.airbnb.android:lottie:2.6.1'
    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
    def lifecycle_version = "2.2.0"
    implementation 'com.lcodecorex:tkrefreshlayout:1.0.7'
    def paging_version = "3.0.0-alpha02"
    implementation "androidx.paging:paging-runtime:$paging_version"
    implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
    implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
    implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
    implementation 'androidx.viewpager2:viewpager2:1.1.0-alpha01'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
    implementation 'androidx.lifecycle:lifecycle-common-java8:2.2.0'
    implementation 'com.github.bumptech.glide:glide:3.7.0'

 

 类似资料: