Support AndroidX ViewModel
See original GitHub issueIs your feature request related to a problem? Please describe.
Google is changing the packaging to AndroidX, so, when we use Koin viewModel to do the injection it crashes with:
Type parameter bound for T in inline fun <reified T : ViewModel> Context.viewModel(name: String = ..., noinline definition: Definition<T> /* = (ParameterProvider) -> T */): Unit is not satisfied: inferred type MyViewModel is not a subtype of ViewModel e: ...
Describe the solution you’d like Allow to use androidx.lifecycle.ViewModel
Describe alternatives you’ve considered hum… I don’t think there are not a lot of alternatives
Target Koin project android
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:19 (9 by maintainers)
Top Results From Across the Web
ViewModel overview - Android Developers
ViewModel lets you manage your UI's data in a lifecycle-aware fashion.
Read more >ViewModels : A Simple Example. Introduction | by Lyla Fujiwara
The ViewModel class is designed to hold and manage UI-related data in a life-cycle conscious way. · ViewModels separate UI implementation from your...
Read more >ViewModel.java - Google Git
ViewModel is a class that is responsible for preparing and managing the data for ... Activity Activity} or a {@link androidx.fragment.app.
Read more >ViewModel in Android Architecture Components
ViewModel is one of the most critical class of the Android Jetpack Architecture Component that support data for UI components.
Read more >how to instantiate ViewModel In AndroidX? - Stack Overflow
For Pre-AndroidX use implementation "android.arch.lifecycle:viewmodel:1.1.1" (1.1.1 is the last version from this artifact i guess.) In ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hello,
AndroidX is in
alpha-1
. Let’s keep it under the hand and upgrade it when it will be in a more stable state (else we will have to regularly provide updates).koin-androidx
is available in jcenter 👍