Search in sources :

Example 1 with AvengersApplication

use of saulmm.avengers.AvengersApplication in project Avengers by saulmm.

the class CharacterListActivity method initializeDependencyInjector.

private void initializeDependencyInjector() {
    AvengersApplication avengersApplication = (AvengersApplication) getApplication();
    DaggerAvengersComponent.builder().activityModule(new ActivityModule(this)).appComponent(avengersApplication.getAppComponent()).build().inject(this);
}
Also used : ActivityModule(saulmm.avengers.injector.modules.ActivityModule) AvengersApplication(saulmm.avengers.AvengersApplication)

Example 2 with AvengersApplication

use of saulmm.avengers.AvengersApplication in project Avengers by saulmm.

the class CharacterDetailActivity method initializeDependencyInjector.

private void initializeDependencyInjector() {
    AvengersApplication avengersApplication = (AvengersApplication) getApplication();
    int avengerId = getIntent().getIntExtra(EXTRA_CHARACTER_ID, -1);
    DaggerAvengerInformationComponent.builder().activityModule(new ActivityModule(this)).appComponent(avengersApplication.getAppComponent()).avengerInformationModule(new AvengerInformationModule(avengerId)).build().inject(this);
}
Also used : ActivityModule(saulmm.avengers.injector.modules.ActivityModule) AvengersApplication(saulmm.avengers.AvengersApplication) AvengerInformationModule(saulmm.avengers.injector.modules.AvengerInformationModule)

Example 3 with AvengersApplication

use of saulmm.avengers.AvengersApplication in project Avengers by saulmm.

the class CollectionActivity method initDependencyInjector.

private void initDependencyInjector() {
    int avengerId = getIntent().getIntExtra(EXTRA_CHARACTER_ID, -1);
    DaggerAvengerInformationComponent.builder().activityModule(new ActivityModule(this)).appComponent(((AvengersApplication) getApplication()).getAppComponent()).avengerInformationModule(new AvengerInformationModule(avengerId)).build().inject(this);
}
Also used : ActivityModule(saulmm.avengers.injector.modules.ActivityModule) AvengersApplication(saulmm.avengers.AvengersApplication) AvengerInformationModule(saulmm.avengers.injector.modules.AvengerInformationModule)

Aggregations

AvengersApplication (saulmm.avengers.AvengersApplication)3 ActivityModule (saulmm.avengers.injector.modules.ActivityModule)3 AvengerInformationModule (saulmm.avengers.injector.modules.AvengerInformationModule)2