Skip to content

Commit

Permalink
更新CommonActivity绑定ViewModel执行逻辑*
Browse files Browse the repository at this point in the history
更新架包版本*
  • Loading branch information
bravetou committed Jul 20, 2023
1 parent d58cf9e commit c09537e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ ext {

dependencies = [:]

dependencies.coreKtx = 'androidx.core:core-ktx:1.9.0'
dependencies.coreKtx = 'androidx.core:core-ktx:1.10.1'
dependencies.appcompat = 'androidx.appcompat:appcompat:1.6.1'
dependencies.material = 'com.google.android.material:material:1.8.0'
dependencies.activityKtx = 'androidx.activity:activity-ktx:1.7.0'
dependencies.fragmentKtx = 'androidx.fragment:fragment-ktx:1.5.6'
dependencies.material = 'com.google.android.material:material:1.9.0'
dependencies.activityKtx = 'androidx.activity:activity-ktx:1.7.2'
dependencies.fragmentKtx = 'androidx.fragment:fragment-ktx:1.6.0'
dependencies.multidex = 'androidx.multidex:multidex:2.0.1'
dependencies.utilcodex = 'com.blankj:utilcodex:1.31.1'
dependencies.constraintlayout = 'androidx.constraintlayout:constraintlayout:2.1.4'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ abstract class CommonActivity<Binding : ViewBinding, VM : CommonViewModel> : App
binding.setVariable(variableId, viewModel)
// 支持LiveData绑定xml,数据改变,UI自动会更新
binding.lifecycleOwner = this
// 让ViewModel拥有View的生命周期感应
lifecycle.addObserver(viewModel)
}
// 让ViewModel拥有View的生命周期感应
lifecycle.addObserver(viewModel)
}
}

Expand Down

0 comments on commit c09537e

Please sign in to comment.