Minor changes to make things work

This commit is contained in:
maskara 2018-03-03 00:30:44 +05:30
parent 280d00e42e
commit 123c4adbfd
4 changed files with 6 additions and 8 deletions

View file

@ -12,7 +12,6 @@ import fr.free.nrw.commons.auth.LoginActivity;
import fr.free.nrw.commons.contributions.ContributionsSyncAdapter;
import fr.free.nrw.commons.modifications.ModificationsSyncAdapter;
import fr.free.nrw.commons.settings.SettingsFragment;
import fr.free.nrw.commons.nearby.DirectUpload;
import fr.free.nrw.commons.nearby.PlaceRenderer;
@Singleton
@ -40,7 +39,6 @@ public interface CommonsApplicationComponent extends AndroidInjector<Application
@Override
void inject(ApplicationlessInjection instance);
void inject(DirectUpload directUpload);
void inject(PlaceRenderer placeRenderer);
@Component.Builder

View file

@ -33,7 +33,6 @@ public class CommonsApplicationModule {
public static final String CATEGORY_AUTHORITY = "fr.free.nrw.commons.categories.contentprovider";
public static final long OK_HTTP_CACHE_SIZE = 10 * 1024 * 1024;
private CommonsApplication application;
private Context applicationContext;
public CommonsApplicationModule(Context applicationContext) {
@ -88,13 +87,13 @@ public class CommonsApplicationModule {
@Provides
@Named("direct_nearby_upload_prefs")
public SharedPreferences providesDirectNearbyUploadPreferences() {
return application.getSharedPreferences("direct_nearby_upload_prefs", MODE_PRIVATE);
public SharedPreferences providesDirectNearbyUploadPreferences(Context context) {
return context.getSharedPreferences("direct_nearby_upload_prefs", MODE_PRIVATE);
}
@Provides
public UploadController providesUploadController(SessionManager sessionManager, @Named("default_preferences") SharedPreferences sharedPreferences) {
return new UploadController(sessionManager, application, sharedPreferences);
public UploadController providesUploadController(SessionManager sessionManager, @Named("default_preferences") SharedPreferences sharedPreferences, Context context) {
return new UploadController(sessionManager, context, sharedPreferences);
}
@Provides

View file

@ -133,7 +133,7 @@ public class PlaceRenderer extends Renderer<Place> {
@Override
public void render() {
((CommonsApplication) getContext().getApplicationContext()).injector().inject(this);
// ((CommonsApplication) getContext().getApplicationContext()).injector().inject(this);
place = getContent();
tvName.setText(place.name);
String descriptionText = place.getLongDescription();

View file

@ -1,5 +1,6 @@
package fr.free.nrw.commons.upload;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;