LiveData

少于 1 分钟 阅读

    //For Lifecycles, LiveData, and ViewModel, add:
    compile "android.arch.lifecycle:runtime:$arch_version"
    compile "android.arch.lifecycle:extensions:$arch_version"
    annotationProcessor "android.arch.lifecycle:compiler:$arch_version"

    //For Room, add:
    compile "android.arch.persistence.room:runtime:$arch_version"
    annotationProcessor "android.arch.persistence.room:compiler:$arch_version"

    //For testing Room migrations, add:
    testCompile "android.arch.persistence.room:testing:$arch_version"

    //For Room RxJava support, add:
    compile "android.arch.persistence.room:rxjava2:$arch_version"

    //For retrofit and RxJava support
    implementation 'com.squareup.retrofit2:retrofit:2.3.0'
    implementation 'com.squareup.retrofit2:adapter-rxjava:2.3.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'