Skip to content

Commit

Permalink
call
Browse files Browse the repository at this point in the history
  • Loading branch information
Awais9 committed Oct 9, 2018
1 parent 19f5157 commit 2d93fd9
Showing 1 changed file with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,10 @@ public NetworkController(Context ctx) {
private boolean finishActivity = false;
private boolean shouldLogout = false;
private boolean showLoadingDialog = false;
private LoadingDialog loadingDialog;
private boolean showDialog = true;

public LoadingDialog getLoadingDialog() {
return loadingDialog;
}

public void setLoadingDialog(LoadingDialog loadingDialog) {
this.loadingDialog = loadingDialog;
return LoadingDialog.getInstance(context);
}

public boolean isFinishActivity() {
Expand Down Expand Up @@ -91,8 +86,7 @@ public <T> void callService(int requestType, String serviceName, final HashMap<S
final String tag, final Class<T> objectClass,
final VolleyResponse calls) {
if (isShowLoadingDialog()) {
loadingDialog = LoadingDialog.getInstance(context);
loadingDialog.showDialog();
getLoadingDialog().showDialog();
}
final VolleyQueue volleyQueue = VolleyQueue.getInstance(context);
StringRequest request = new StringRequest(requestType,
Expand All @@ -101,7 +95,7 @@ public <T> void callService(int requestType, String serviceName, final HashMap<S
public void onResponse(String response) {
currentCount = 0;
if (isShowLoadingDialog()) {
loadingDialog.hideDialog();
getLoadingDialog().hideDialog();
}
try {
JSONObject jsonObject = new JSONObject(response);
Expand Down Expand Up @@ -130,7 +124,7 @@ public void onResponse(String response) {
@Override
public void onErrorResponse(VolleyError error) {
if (isShowLoadingDialog()) {
loadingDialog.hideDialog();
getLoadingDialog().hideDialog();
}
if (isShouldLogout()) {
if (currentCount < getLogoutCount()) {
Expand Down

0 comments on commit 2d93fd9

Please sign in to comment.