Skip to content

#3408 Refactoring the FileProcessor and GPSExtractor classes #3543

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 20, 2020
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,13 @@

import android.app.Activity;
import android.content.ContentProviderClient;
import android.content.ContentResolver;
import android.content.Context;
import android.view.inputmethod.InputMethodManager;

import androidx.collection.LruCache;
import androidx.room.Room;

import com.github.varunpant.quadtree.QuadTree;
import com.google.gson.Gson;

import org.wikipedia.AppAdapter;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;

import javax.inject.Named;
import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;
import fr.free.nrw.commons.BuildConfig;
Expand All @@ -41,10 +28,18 @@
import io.reactivex.Scheduler;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import javax.inject.Named;
import javax.inject.Singleton;
import org.wikipedia.AppAdapter;

/**
* The Dependency Provider class for Commons Android.
*
* The Dependency Provider class for Commons Android.
*
* Provides all sorts of ContentProviderClients used by the app
* along with the Liscences, AccountUtility, UploadController, Logged User,
* Location manager etc
Expand Down Expand Up @@ -101,7 +96,7 @@ public AccountUtil providesAccountUtil(Context context) {
}

/**
* Provides an instance of CategoryContentProviderClient i.e. the categories
* Provides an instance of CategoryContentProviderClient i.e. the categories
* that are there in local storage
*/
@Provides
Expand Down Expand Up @@ -203,7 +198,7 @@ public boolean provideIsBetaVariant() {

/**
* Provide JavaRx IO scheduler which manages IO operations
* across various Threads
* across various Threads
*/
@Named(IO_THREAD)
@Provides
Expand Down Expand Up @@ -244,4 +239,9 @@ public AppDatabase provideAppDataBase() {
public ContributionDao providesContributionsDao() {
return appDatabase.getContributionDao();
}
}

@Provides
public ContentResolver providesContentResolver(Context context){
return context.getContentResolver();
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package fr.free.nrw.commons.repository;

import fr.free.nrw.commons.upload.ImageCoordinates;
import java.io.IOException;
import java.util.Comparator;
import java.util.List;
Expand Down Expand Up @@ -202,4 +203,8 @@ public Place getNearbyPlaces(double latitude, double longitude) {
return null;
}
}

public void useSimilarPictureCoordinates(ImageCoordinates imageCoordinates, int uploadItemIndex) {
uploadModel.useSimilarPictureCoordinates(imageCoordinates, uploadItemIndex);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package fr.free.nrw.commons.repository;

import fr.free.nrw.commons.upload.ImageCoordinates;
import java.util.Comparator;
import java.util.List;

Expand Down Expand Up @@ -271,4 +272,8 @@ public void setSelectedLicense(String licenseName) {
public Place checkNearbyPlaces(double decLatitude, double decLongitude) {
return remoteDataSource.getNearbyPlaces(decLatitude, decLongitude);
}

public void useSimilarPictureCoordinates(ImageCoordinates imageCoordinates, int uploadItemIndex) {
remoteDataSource.useSimilarPictureCoordinates(imageCoordinates, uploadItemIndex);
}
}
245 changes: 0 additions & 245 deletions app/src/main/java/fr/free/nrw/commons/upload/FileProcessor.java

This file was deleted.

Loading