ivianuu / contributer Goto Github PK
View Code? Open in Web Editor NEWInject all types like views or a conductor controllers with @ContributesAndroidInjector
Inject all types like views or a conductor controllers with @ContributesAndroidInjector
Hey, could someone confirm the library is playing nicely with latest Dagger? As of now - 2.21.
I'm currently using this and it works if I add the module to my ApplicationComponent. I would like to use it as a Subcomponent of a Activity module (another subcomponent). Right now it compiles but at runtime I get a Caused by: java.lang.IllegalArgumentException: No injector factory bound for Class<com.wakingup.android.home.HomeController>
. I don't know if I'm making something wrong or this does not work as a third subcomponent.
My code almost like this:
@AndroidInjectorKeyRegistry(keys = [ControllerKey::class])
@Singleton
@Component(modules = [
AndroidSupportInjectionModule::class,
ConductorInjectionModule::class,
ApplicationModule::class,
ActivityBindingModule::class])
interface ApplicationComponent : AndroidInjector<WakingUp> {
@Component.Builder
interface Builder {
@BindsInstance
fun application(application: Application): Builder
fun build(): ApplicationComponent
}
}
@Module
abstract class ActivityBindingModule {
@ActivityScoped
@ContributesAndroidInjector(modules = [ControllerBindingModule::class])
abstract fun bindHomeActivity(): HomeActivity
}
@Module
abstract class ControllerBindingModule {
@ContributesAndroidInjector
abstract fun bindHomeController(): HomeController
@ContributesAndroidInjector
abstract fun bindHomeTabController(): HomeTabController
@ContributesAndroidInjector
abstract fun bindPodcastsTabController(): PodcastsTabController
}
Tested with the newly released Dagger version 2.17.
Dagger might have changed some implementation.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.