Search in sources :

Example 1 with DefaultModule

use of proton.inject.DefaultModule in project AndroidTraining by mixi-inc.

the class FieldListenerTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    mMockApplication = new MockApplication();
    Proton.initialize(mMockApplication, new DefaultModule() {

        @Override
        protected void configure() {
            super.configure();
            bindFieldListener(TestAnnotation.class, FieldListenerTest.this);
        }
    });
    mInjector = Proton.getInjector(new MockContext(mMockApplication));
}
Also used : MockContext(proton.inject.MockContext) MockApplication(android.test.mock.MockApplication) DefaultModule(proton.inject.DefaultModule)

Example 2 with DefaultModule

use of proton.inject.DefaultModule in project AndroidTraining by mixi-inc.

the class ProviderListenerTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    mMockApplication = new MockApplication();
    Proton.initialize(mMockApplication, new DefaultModule() {

        @Override
        protected void configure() {
            super.configure();
            bindProviderListener(ProviderListenerTest.this);
            bind(Aaa.class);
        }
    });
    mInjector = Proton.getInjector(new MockContext(mMockApplication));
}
Also used : MockContext(proton.inject.MockContext) MockApplication(android.test.mock.MockApplication) DefaultModule(proton.inject.DefaultModule)

Example 3 with DefaultModule

use of proton.inject.DefaultModule in project AndroidTraining by mixi-inc.

the class ObserverTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    mMockApplication = new MockApplication();
    Proton.initialize(mMockApplication, new DefaultModule() {

        @Override
        protected void configure() {
            super.configure();
            bind(Observer.class);
        }
    });
    mInjector = Proton.getInjector(new MockContext(mMockApplication));
}
Also used : MockContext(proton.inject.MockContext) MockApplication(android.test.mock.MockApplication) DefaultModule(proton.inject.DefaultModule)

Example 4 with DefaultModule

use of proton.inject.DefaultModule in project AndroidTraining by mixi-inc.

the class StateRecoveryTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    mMockApplication = new MockApplication();
    Proton.initialize(mMockApplication, new DefaultModule() {

        @Override
        protected void configure() {
            super.configure();
            bind(Aaa.class);
        }
    });
    mInjector = Proton.getInjector(new MockContext(mMockApplication));
    mObserverManager = mInjector.getInstance(ObserverManager.class);
    mStateEventObserver = mInjector.getInstance(StateEventObserver.class);
}
Also used : MockContext(proton.inject.MockContext) MockApplication(android.test.mock.MockApplication) DefaultModule(proton.inject.DefaultModule) ObserverManager(proton.inject.observer.ObserverManager)

Example 5 with DefaultModule

use of proton.inject.DefaultModule in project AndroidTraining by mixi-inc.

the class ExampleApplication method onCreate.

@Override
public void onCreate() {
    super.onCreate();
    Proton.initialize(this, new DefaultModule() {

        @Override
        protected void configure() {
            super.configure();
            bind(Greeting.class).to(GreetingImpl.class);
        }
    });
}
Also used : DefaultModule(proton.inject.DefaultModule)

Aggregations

DefaultModule (proton.inject.DefaultModule)5 MockApplication (android.test.mock.MockApplication)4 MockContext (proton.inject.MockContext)4 ObserverManager (proton.inject.observer.ObserverManager)1