mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 13:53:54 +01:00
ResponseListener changed to non static
To be able to access non static setRadius() method of MwVolley
This commit is contained in:
parent
021c17166a
commit
a967ecfce4
2 changed files with 9 additions and 6 deletions
|
|
@ -26,7 +26,7 @@ public class MwVolley {
|
|||
private String coords;
|
||||
private static final String MWURL = "https://commons.wikimedia.org/";
|
||||
private String apiUrl;
|
||||
private int radius;
|
||||
private int radius = 100;
|
||||
private Gson GSON;
|
||||
|
||||
protected Set<String> categorySet;
|
||||
|
|
@ -83,7 +83,7 @@ public class MwVolley {
|
|||
radius = getRadius();
|
||||
apiUrl = buildUrl(radius);
|
||||
|
||||
ShareActivity.ResponseListener responseListener = new ShareActivity.ResponseListener();
|
||||
ShareActivity.ResponseListener responseListener = new ShareActivity().new ResponseListener();
|
||||
ShareActivity.ErrorListener errorListener = new ShareActivity.ErrorListener();
|
||||
|
||||
JsonRequest request = new QueryRequest(apiUrl, responseListener, errorListener);
|
||||
|
|
|
|||
|
|
@ -52,6 +52,8 @@ public class ShareActivity
|
|||
|
||||
private UploadController uploadController;
|
||||
|
||||
private MwVolley apiCall;
|
||||
|
||||
public ShareActivity() {
|
||||
super(WikiAccountAuthenticator.COMMONS_ACCOUNT_TYPE);
|
||||
}
|
||||
|
|
@ -195,7 +197,7 @@ public class ShareActivity
|
|||
Log.d("Image", "Coords of image: " + coords);
|
||||
|
||||
|
||||
MwVolleyApi apiCall = new MwVolleyApi(this, coords);
|
||||
apiCall = new MwVolley(this, coords);
|
||||
|
||||
//asynchronous calls to MediaWiki Commons API to match image coords with nearby Commons categories
|
||||
apiCall.request();
|
||||
|
|
@ -211,16 +213,17 @@ public class ShareActivity
|
|||
requestAuthToken();
|
||||
}
|
||||
|
||||
protected static class ResponseListener<T> implements Response.Listener<T>{
|
||||
protected class ResponseListener<T> implements Response.Listener<T>{
|
||||
@Override
|
||||
public void onResponse(T response){
|
||||
apiCall.setRadius(1000);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected static class ErrorListener implements Response.ErrorListener {
|
||||
protected class ErrorListener implements Response.ErrorListener {
|
||||
|
||||
private static final String TAG = ErrorListener.class.getName();
|
||||
private final String TAG = ErrorListener.class.getName();
|
||||
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue