| | |
| | | |
| | | Intent intent; |
| | | Context mContext; |
| | | DialogBack mDialogBack; |
| | | |
| | | public EdtDialog(Context context, Intent intent) { |
| | | super(context, R.style.ws_pay_showSelfDialog); |
| | | this.intent = intent; |
| | | mContext = context; |
| | | initView(); |
| | | } |
| | | |
| | | public EdtDialog(Context context, DialogBack dialogBack) { |
| | | super(context, R.style.ws_pay_showSelfDialog); |
| | | mContext = context; |
| | | mDialogBack=dialogBack; |
| | | initView(); |
| | | } |
| | | |
| | |
| | | textView.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | if (intent!=null){ |
| | | if (TextUtils.isEmpty(editText.getText().toString())) { |
| | | ToastUtil.show(mContext, "请输入序列号"); |
| | | } else { |
| | |
| | | |
| | | } |
| | | } |
| | | if (mDialogBack!=null){ |
| | | mDialogBack.onOk(editText.getText().toString()); |
| | | } |
| | | } |
| | | }); |
| | | cannel.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | if (mDialogBack!=null){ |
| | | mDialogBack.onCancel(); |
| | | } |
| | | EdtDialog.this.dismiss(); |
| | | } |
| | | }); |
| | |
| | | getWindow().setAttributes(layoutParams); |
| | | } |
| | | |
| | | public interface DialogBack { |
| | | void onOk(String data); |
| | | |
| | | void onCancel(); |
| | | } |
| | | } |