mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Minor changes to make things work
This commit is contained in:
parent
280d00e42e
commit
123c4adbfd
4 changed files with 6 additions and 8 deletions
|
|
@ -12,7 +12,6 @@ import fr.free.nrw.commons.auth.LoginActivity;
|
||||||
import fr.free.nrw.commons.contributions.ContributionsSyncAdapter;
|
import fr.free.nrw.commons.contributions.ContributionsSyncAdapter;
|
||||||
import fr.free.nrw.commons.modifications.ModificationsSyncAdapter;
|
import fr.free.nrw.commons.modifications.ModificationsSyncAdapter;
|
||||||
import fr.free.nrw.commons.settings.SettingsFragment;
|
import fr.free.nrw.commons.settings.SettingsFragment;
|
||||||
import fr.free.nrw.commons.nearby.DirectUpload;
|
|
||||||
import fr.free.nrw.commons.nearby.PlaceRenderer;
|
import fr.free.nrw.commons.nearby.PlaceRenderer;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
|
|
@ -40,7 +39,6 @@ public interface CommonsApplicationComponent extends AndroidInjector<Application
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
void inject(ApplicationlessInjection instance);
|
void inject(ApplicationlessInjection instance);
|
||||||
void inject(DirectUpload directUpload);
|
|
||||||
void inject(PlaceRenderer placeRenderer);
|
void inject(PlaceRenderer placeRenderer);
|
||||||
|
|
||||||
@Component.Builder
|
@Component.Builder
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@ public class CommonsApplicationModule {
|
||||||
public static final String CATEGORY_AUTHORITY = "fr.free.nrw.commons.categories.contentprovider";
|
public static final String CATEGORY_AUTHORITY = "fr.free.nrw.commons.categories.contentprovider";
|
||||||
public static final long OK_HTTP_CACHE_SIZE = 10 * 1024 * 1024;
|
public static final long OK_HTTP_CACHE_SIZE = 10 * 1024 * 1024;
|
||||||
|
|
||||||
private CommonsApplication application;
|
|
||||||
private Context applicationContext;
|
private Context applicationContext;
|
||||||
|
|
||||||
public CommonsApplicationModule(Context applicationContext) {
|
public CommonsApplicationModule(Context applicationContext) {
|
||||||
|
|
@ -88,13 +87,13 @@ public class CommonsApplicationModule {
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Named("direct_nearby_upload_prefs")
|
@Named("direct_nearby_upload_prefs")
|
||||||
public SharedPreferences providesDirectNearbyUploadPreferences() {
|
public SharedPreferences providesDirectNearbyUploadPreferences(Context context) {
|
||||||
return application.getSharedPreferences("direct_nearby_upload_prefs", MODE_PRIVATE);
|
return context.getSharedPreferences("direct_nearby_upload_prefs", MODE_PRIVATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
public UploadController providesUploadController(SessionManager sessionManager, @Named("default_preferences") SharedPreferences sharedPreferences) {
|
public UploadController providesUploadController(SessionManager sessionManager, @Named("default_preferences") SharedPreferences sharedPreferences, Context context) {
|
||||||
return new UploadController(sessionManager, application, sharedPreferences);
|
return new UploadController(sessionManager, context, sharedPreferences);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@ public class PlaceRenderer extends Renderer<Place> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render() {
|
public void render() {
|
||||||
((CommonsApplication) getContext().getApplicationContext()).injector().inject(this);
|
// ((CommonsApplication) getContext().getApplicationContext()).injector().inject(this);
|
||||||
place = getContent();
|
place = getContent();
|
||||||
tvName.setText(place.name);
|
tvName.setText(place.name);
|
||||||
String descriptionText = place.getLongDescription();
|
String descriptionText = place.getLongDescription();
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package fr.free.nrw.commons.upload;
|
package fr.free.nrw.commons.upload;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue