mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-28 21:33:53 +01:00
Implemented check for null query, other minor changes
This commit is contained in:
parent
640ff499c6
commit
7273958b8e
5 changed files with 12 additions and 4 deletions
|
|
@ -33,7 +33,7 @@ public class GPSExtractor {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE) == null) {
|
if (exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE) == null) {
|
||||||
Log.w("Image", "Picture has no GPS info");
|
Log.d("Image", "Picture has no GPS info");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ public class MwVolleyApi {
|
||||||
private static RequestQueue REQUEST_QUEUE;
|
private static RequestQueue REQUEST_QUEUE;
|
||||||
private static final Gson GSON = new GsonBuilder().create();
|
private static final Gson GSON = new GsonBuilder().create();
|
||||||
private Context context;
|
private Context context;
|
||||||
|
private static String coordsLog;
|
||||||
|
|
||||||
protected static HashSet<String> categorySet;
|
protected static HashSet<String> categorySet;
|
||||||
|
|
||||||
|
|
@ -48,6 +49,7 @@ public class MwVolleyApi {
|
||||||
|
|
||||||
public void request(String coords) {
|
public void request(String coords) {
|
||||||
|
|
||||||
|
coordsLog = coords;
|
||||||
String apiUrl = buildUrl(coords);
|
String apiUrl = buildUrl(coords);
|
||||||
Log.d("Image", "URL: " + apiUrl);
|
Log.d("Image", "URL: " + apiUrl);
|
||||||
|
|
||||||
|
|
@ -162,8 +164,13 @@ public class MwVolleyApi {
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
if (query!=null) {
|
||||||
return "query=" + query.toString() + "\n" + printSet();
|
return "query=" + query.toString() + "\n" + printSet();
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
return "No pages found near " + coordsLog;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Query {
|
private static class Query {
|
||||||
|
|
|
||||||
|
|
@ -181,6 +181,7 @@ public class ShareActivity
|
||||||
|
|
||||||
if (filePath != null) {
|
if (filePath != null) {
|
||||||
//extract the coordinates of image in decimal degrees
|
//extract the coordinates of image in decimal degrees
|
||||||
|
Log.d("Image", "Calling GPSExtractor");
|
||||||
GPSExtractor imageObj = new GPSExtractor(filePath);
|
GPSExtractor imageObj = new GPSExtractor(filePath);
|
||||||
String coords = imageObj.getCoords();
|
String coords = imageObj.getCoords();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,7 @@ public class UploadController {
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(Contribution contribution) {
|
protected void onPostExecute(Contribution contribution) {
|
||||||
super.onPostExecute(contribution);
|
super.onPostExecute(contribution);
|
||||||
//uploadService.queue(UploadService.ACTION_UPLOAD_FILE, contribution);
|
uploadService.queue(UploadService.ACTION_UPLOAD_FILE, contribution);
|
||||||
onComplete.onUploadStarted(contribution);
|
onComplete.onUploadStarted(contribution);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue