TT
error: [Dagger/MissingBinding] android.content.Context cannot be provided without an @Provides-annotated method.
public abstract interface AboutComponent {
Size: a a a
TT
error: [Dagger/MissingBinding] android.content.Context cannot be provided without an @Provides-annotated method.
public abstract interface AboutComponent {
VM
@Module
class AboutModule(val appContext: Context) {
@FragmentScope
@Provides
fun provideModel(model: AboutViewModel): ViewModel {
return AboutViewModel(appContext = appContext)
}
}
class AboutViewModel @Inject constructor(val appContext: Context): ViewModel() {
class AboutViewModelFactory @Inject constructor(val appContext: Context) : ViewModelProvider.Factory {
TT
TT
VM
private fun injectDependencies() {
activity?.let {
DaggerAboutComponent.builder().aboutListModule(AboutModule(it)).build().inject(
this
)
}
}
VM
private fun injectDependencies() {
activity?.let {
DaggerAboutComponent.builder().aboutListModule(AboutModule(it)).build().inject(
this
)
}
}
@FragmentScope
@Component(modules = [AboutModule::class])
interface AboutComponent {
fun inject(fragment: AboutFragment)
}
VM
TT
TT
TT
VM
VM
TT
VM
k
K
AD
TT
К
К