Skip to content

Commit

Permalink
this is test commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dharmeshmp committed Mar 5, 2016
1 parent 50ff953 commit 85c0532
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 15 additions & 3 deletions volley/src/main/java/com/initfusion/volley/RequestCreator.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.initfusion.volley;

import android.app.ProgressDialog;

import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
Expand All @@ -18,6 +16,7 @@ public class RequestCreator<ResponseType> {
private JsonRequest.ResponseListener callback;
private Class responseClass;
private RequestQueue queue;
private JSONObject rowJsonBody;

private String url;

Expand All @@ -36,13 +35,22 @@ public RequestCreator setResponseClass(Class responseClass) {
return this;
}

public RequestCreator setRowJsonBody(JSONObject rowJsonBody) {
this.rowJsonBody = rowJsonBody;
return this;
}

public void execute()
{
if(responseClass==null)
responseClass = Object.class;


if(rowJsonBody == null)
rowJsonBody = new JSONObject();

JacksonRequest<ResponseType> jsonObjReq = new JacksonRequest<ResponseType>(
Request.Method.GET, url, null, new JSONObject(), responseClass,
Request.Method.GET, url, null, rowJsonBody, responseClass,
createMyReqSuccessListener(), createMyReqErrorListener()) {
};

Expand All @@ -61,6 +69,8 @@ public void onResponse(ResponseType response) {
};
}



private Response.ErrorListener createMyReqErrorListener() {
return new Response.ErrorListener() {
@Override
Expand All @@ -71,4 +81,6 @@ public void onErrorResponse(VolleyError error) {
}
};
}


}

0 comments on commit 85c0532

Please sign in to comment.