| | |
| | | |
| | | private ProgressDialog dialog; |
| | | public boolean isDestroy = false; |
| | | protected ViewHolder mHolder; |
| | | protected Context mContext;//上下文 |
| | | protected int mScreenWidth;//设备宽 |
| | | protected int mScreenHeight;//设备高 |
| | | public static final int REQUEST_NORMAL = 43214; |
| | |
| | | |
| | | mScreenHeight = DensityUtil.getDeviceHeight(this); |
| | | mScreenWidth = DensityUtil.getDeviceWidth(this); |
| | | mContext = this; |
| | | isDestroy = false; |
| | | mHolder = new ViewHolder(this); |
| | | |
| | | mNetChangeObserver = new NetChangeObserver() { |
| | | @Override |
| | |
| | | |
| | | } |
| | | |
| | | if (mHolder!=null){ |
| | | mHolder.unBind(); |
| | | } |
| | | isDestroy = true; |
| | | dismissDialog(); |
| | | if (!compositeSubscription.isDisposed()){ |
| | |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | protected <T extends View> T bind(int resId){ |
| | | return (T) mHolder.bind(resId); |
| | | return (T) findViewById(resId); |
| | | } |
| | | |
| | | /** |
| | |
| | | return; |
| | | } |
| | | if(dialog==null){ |
| | | dialog=new ProgressDialog(mContext,R.style.Theme_ProgressDialog); |
| | | dialog=new ProgressDialog(this,R.style.Theme_ProgressDialog); |
| | | } |
| | | dialog.setCanceledOnTouchOutside(canCancel); |
| | | dialog.setMessage(msg); |