use of proton.inject.internal.InjectorImpl in project AndroidTraining by mixi-inc.
the class Proton method initialize.
public static void initialize(Application app, Module... modules) {
synchronized (Proton.class) {
checkState(sInjectors == null, "Already initialized Proton");
sInjectors = new WeakHashMap<Context, InjectorImpl>();
sBindings = new Bindings();
sProviderListeners = new ProviderListeners();
sFieldListeners = new FieldListeners();
for (Module module : modules) module.configure(sBindings, sProviderListeners, sFieldListeners);
InjectorImpl injector = new InjectorImpl(app, sBindings, sProviderListeners, sFieldListeners, null);
sInjectors.put(app, injector);
}
}
use of proton.inject.internal.InjectorImpl in project AndroidTraining by mixi-inc.
the class Proton method getInjector.
public static Injector getInjector(Context context) {
synchronized (Proton.class) {
checkInitialize();
InjectorImpl injector = sInjectors.get(context);
if (injector == null) {
InjectorImpl parent = sInjectors.get(context.getApplicationContext());
injector = new InjectorImpl(context, sBindings, sProviderListeners, sFieldListeners, parent);
sInjectors.put(context, injector);
}
return injector;
}
}
Aggregations