mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Merge pull request #296 from misaochan/fix-gpsextractor-2
Fix GPS categories not displaying due to no args constructor error
This commit is contained in:
commit
6b75bd19f7
6 changed files with 17 additions and 21 deletions
|
|
@ -24,7 +24,7 @@ public class NearbyActivity extends AppCompatActivity {
|
|||
private double currentLatitude, currentLongitude;
|
||||
//private String gpsCoords;
|
||||
|
||||
private static final String TAG = "NearbyActivity";
|
||||
private static final String TAG = NearbyActivity.class.getName();
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public class NearbyListFragment extends ListFragment implements TaskListener {
|
|||
private List<Place> places;
|
||||
private LatLng mLatestLocation;
|
||||
|
||||
private static final String TAG = "NearbyListFragment";
|
||||
private static final String TAG = NearbyListFragment.class.getName();
|
||||
|
||||
public NearbyListFragment() {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import java.util.List;
|
|||
|
||||
public class NearbyPlaces {
|
||||
|
||||
private static final String TAG = "NearbyPlaces";
|
||||
private static final String TAG = NearbyPlaces.class.getName();
|
||||
static List<Place> places = null;
|
||||
|
||||
public static List<Place> get() {
|
||||
|
|
|
|||
|
|
@ -98,10 +98,10 @@ public class GPSExtractor {
|
|||
try {
|
||||
exif = new ExifInterface(filePath);
|
||||
} catch (IOException e) {
|
||||
Log.w("Image", e);
|
||||
Log.w(TAG, e);
|
||||
return null;
|
||||
} catch (IllegalArgumentException e) {
|
||||
Log.w("Image", e);
|
||||
Log.w(TAG, e);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -136,8 +136,8 @@ public class GPSExtractor {
|
|||
longitude_ref = exif.getAttribute(ExifInterface.TAG_GPS_LONGITUDE_REF);
|
||||
|
||||
if (latitude!=null && latitude_ref!=null && longitude!=null && longitude_ref!=null) {
|
||||
Log.d("Image", "Latitude: " + latitude + " " + latitude_ref);
|
||||
Log.d("Image", "Longitude: " + longitude + " " + longitude_ref);
|
||||
Log.d(TAG, "Latitude: " + latitude + " " + latitude_ref);
|
||||
Log.d(TAG, "Longitude: " + longitude + " " + longitude_ref);
|
||||
|
||||
decimalCoords = getDecimalCoords(latitude, latitude_ref, longitude, longitude_ref);
|
||||
return decimalCoords;
|
||||
|
|
@ -201,7 +201,7 @@ public class GPSExtractor {
|
|||
}
|
||||
|
||||
String decimalCoords = String.valueOf(decLatitude) + "|" + String.valueOf(decLongitude);
|
||||
Log.d("Coords", "Latitude and Longitude are " + decimalCoords);
|
||||
Log.d(TAG, "Latitude and Longitude are " + decimalCoords);
|
||||
return decimalCoords;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public class MwVolleyApi {
|
|||
public void request(String coords) {
|
||||
coordsLog = coords;
|
||||
String apiUrl = buildUrl(coords);
|
||||
Log.d("Image", "URL: " + apiUrl);
|
||||
Log.d(TAG, "URL: " + apiUrl);
|
||||
|
||||
JsonRequest<QueryResponse> request = new QueryRequest(apiUrl,
|
||||
new LogResponseListener<QueryResponse>(), new LogResponseErrorListener());
|
||||
|
|
@ -108,7 +108,6 @@ public class MwVolleyApi {
|
|||
}
|
||||
|
||||
private static class LogResponseListener<T> implements Response.Listener<T> {
|
||||
private static final String TAG = LogResponseListener.class.getName();
|
||||
|
||||
@Override
|
||||
public void onResponse(T response) {
|
||||
|
|
@ -117,7 +116,6 @@ public class MwVolleyApi {
|
|||
}
|
||||
|
||||
private static class LogResponseErrorListener implements Response.ErrorListener {
|
||||
private static final String TAG = LogResponseErrorListener.class.getName();
|
||||
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
|
|
@ -208,11 +206,10 @@ public class MwVolleyApi {
|
|||
} else {
|
||||
return "No pages found";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private static class Page {
|
||||
public static class Page {
|
||||
private int pageid;
|
||||
private int ns;
|
||||
private String title;
|
||||
|
|
@ -220,7 +217,6 @@ public class MwVolleyApi {
|
|||
private Category category;
|
||||
|
||||
public Page() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -247,15 +243,15 @@ public class MwVolleyApi {
|
|||
}
|
||||
}
|
||||
|
||||
private static class Category {
|
||||
private String title;
|
||||
private static class Category {
|
||||
private String title;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return title;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return title;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public class SingleUploadFragment extends Fragment {
|
|||
|
||||
private OnUploadActionInitiated uploadActionInitiatedHandler;
|
||||
|
||||
private static final String TAG = "SingleUploadFragment";
|
||||
private static final String TAG = SingleUploadFragment.class.getName();
|
||||
|
||||
@Override
|
||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue