mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 13:53:54 +01:00
Added GpsCatExists and QueryResponse
This commit is contained in:
parent
a967ecfce4
commit
93b30bce76
2 changed files with 21 additions and 6 deletions
|
|
@ -84,7 +84,7 @@ public class MwVolley {
|
|||
apiUrl = buildUrl(radius);
|
||||
|
||||
ShareActivity.ResponseListener responseListener = new ShareActivity().new ResponseListener();
|
||||
ShareActivity.ErrorListener errorListener = new ShareActivity.ErrorListener();
|
||||
ShareActivity.ErrorListener errorListener = new ShareActivity().new ErrorListener();
|
||||
|
||||
JsonRequest request = new QueryRequest(apiUrl, responseListener, errorListener);
|
||||
VolleyRequestQueue.getInstance(context).addToRequestQueue(request);
|
||||
|
|
@ -116,17 +116,18 @@ public class MwVolley {
|
|||
}
|
||||
}
|
||||
|
||||
private static class QueryResponse {
|
||||
private class QueryResponse {
|
||||
private Query query = new Query();
|
||||
|
||||
private String printSet() {
|
||||
GpsCatExists gpsCatExists = new GpsCatExists();
|
||||
if (categorySet == null || categorySet.isEmpty()) {
|
||||
GpsCatExists.setGpsCatExists(false);
|
||||
Log.d("Cat", "gpsCatExists=" + GpsCatExists.getGpsCatExists());
|
||||
gpsCatExists.setGpsCatExists(false);
|
||||
Log.d("Cat", "gpsCatExists=" + gpsCatExists.getGpsCatExists());
|
||||
return "No collection of categories";
|
||||
} else {
|
||||
GpsCatExists.setGpsCatExists(true);
|
||||
Log.d("Cat", "gpsCatExists=" + GpsCatExists.getGpsCatExists());
|
||||
gpsCatExists.setGpsCatExists(true);
|
||||
Log.d("Cat", "gpsCatExists=" + gpsCatExists.getGpsCatExists());
|
||||
return "CATEGORIES FOUND" + categorySet.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -141,6 +142,18 @@ public class MwVolley {
|
|||
}
|
||||
}
|
||||
|
||||
public class GpsCatExists {
|
||||
private boolean gpsCatExists;
|
||||
|
||||
public void setGpsCatExists(boolean gpsCat) {
|
||||
gpsCatExists = gpsCat;
|
||||
}
|
||||
|
||||
public boolean getGpsCatExists() {
|
||||
return gpsCatExists;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -214,8 +214,10 @@ public class ShareActivity
|
|||
}
|
||||
|
||||
protected class ResponseListener<T> implements Response.Listener<T>{
|
||||
|
||||
@Override
|
||||
public void onResponse(T response){
|
||||
//TODO get the radius, do logic, then set the radius to old radius * 10
|
||||
apiCall.setRadius(1000);
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue