Skip to content

Commit

Permalink
#3408 Refactoring the FileProcessor and GPSExtractor classes (#3543)
Browse files Browse the repository at this point in the history
* #3408 Refactoring the FileProcessor and GPSExtractor classes - refactor FileProcessor

* #3408 Refactoring the FileProcessor and GPSExtractor classes - refactor and rename GpsExtractor

* #3408 Refactoring the FileProcessor and GPSExtractor classes - convert ImageCoordinates to kotlin

* #3408 Refactoring the FileProcessor and GPSExtractor classes - convert FileProcessor to kotlin

* #3408 Refactoring the FileProcessor and GPSExtractor classes - minor reformatting

* #3408 Refactoring the FileProcessor and GPSExtractor classes - fix compilation and naming issues

* #3408 Refactoring the FileProcessor and GPSExtractor classes - remove empty test

* #3408 Refactoring the FileProcessor and GPSExtractor classes - set coordinates for upload item if user chooses it
  • Loading branch information
macgills authored Mar 20, 2020
1 parent efc6fa6 commit fb51fc6
Show file tree
Hide file tree
Showing 17 changed files with 449 additions and 833 deletions.
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

0 comments on commit fb51fc6

Please sign in to comment.