mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Add comments to GPSExtractor
This commit is contained in:
parent
cb3a8bfa02
commit
f13cdc0485
2 changed files with 9 additions and 2 deletions
|
|
@ -16,4 +16,6 @@ public class NearbyActivity extends AppCompatActivity {
|
|||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
|
||||
//TODO: Get user's location
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,8 +80,8 @@ public class GPSExtractor {
|
|||
}
|
||||
|
||||
/**
|
||||
* Extracts geolocation of image from EXIF data.
|
||||
* @return coordinates of image as string (needs to be passed as a String in API query)
|
||||
* Extracts geolocation (either of image from EXIF data, or of user)
|
||||
* @return coordinates as string (needs to be passed as a String in API query)
|
||||
*/
|
||||
@Nullable
|
||||
public String getCoords(boolean useGPS) {
|
||||
|
|
@ -103,6 +103,7 @@ public class GPSExtractor {
|
|||
return null;
|
||||
}
|
||||
|
||||
//If image has no EXIF data and user has enabled GPS setting, get user's location
|
||||
if (exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE) == null && useGPS) {
|
||||
registerLocationManager();
|
||||
|
||||
|
|
@ -122,6 +123,7 @@ public class GPSExtractor {
|
|||
} else if (exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE) == null) {
|
||||
return null;
|
||||
} else {
|
||||
//If image has EXIF data, extract image coords
|
||||
imageCoordsExists = true;
|
||||
Log.d(TAG, "EXIF data has location info");
|
||||
|
||||
|
|
@ -142,6 +144,9 @@ public class GPSExtractor {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* LocationListener to obtain user's location
|
||||
*/
|
||||
private class MyLocationListener implements LocationListener {
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue