mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-11-03 16:23:54 +01:00
Refactoring
This commit is contained in:
parent
c60c886708
commit
4b4356b0f0
3 changed files with 18 additions and 9 deletions
|
|
@ -1,7 +1,17 @@
|
|||
package fr.free.nrw.commons.upload;
|
||||
|
||||
/**
|
||||
* Created by misao on 03-Jan-16.
|
||||
*/
|
||||
import android.content.Context;
|
||||
import com.android.volley.RequestQueue;
|
||||
|
||||
|
||||
public class MwVolley {
|
||||
|
||||
public MwVolley(Context context) {
|
||||
|
||||
//Instantiate RequestQueue with Application context
|
||||
RequestQueue queue = VolleyRequestQueue.getInstance(this.getApplicationContext()).getRequestQueue();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package fr.free.nrw.commons.upload;
|
|||
import android.content.*;
|
||||
import android.os.*;
|
||||
|
||||
import com.android.volley.RequestQueue;
|
||||
import com.android.volley.Response;
|
||||
import com.nostra13.universalimageloader.core.ImageLoader;
|
||||
import android.net.*;
|
||||
|
|
@ -191,6 +192,8 @@ public class ShareActivity
|
|||
|
||||
if (coords != null) {
|
||||
Log.d("Image", "Coords of image: " + coords);
|
||||
|
||||
|
||||
MwVolleyApi apiCall = new MwVolleyApi(this, coords);
|
||||
|
||||
//asynchronous calls to MediaWiki Commons API to match image coords with nearby Commons categories
|
||||
|
|
|
|||
|
|
@ -1,17 +1,13 @@
|
|||
package fr.free.nrw.commons.upload;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.util.LruCache;
|
||||
|
||||
import com.android.volley.Request;
|
||||
import com.android.volley.RequestQueue;
|
||||
import com.android.volley.toolbox.ImageLoader;
|
||||
import com.android.volley.toolbox.Volley;
|
||||
|
||||
/**
|
||||
* Created by misao on 03-Jan-16.
|
||||
*/
|
||||
|
||||
public class VolleyRequestQueue {
|
||||
private static VolleyRequestQueue mInstance;
|
||||
private RequestQueue mRequestQueue;
|
||||
|
|
@ -42,5 +38,5 @@ public class VolleyRequestQueue {
|
|||
public <T> void addToRequestQueue(Request<T> req) {
|
||||
getRequestQueue().add(req);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue