mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Finished removing coupling between classes around the getInstance() method.
This commit is contained in:
parent
dbcbeed822
commit
ed1ae98d8e
18 changed files with 154 additions and 125 deletions
|
|
@ -79,7 +79,6 @@ public class CommonsApplication extends DaggerApplication {
|
|||
public static final String FEEDBACK_EMAIL = "commons-app-android@googlegroups.com";
|
||||
public static final String FEEDBACK_EMAIL_SUBJECT = "Commons Android App (%s) Feedback";
|
||||
|
||||
private static CommonsApplication instance = null;
|
||||
private MediaWikiApi api = null;
|
||||
private LruCache<String, String> thumbnailUrlCache = new LruCache<>(1024);
|
||||
private CacheController cacheData = null;
|
||||
|
|
@ -87,21 +86,6 @@ public class CommonsApplication extends DaggerApplication {
|
|||
private NearbyPlaces nearbyPlaces = null;
|
||||
private CommonsApplicationComponent component;
|
||||
|
||||
/**
|
||||
* This should not be called by ANY application code (other than the magic Android glue)
|
||||
* Use CommonsApplication.getInstance() instead to get the singleton.
|
||||
*/
|
||||
public CommonsApplication() {
|
||||
CommonsApplication.instance = this;
|
||||
}
|
||||
|
||||
public static CommonsApplication getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new CommonsApplication();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
public MediaWikiApi getMWApi() {
|
||||
if (api == null) {
|
||||
api = new ApacheHttpClientMediaWikiApi(API_URL);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue