Refactoring

This commit is contained in:
misaochan 2016-01-03 14:29:47 +13:00
parent c60c886708
commit 4b4356b0f0
3 changed files with 18 additions and 9 deletions

View file

@ -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();
}
}

View file

@ -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

View file

@ -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);
}
}