mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Fix build
This commit is contained in:
parent
0e86741cc4
commit
edaa0dd05a
4 changed files with 5 additions and 24 deletions
|
|
@ -21,6 +21,7 @@ import java.io.File;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Named;
|
import javax.inject.Named;
|
||||||
|
|
||||||
|
import fr.free.nrw.commons.BuildConfig;
|
||||||
import fr.free.nrw.commons.auth.SessionManager;
|
import fr.free.nrw.commons.auth.SessionManager;
|
||||||
import fr.free.nrw.commons.category.CategoryDao;
|
import fr.free.nrw.commons.category.CategoryDao;
|
||||||
import fr.free.nrw.commons.contributions.ContributionDao;
|
import fr.free.nrw.commons.contributions.ContributionDao;
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,13 @@ import javax.inject.Singleton;
|
||||||
|
|
||||||
import dagger.Module;
|
import dagger.Module;
|
||||||
import dagger.Provides;
|
import dagger.Provides;
|
||||||
|
|
||||||
|
import fr.free.nrw.commons.BuildConfig;
|
||||||
import fr.free.nrw.commons.auth.AccountUtil;
|
import fr.free.nrw.commons.auth.AccountUtil;
|
||||||
import fr.free.nrw.commons.auth.SessionManager;
|
import fr.free.nrw.commons.auth.SessionManager;
|
||||||
import fr.free.nrw.commons.data.DBOpenHelper;
|
import fr.free.nrw.commons.data.DBOpenHelper;
|
||||||
import fr.free.nrw.commons.location.LocationServiceManager;
|
import fr.free.nrw.commons.location.LocationServiceManager;
|
||||||
|
import fr.free.nrw.commons.mwapi.ApacheHttpClientMediaWikiApi;
|
||||||
import fr.free.nrw.commons.mwapi.MediaWikiApi;
|
import fr.free.nrw.commons.mwapi.MediaWikiApi;
|
||||||
import fr.free.nrw.commons.nearby.NearbyPlaces;
|
import fr.free.nrw.commons.nearby.NearbyPlaces;
|
||||||
import fr.free.nrw.commons.upload.UploadController;
|
import fr.free.nrw.commons.upload.UploadController;
|
||||||
|
|
@ -114,31 +117,12 @@ public class CommonsApplicationModule {
|
||||||
return new SessionManager(context, mediaWikiApi, sharedPreferences);
|
return new SessionManager(context, mediaWikiApi, sharedPreferences);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
|
||||||
@Singleton
|
|
||||||
public MediaWikiApi provideMediaWikiApi(Context context,
|
|
||||||
@Named("default_preferences") SharedPreferences defaultPreferences,
|
|
||||||
@Named("category_prefs") SharedPreferences categoryPrefs,
|
|
||||||
Gson gson) {
|
|
||||||
return new ApacheHttpClientMediaWikiApi(context, BuildConfig.WIKIMEDIA_API_HOST, BuildConfig.WIKIDATA_API_HOST, defaultPreferences, categoryPrefs, gson);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
public LocationServiceManager provideLocationServiceManager(Context context) {
|
public LocationServiceManager provideLocationServiceManager(Context context) {
|
||||||
return new LocationServiceManager(context);
|
return new LocationServiceManager(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gson objects are very heavy. The app should ideally be using just one instance of it instead of creating new instances everywhere.
|
|
||||||
* @return returns a singleton Gson instance
|
|
||||||
*/
|
|
||||||
@Provides
|
|
||||||
@Singleton
|
|
||||||
public Gson provideGson() {
|
|
||||||
return new Gson();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
public DBOpenHelper provideDBOpenHelper(Context context) {
|
public DBOpenHelper provideDBOpenHelper(Context context) {
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ public class NetworkingModule {
|
||||||
@Named("default_preferences") SharedPreferences defaultPreferences,
|
@Named("default_preferences") SharedPreferences defaultPreferences,
|
||||||
@Named("category_prefs") SharedPreferences categoryPrefs,
|
@Named("category_prefs") SharedPreferences categoryPrefs,
|
||||||
Gson gson) {
|
Gson gson) {
|
||||||
return new ApacheHttpClientMediaWikiApi(context, BuildConfig.WIKIMEDIA_API_HOST, defaultPreferences, categoryPrefs, gson);
|
return new ApacheHttpClientMediaWikiApi(context, BuildConfig.WIKIMEDIA_API_HOST, BuildConfig.WIKIDATA_API_HOST, defaultPreferences, categoryPrefs, gson);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,6 @@ public class ShareActivity
|
||||||
|
|
||||||
private Uri mediaUri;
|
private Uri mediaUri;
|
||||||
private Contribution contribution;
|
private Contribution contribution;
|
||||||
private SimpleDraweeView backgroundImageView;
|
|
||||||
private FloatingActionButton maps_fragment;
|
private FloatingActionButton maps_fragment;
|
||||||
|
|
||||||
private boolean cacheFound;
|
private boolean cacheFound;
|
||||||
|
|
@ -163,9 +162,6 @@ public class ShareActivity
|
||||||
|
|
||||||
private Animator CurrentAnimator;
|
private Animator CurrentAnimator;
|
||||||
private long ShortAnimationDuration;
|
private long ShortAnimationDuration;
|
||||||
private FloatingActionButton zoomInButton;
|
|
||||||
private FloatingActionButton zoomOutButton;
|
|
||||||
private FloatingActionButton mainFab;
|
|
||||||
private boolean isFABOpen = false;
|
private boolean isFABOpen = false;
|
||||||
|
|
||||||
//Had to make them class variables, to extract out the click listeners, also I see no harm in this
|
//Had to make them class variables, to extract out the click listeners, also I see no harm in this
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue