mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-11-04 08:43:52 +01:00 
			
		
		
		
	Copy onPositiveResponse() etc to FileProcessor
This commit is contained in:
		
							parent
							
								
									db6ade0d1e
								
							
						
					
					
						commit
						47f7ee6849
					
				
					 2 changed files with 17 additions and 17 deletions
				
			
		| 
						 | 
				
			
			@ -26,7 +26,7 @@ import timber.log.Timber;
 | 
			
		|||
 | 
			
		||||
import static com.mapbox.mapboxsdk.Mapbox.getApplicationContext;
 | 
			
		||||
 | 
			
		||||
public class FileProcessor {
 | 
			
		||||
public class FileProcessor implements SimilarImageDialogFragment.onResponse{
 | 
			
		||||
 | 
			
		||||
    private Uri mediaUri;
 | 
			
		||||
    private ContentResolver contentResolver;
 | 
			
		||||
| 
						 | 
				
			
			@ -38,6 +38,7 @@ public class FileProcessor {
 | 
			
		|||
    private String filePath;
 | 
			
		||||
    private boolean useExtStorage;
 | 
			
		||||
    private boolean cacheFound;
 | 
			
		||||
    private GPSExtractor tempImageObj;
 | 
			
		||||
 | 
			
		||||
    @Inject
 | 
			
		||||
    CacheController cacheController;
 | 
			
		||||
| 
						 | 
				
			
			@ -123,7 +124,7 @@ public class FileProcessor {
 | 
			
		|||
        File folder = new File(filePath.substring(0,filePath.lastIndexOf('/')));
 | 
			
		||||
        File[] files = folder.listFiles();
 | 
			
		||||
        Timber.d("folderTime Number:"+files.length);
 | 
			
		||||
        GPSExtractor tempImageObj;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        for(File file : files){
 | 
			
		||||
            if(file.lastModified()-timeOfCreation<=(120*1000) && file.lastModified()-timeOfCreation>=-(120*1000)){
 | 
			
		||||
| 
						 | 
				
			
			@ -217,4 +218,17 @@ public class FileProcessor {
 | 
			
		|||
        detectUnwantedPicturesAsync.execute();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void onPositiveResponse() {
 | 
			
		||||
        imageObj = tempImageObj;
 | 
			
		||||
        decimalCoords = imageObj.getCoords(false);// Not necessary to use gps as image already ha EXIF data
 | 
			
		||||
        Timber.d("EXIF from tempImageObj");
 | 
			
		||||
        useImageCoords();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void onNegativeResponse() {
 | 
			
		||||
        Timber.d("EXIF from imageObj");
 | 
			
		||||
        useImageCoords();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -78,7 +78,7 @@ import static fr.free.nrw.commons.upload.FileUtils.getSHA1;
 | 
			
		|||
public class ShareActivity
 | 
			
		||||
        extends AuthenticatedActivity
 | 
			
		||||
        implements SingleUploadFragment.OnUploadActionInitiated,
 | 
			
		||||
        OnCategoriesSaveHandler,SimilarImageDialogFragment.onResponse {
 | 
			
		||||
        OnCategoriesSaveHandler {
 | 
			
		||||
 | 
			
		||||
    private static final int REQUEST_PERM_ON_CREATE_STORAGE = 1;
 | 
			
		||||
    private static final int REQUEST_PERM_ON_CREATE_LOCATION = 2;
 | 
			
		||||
| 
						 | 
				
			
			@ -462,20 +462,6 @@ public class ShareActivity
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    //I might not be supposed to change it, but still, I saw it
 | 
			
		||||
    @Override
 | 
			
		||||
    public void onPositiveResponse() {
 | 
			
		||||
        imageObj = tempImageObj;
 | 
			
		||||
        decimalCoords = imageObj.getCoords(false);// Not necessary to use gps as image already ha EXIF data
 | 
			
		||||
        Timber.d("EXIF from tempImageObj");
 | 
			
		||||
        fileObj.useImageCoords();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void onNegativeResponse() {
 | 
			
		||||
        Timber.d("EXIF from imageObj");
 | 
			
		||||
        fileObj.useImageCoords();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void onPause() {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue