use of com.vondear.rxtools.view.dialog.RxDialogSure in project RxTools by vondear.
the class ActivityDialog method onClick.
@OnClick({ R.id.button_DialogScaleView, R.id.button_DialogLoadingspinkit, R.id.button_tran, R.id.button_DialogSure, R.id.button_DialogSureCancle, R.id.button_DialogEditTextSureCancle, R.id.button_DialogWheelYearMonthDay, R.id.button_DialogShapeLoading, R.id.button_DialogLoadingProgressAcfunVideo })
public void onClick(View view) {
switch(view.getId()) {
case R.id.button_tran:
RxDialog rxDialog = new RxDialog(mContext, R.style.tran_dialog);
View view1 = LayoutInflater.from(mContext).inflate(R.layout.image, null);
ImageView pageItem = (ImageView) view1.findViewById(R.id.page_item);
pageItem.setImageResource(R.drawable.coin);
rxDialog.setContentView(view1);
rxDialog.show();
break;
case R.id.button_DialogSure:
// 提示弹窗
final RxDialogSure rxDialogSure = new RxDialogSure(mContext);
rxDialogSure.getLogoView().setImageResource(R.drawable.logo);
rxDialogSure.getSureView().setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
rxDialogSure.cancel();
}
});
rxDialogSure.show();
break;
case R.id.button_DialogSureCancle:
// 提示弹窗
final RxDialogSureCancel rxDialogSureCancel = new RxDialogSureCancel(mContext);
rxDialogSureCancel.getTitleView().setBackgroundResource(R.drawable.logo);
rxDialogSureCancel.getSureView().setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
rxDialogSureCancel.cancel();
}
});
rxDialogSureCancel.getCancelView().setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
rxDialogSureCancel.cancel();
}
});
rxDialogSureCancel.show();
break;
case R.id.button_DialogEditTextSureCancle:
// 提示弹窗
final RxDialogEditSureCancel rxDialogEditSureCancel = new RxDialogEditSureCancel(mContext);
rxDialogEditSureCancel.getTitleView().setBackgroundResource(R.drawable.logo);
rxDialogEditSureCancel.getSureView().setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
rxDialogEditSureCancel.cancel();
}
});
rxDialogEditSureCancel.getCancelView().setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
rxDialogEditSureCancel.cancel();
}
});
rxDialogEditSureCancel.show();
break;
case R.id.button_DialogWheelYearMonthDay:
if (mRxDialogWheelYearMonthDay == null) {
initWheelYearMonthDayDialog();
}
mRxDialogWheelYearMonthDay.show();
break;
case R.id.button_DialogShapeLoading:
RxDialogShapeLoading rxDialogShapeLoading = new RxDialogShapeLoading(this);
rxDialogShapeLoading.show();
break;
case R.id.button_DialogLoadingProgressAcfunVideo:
new RxDialogAcfunVideoLoading(this).show();
break;
case R.id.button_DialogLoadingspinkit:
RxDialogLoading rxDialogLoading = new RxDialogLoading(mContext);
rxDialogLoading.show();
// rxDialogLoading.cancel(RxDialogLoading.RxCancelType.error,"");
break;
case R.id.button_DialogScaleView:
RxDialogScaleView rxDialogScaleView = new RxDialogScaleView(mContext);
rxDialogScaleView.setImageAssets("squirrel.jpg");
rxDialogScaleView.show();
break;
default:
break;
}
}
use of com.vondear.rxtools.view.dialog.RxDialogSure in project RxTools by vondear.
the class ActivityScanerCode method initDialogResult.
// ==============================================================================================解析结果 及 后续处理 end
private void initDialogResult(Result result) {
BarcodeFormat type = result.getBarcodeFormat();
String realContent = result.getText();
if (rxDialogSure == null) {
// 提示弹窗
rxDialogSure = new RxDialogSure(mContext);
}
if (BarcodeFormat.QR_CODE.equals(type)) {
rxDialogSure.setTitle("二维码扫描结果");
} else if (BarcodeFormat.EAN_13.equals(type)) {
rxDialogSure.setTitle("条形码扫描结果");
} else {
rxDialogSure.setTitle("扫描结果");
}
rxDialogSure.setContent(realContent);
rxDialogSure.setSureListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
rxDialogSure.cancel();
}
});
rxDialogSure.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
if (handler != null) {
// 连续扫描,不发送此消息扫描一次结束后就不能再次扫描
handler.sendEmptyMessage(R.id.restart_preview);
}
}
});
if (!rxDialogSure.isShowing()) {
rxDialogSure.show();
}
RxSPTool.putContent(mContext, RxConstants.SP_SCAN_CODE, RxDataTool.stringToInt(RxSPTool.getContent(mContext, RxConstants.SP_SCAN_CODE)) + 1 + "");
}
Aggregations