// Path: AuthProject/app/src/main/java/com/zhy/authproject/dialog/ProgressCancelListener.java
// public interface ProgressCancelListener {
//     void onCancelProgress();
// }
// 
// Path: AuthProject/app/src/main/java/com/zhy/authproject/dialog/ProgressDialogHandler.java
// public class ProgressDialogHandler extends Handler {
// 
//     public static final int SHOW_PROGRESS_DIALOG = 1;
//     public static final int DISMISS_PROGRESS_DIALOG = 2;
// 
//     private Dialog pd;
// 
//     private Context context;
//     private boolean cancelable;
//     private ProgressCancelListener mProgressCancelListener;
// 
//     AnimationDrawable drawable;
//     ImageView imageView;
// 
//     Dialog loadingDialog;
//     public ProgressDialogHandler(Context context, ProgressCancelListener mProgressCancelListener,
//                                  boolean cancelable) {
//         super();
//         this.context = context;
//         this.mProgressCancelListener = mProgressCancelListener;
//         this.cancelable = cancelable;
//     }
// 
// 
//     private void dismissProgressDialog(){
//         if (loadingDialog != null) {
//             loadingDialog.dismiss();
//         }
//     }
// 
// 
//     public void handleMessage(Message msg) {
//         switch (msg.what) {
//             case SHOW_PROGRESS_DIALOG:
//                 initProgressDialog();
//                 break;
//             case DISMISS_PROGRESS_DIALOG:
//                 dismissProgressDialog();
//                 break;
//         }
//     }
// 
//     private void initProgressDialog() {
//         LayoutInflater inflater = LayoutInflater.from(context);
//         View v = inflater.inflate(R.layout.loader_base_loading, null);        // 得到加载view
//         FrameLayout layout = (FrameLayout) v.findViewById(R.id.id_loading_and_retry);
// 
//         imageView = (ImageView) v.findViewById(R.id.imageView);  // 加载布局
//         drawable = (AnimationDrawable) imageView.getBackground();
//         drawable.start();
// 
//          loadingDialog = new Dialog(context, R.style.loading_dialog); // 创建自定义样式dialog
//         // loadingDialog.setCancelable(true);// 不可以用"返回键"取消
//         loadingDialog.setContentView(layout, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
//                 LinearLayout.LayoutParams.WRAP_CONTENT));
//         loadingDialog.show();
//     }
// }


import android.app.Application;
import android.content.Context;
import android.widget.Toast;
import com.zhy.authproject.dialog.ProgressCancelListener;
import com.zhy.authproject.dialog.ProgressDialogHandler;
import java.net.ConnectException;
import java.net.SocketTimeoutException;
import rx.Subscriber;
package com.zhy.authproject.data.remote;





/**
 * Created by zhanghaoye on 10/29/16.
 */

public class ExceptionSubscriber<T> extends Subscriber<T> implements ProgressCancelListener{

    private SimpleCallback<T> simpleCallback;
    private Application application;

// Path: AuthProject/app/src/main/java/com/zhy/authproject/dialog/ProgressCancelListener.java
// public interface ProgressCancelListener {
//     void onCancelProgress();
// }
// 
// Path: AuthProject/app/src/main/java/com/zhy/authproject/dialog/ProgressDialogHandler.java
// public class ProgressDialogHandler extends Handler {
// 
//     public static final int SHOW_PROGRESS_DIALOG = 1;
//     public static final int DISMISS_PROGRESS_DIALOG = 2;
// 
//     private Dialog pd;
// 
//     private Context context;
//     private boolean cancelable;
//     private ProgressCancelListener mProgressCancelListener;
// 
//     AnimationDrawable drawable;
//     ImageView imageView;
// 
//     Dialog loadingDialog;
//     public ProgressDialogHandler(Context context, ProgressCancelListener mProgressCancelListener,
//                                  boolean cancelable) {
//         super();
//         this.context = context;
//         this.mProgressCancelListener = mProgressCancelListener;
//         this.cancelable = cancelable;
//     }
// 
// 
//     private void dismissProgressDialog(){
//         if (loadingDialog != null) {
//             loadingDialog.dismiss();
//         }
//     }
// 
// 
//     public void handleMessage(Message msg) {
//         switch (msg.what) {
//             case SHOW_PROGRESS_DIALOG:
//                 initProgressDialog();
//                 break;
//             case DISMISS_PROGRESS_DIALOG:
//                 dismissProgressDialog();
//                 break;
//         }
//     }
// 
//     private void initProgressDialog() {
//         LayoutInflater inflater = LayoutInflater.from(context);
//         View v = inflater.inflate(R.layout.loader_base_loading, null);        // 得到加载view
//         FrameLayout layout = (FrameLayout) v.findViewById(R.id.id_loading_and_retry);
// 
//         imageView = (ImageView) v.findViewById(R.id.imageView);  // 加载布局
//         drawable = (AnimationDrawable) imageView.getBackground();
//         drawable.start();
// 
//          loadingDialog = new Dialog(context, R.style.loading_dialog); // 创建自定义样式dialog
//         // loadingDialog.setCancelable(true);// 不可以用"返回键"取消
//         loadingDialog.setContentView(layout, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
//                 LinearLayout.LayoutParams.WRAP_CONTENT));
//         loadingDialog.show();
//     }
// }


// Path: AuthProject/app/src/main/java/com/zhy/authproject/data/remote/ExceptionSubscriber.java
import android.app.Application;
import android.content.Context;
import android.widget.Toast;
import com.zhy.authproject.dialog.ProgressCancelListener;
import com.zhy.authproject.dialog.ProgressDialogHandler;
import java.net.ConnectException;
import java.net.SocketTimeoutException;
import rx.Subscriber;

package com.zhy.authproject.data.remote;





/**
 * Created by zhanghaoye on 10/29/16.
 */

public class ExceptionSubscriber<T> extends Subscriber<T> implements ProgressCancelListener{

    private SimpleCallback<T> simpleCallback;
    private Application application;

    private ProgressDialogHandler mProgressDialogHandler;