mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Update CommonsApplication.java
This commit is contained in:
parent
8f32fc1c01
commit
1d94b8a87c
1 changed files with 15 additions and 15 deletions
|
|
@ -61,17 +61,6 @@ public class CommonsApplication extends DaggerApplication {
|
||||||
private CommonsApplicationComponent component;
|
private CommonsApplicationComponent component;
|
||||||
private RefWatcher refWatcher;
|
private RefWatcher refWatcher;
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides a way to get member refWatcher
|
|
||||||
*
|
|
||||||
* @param context Application context
|
|
||||||
* @return application member refWatcher
|
|
||||||
*/
|
|
||||||
public static RefWatcher getRefWatcher(Context context) {
|
|
||||||
CommonsApplication application = (CommonsApplication) context.getApplicationContext();
|
|
||||||
return application.refWatcher;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to declare and initialize various components and dependencies
|
* Used to declare and initialize various components and dependencies
|
||||||
*/
|
*/
|
||||||
|
|
@ -106,11 +95,22 @@ public class CommonsApplication extends DaggerApplication {
|
||||||
}
|
}
|
||||||
return LeakCanary.install(this);
|
return LeakCanary.install(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helps in injecting dependency library Dagger
|
* Provides a way to get member refWatcher
|
||||||
* @return Dagger injector
|
*
|
||||||
|
* @param context Application context
|
||||||
|
* @return application member refWatcher
|
||||||
*/
|
*/
|
||||||
|
public static RefWatcher getRefWatcher(Context context) {
|
||||||
|
CommonsApplication application = (CommonsApplication) context.getApplicationContext();
|
||||||
|
return application.refWatcher;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helps in injecting dependency library Dagger
|
||||||
|
* @return Dagger injector
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected AndroidInjector<? extends DaggerApplication> applicationInjector() {
|
protected AndroidInjector<? extends DaggerApplication> applicationInjector() {
|
||||||
return injector();
|
return injector();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue