Commit 2dcd04f9 authored by zhang_z's avatar zhang_z

Merge remote-tracking branch 'origin/master'

parents 094b38f6 49cd5cf6
...@@ -55,6 +55,8 @@ public abstract class BaseDialog<P extends BasePresenter, B extends ViewDataBind ...@@ -55,6 +55,8 @@ public abstract class BaseDialog<P extends BasePresenter, B extends ViewDataBind
public boolean isShowing; public boolean isShowing;
private long recLen = -1; private long recLen = -1;
private boolean shutDown = false; private boolean shutDown = false;
//强制关闭时间
long time = 0;
static { static {
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
...@@ -302,17 +304,23 @@ public abstract class BaseDialog<P extends BasePresenter, B extends ViewDataBind ...@@ -302,17 +304,23 @@ public abstract class BaseDialog<P extends BasePresenter, B extends ViewDataBind
} }
} }
/** /**
* 强制关闭dialog * 强制关闭dialog
*/ */
public void toughDismiss() { public void toughDismiss() {
if (shutDown) { if (shutDown) {
if (recLen <= 0) { if (System.currentTimeMillis() - time < 500) {
dismiss(); dismiss();
} else { } else {
ToastUtils.showLong(recLen + "s 后可关闭"); if (recLen <= 0) {
dismiss();
} else {
ToastUtils.showLong(recLen + "s 后可关闭,双击返回按钮可强制关闭");
}
} }
time = System.currentTimeMillis();
} }
} }
...@@ -343,5 +351,4 @@ public abstract class BaseDialog<P extends BasePresenter, B extends ViewDataBind ...@@ -343,5 +351,4 @@ public abstract class BaseDialog<P extends BasePresenter, B extends ViewDataBind
mBaseBinding.btnConfirm.setText(OK); mBaseBinding.btnConfirm.setText(OK);
return this; return this;
} }
} }
\ No newline at end of file
...@@ -259,11 +259,11 @@ public class Cs implements BaseOrderPrint, com.xingdata.zzdpos.base.BaseBean { ...@@ -259,11 +259,11 @@ public class Cs implements BaseOrderPrint, com.xingdata.zzdpos.base.BaseBean {
} }
public String getOperName() { public String getOperName() {
if (operName == null) { // if (operName == null) {
operName = DB.getInstance().get(InventoryPresenter.class).where(Oper.class) // operName = DB.getInstance().get(InventoryPresenter.class).where(Oper.class)
.equalTo("operId", getCreateOperId()) // .equalTo("operId", getCreateOperId())
.findFirst().getOperName(); // .findFirst().getOperName();
} // }
return operName; return operName;
} }
@Override @Override
......
...@@ -31,10 +31,10 @@ public class LoadingDialog extends BaseDialog<BasePresenter, DialogLoadingBindin ...@@ -31,10 +31,10 @@ public class LoadingDialog extends BaseDialog<BasePresenter, DialogLoadingBindin
this.getDialog().setOnKeyListener(new DialogInterface.OnKeyListener() { this.getDialog().setOnKeyListener(new DialogInterface.OnKeyListener() {
@Override @Override
public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) {
if (i == keyEvent.KEYCODE_BACK) { if (i == keyEvent.KEYCODE_BACK && keyEvent.getAction() == KeyEvent.ACTION_DOWN) {
toughDismiss(); toughDismiss();
} }
return true; return false;
} }
}); });
} }
......
...@@ -26,7 +26,9 @@ public class InventoryAdapter extends BaseAdapter<Cs, ItemInventoryBinding> { ...@@ -26,7 +26,9 @@ public class InventoryAdapter extends BaseAdapter<Cs, ItemInventoryBinding> {
@Override @Override
protected void convert(ItemInventoryBinding mViewBinding, Cs item) { protected void convert(ItemInventoryBinding mViewBinding, Cs item) {
mViewBinding.tvName.setText(item.getOperName()); if (item.getOperName() != null) {
mViewBinding.tvName.setText(item.getOperName());
}
mViewBinding.tvPhone.setText(item.getOper_mobile()); mViewBinding.tvPhone.setText(item.getOper_mobile());
mViewBinding.tvDate.setText(TimeUtils.millis2String(item.getCreateTime()) + ""); mViewBinding.tvDate.setText(TimeUtils.millis2String(item.getCreateTime()) + "");
mViewBinding.tvNum.setText(item.getCsdetailCount() + ""); mViewBinding.tvNum.setText(item.getCsdetailCount() + "");
......
...@@ -29,7 +29,7 @@ public final class SystemUtil { ...@@ -29,7 +29,7 @@ public final class SystemUtil {
*/ */
public static String getDeviceModel() { public static String getDeviceModel() {
// return DeviceUtils.getModel(); // return DeviceUtils.getModel();
return "AECRC10"; return "X990";
} }
...@@ -57,7 +57,7 @@ public final class SystemUtil { ...@@ -57,7 +57,7 @@ public final class SystemUtil {
e.printStackTrace(); e.printStackTrace();
} }
} }
return "test2018"; return "test2019";
// return deviceSN; // return deviceSN;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment