pull/83/head
kunfei 5 years ago
parent f2e11bb69a
commit 427eac4313
  1. 3
      app/src/main/java/io/legado/app/utils/ViewModelKt.kt

@ -8,7 +8,8 @@ import androidx.lifecycle.ViewModelProvider
fun <T : ViewModel> AppCompatActivity.getViewModel(clazz: Class<T>) = fun <T : ViewModel> AppCompatActivity.getViewModel(clazz: Class<T>) =
ViewModelProvider(this).get(clazz) ViewModelProvider(this).get(clazz)
fun <T : ViewModel> Fragment.getViewModel(clazz: Class<T>) = ViewModelProvider(this).get(clazz) fun <T : ViewModel> Fragment.getViewModel(clazz: Class<T>) =
ViewModelProvider(this).get(clazz)
/** /**
* 与activity数据同步 * 与activity数据同步

Loading…
Cancel
Save