Optimize formatting and imports

This commit is contained in:
misaochan 2018-06-04 19:40:49 +10:00
parent 4e1bf80361
commit c9ae7176c0
2 changed files with 59 additions and 54 deletions

View file

@ -35,6 +35,15 @@ import static com.mapbox.mapboxsdk.Mapbox.getApplicationContext;
*/
public class FileProcessor implements SimilarImageDialogFragment.onResponse {
@Inject
CacheController cacheController;
@Inject
GpsCategoryModel gpsCategoryModel;
@Inject
CategoryApi apiCall;
@Inject
@Named("default_preferences")
SharedPreferences prefs;
private Uri mediaUri;
private ContentResolver contentResolver;
private GPSExtractor imageObj;
@ -46,16 +55,6 @@ public class FileProcessor implements SimilarImageDialogFragment.onResponse{
private boolean cacheFound;
private GPSExtractor tempImageObj;
@Inject
CacheController cacheController;
@Inject
GpsCategoryModel gpsCategoryModel;
@Inject
CategoryApi apiCall;
@Inject
@Named("default_preferences")
SharedPreferences prefs;
FileProcessor(Uri mediaUri, ContentResolver contentResolver, Context context) {
this.mediaUri = mediaUri;
this.contentResolver = contentResolver;
@ -67,6 +66,7 @@ public class FileProcessor implements SimilarImageDialogFragment.onResponse{
/**
* Gets file path from media URI.
* In older devices getPath() may fail depending on the source URI, creating and using a copy of the file seems to work instead.
*
* @return file path of media
*/
@Nullable
@ -97,6 +97,7 @@ public class FileProcessor implements SimilarImageDialogFragment.onResponse{
/**
* Processes file coordinates, either from EXIF data or user location
*
* @param gpsEnabled if true use GPS
*/
GPSExtractor processFileCoordinates(boolean gpsEnabled) {
@ -119,8 +120,7 @@ public class FileProcessor implements SimilarImageDialogFragment.onResponse{
//Find other photos taken around the same time which has gps coordinates
if (!haveCheckedForOtherImages)
findOtherImages(gpsEnabled);// Do not do repeat the process
}
else {
} else {
useImageCoords();
}
@ -136,6 +136,7 @@ public class FileProcessor implements SimilarImageDialogFragment.onResponse{
/**
* Find other images around the same location that were taken within the last 20 sec
*
* @param gpsEnabled True if GPS is enabled
*/
private void findOtherImages(boolean gpsEnabled) {

View file

@ -166,6 +166,7 @@ public class ShareActivity
/**
* Checks whether storage permissions need to be requested.
* Permissions are needed if the file is not owned by this application, (e.g. shared from the Gallery)
*
* @return true if file is not owned by this application and permission hasn't been granted beforehand
*/
@RequiresApi(16)
@ -211,6 +212,7 @@ public class ShareActivity
/**
* Send categories to modifications queue after they are selected
*
* @param categories categories selected
*/
@Override
@ -382,6 +384,7 @@ public class ShareActivity
/**
* Checks if upload was initiated via Nearby
*
* @return true if upload was initiated via Nearby
*/
protected boolean isNearbyUpload() {
@ -390,6 +393,7 @@ public class ShareActivity
/**
* Handles BOTH snackbar permission request (for location) and submit button permission request (for storage)
*
* @param requestCode type of request
* @param permissions permissions requested
* @param grantResults grant results