Skip to content

Commit

Permalink
remove gif dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
Awais9 committed Oct 11, 2018
1 parent 217ab90 commit 6362adc
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class MainActivity : AppCompatActivity() {
private fun callService() {
var serviceName = baseURL + "login"
val networkController = NetworkController(this)
networkController.isShowLoadingDialog = true
val hashMap = HashMap<String, String>()
hashMap["email"] = "username"
hashMap["password"] = "password"
Expand Down
1 change: 0 additions & 1 deletion volleysinglecall/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,5 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.github.Awais9:gifloadingdialog:v1.2.2'
implementation 'org.greenrobot:eventbus:3.1.1'
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.awais.gifloadingdialog.LoadingDialog;
import com.company.volleysinglecall.network.VolleyResponse;
import com.google.gson.Gson;

Expand All @@ -33,13 +32,8 @@ public NetworkController(Context ctx) {
private int currentCount = 0;
private boolean finishActivity = false;
private boolean shouldLogout = false;
private boolean showLoadingDialog = false;
private boolean showDialog = true;

public LoadingDialog getLoadingDialog() {
return LoadingDialog.getInstance(context);
}

public boolean isFinishActivity() {
return finishActivity;
}
Expand All @@ -56,14 +50,6 @@ public void setShouldLogout(boolean shouldLogout) {
this.shouldLogout = shouldLogout;
}

public boolean isShowLoadingDialog() {
return showLoadingDialog;
}

public void setShowLoadingDialog(boolean showLoadingDialog) {
this.showLoadingDialog = showLoadingDialog;
}

public int getLogoutCount() {
return logoutCount;
}
Expand All @@ -85,18 +71,12 @@ public void setShowDialog(boolean showDialog) {
public <T> void callService(int requestType, String serviceName, final HashMap<String, String> hashMap,
final String tag, final Class<T> objectClass,
final VolleyResponse calls) {
if (isShowLoadingDialog()) {
getLoadingDialog().showDialog();
}
final VolleyQueue volleyQueue = VolleyQueue.getInstance(context);
StringRequest request = new StringRequest(requestType,
serviceName, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
currentCount = 0;
if (isShowLoadingDialog()) {
getLoadingDialog().hideDialog();
}
try {
JSONObject jsonObject = new JSONObject(response);
if (jsonObject.getInt("status") == 1) {
Expand All @@ -123,9 +103,6 @@ public void onResponse(String response) {
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
if (isShowLoadingDialog()) {
getLoadingDialog().hideDialog();
}
if (isShouldLogout()) {
if (currentCount < getLogoutCount()) {
currentCount++;
Expand Down

0 comments on commit 6362adc

Please sign in to comment.