|
@@ -28,6 +28,7 @@ import android.text.style.ForegroundColorSpan;
|
|
import android.text.style.RelativeSizeSpan;
|
|
import android.text.style.RelativeSizeSpan;
|
|
import android.util.Log;
|
|
import android.util.Log;
|
|
import android.util.TypedValue;
|
|
import android.util.TypedValue;
|
|
|
|
+import android.view.MotionEvent;
|
|
import android.view.View;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.view.ViewGroup;
|
|
import android.view.ViewStub;
|
|
import android.view.ViewStub;
|
|
@@ -37,6 +38,7 @@ import android.view.animation.AnimationUtils;
|
|
import android.view.animation.OvershootInterpolator;
|
|
import android.view.animation.OvershootInterpolator;
|
|
import android.view.inputmethod.InputMethodManager;
|
|
import android.view.inputmethod.InputMethodManager;
|
|
import android.widget.EditText;
|
|
import android.widget.EditText;
|
|
|
|
+import android.widget.FrameLayout;
|
|
import android.widget.ImageView;
|
|
import android.widget.ImageView;
|
|
import android.widget.RelativeLayout;
|
|
import android.widget.RelativeLayout;
|
|
import android.widget.TextView;
|
|
import android.widget.TextView;
|
|
@@ -116,6 +118,7 @@ import com.hboxs.base_library.util.LanguageUtil;
|
|
import com.hboxs.base_library.util.LogUtil;
|
|
import com.hboxs.base_library.util.LogUtil;
|
|
import com.hboxs.base_library.util.LogUtils;
|
|
import com.hboxs.base_library.util.LogUtils;
|
|
import com.hboxs.base_library.util.PreventSpeedClickUtil;
|
|
import com.hboxs.base_library.util.PreventSpeedClickUtil;
|
|
|
|
+import com.hboxs.base_library.util.ReturnTomainScreenUtil;
|
|
import com.hboxs.base_library.util.SharedPreferencesUtils;
|
|
import com.hboxs.base_library.util.SharedPreferencesUtils;
|
|
import com.hboxs.base_library.util.UiUtil;
|
|
import com.hboxs.base_library.util.UiUtil;
|
|
import com.orhanobut.hawk.Hawk;
|
|
import com.orhanobut.hawk.Hawk;
|
|
@@ -230,8 +233,9 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
private MdbCreditCardDialog mMdbCreditCardDialog;
|
|
private MdbCreditCardDialog mMdbCreditCardDialog;
|
|
private ScanDialog scanDialog;
|
|
private ScanDialog scanDialog;
|
|
|
|
|
|
- private int ADVERTISING_TIME1 = Hawk.get(Name.ADVERTISING_TIME1, 90);//自动模式
|
|
|
|
- private int ADVERTISING_TIME2 = Hawk.get(Name.ADVERTISING_TIME2, 60);//手动模式
|
|
|
|
|
|
+ private FrameLayout flbuy;
|
|
|
|
+ private int ADVERTISING_TIME1 = Hawk.get(Name.ADVERTISING_TIME1, 140);//自动模式
|
|
|
|
+ private int ADVERTISING_TIME2 = Hawk.get(Name.ADVERTISING_TIME2, 140);//手动模式
|
|
|
|
|
|
public static IceCreamFragment getFragment(String manualReason) {
|
|
public static IceCreamFragment getFragment(String manualReason) {
|
|
Bundle bundle = new Bundle();
|
|
Bundle bundle = new Bundle();
|
|
@@ -250,13 +254,25 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
return R.layout.fragment_ice_cream;
|
|
return R.layout.fragment_ice_cream;
|
|
}
|
|
}
|
|
|
|
|
|
- @SuppressLint("SetTextI18n")
|
|
|
|
|
|
+ @SuppressLint({"SetTextI18n", "ClickableViewAccessibility"})
|
|
@Override
|
|
@Override
|
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
|
super.onViewCreated(view, savedInstanceState);
|
|
super.onViewCreated(view, savedInstanceState);
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
|
getActivity().getWindow().getDecorView().setLayoutDirection(View.LAYOUT_DIRECTION_LTR);
|
|
getActivity().getWindow().getDecorView().setLayoutDirection(View.LAYOUT_DIRECTION_LTR);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ flbuy = view.findViewById(R.id.fl_buy);
|
|
|
|
+ flbuy.setOnTouchListener(new View.OnTouchListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public boolean onTouch(View view, MotionEvent motionEvent) {
|
|
|
|
+ if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
|
|
|
|
+ resetFinishDelay();
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
RelativeLayout rlSelectLanguage = view.findViewById(R.id.rl_select_language);
|
|
RelativeLayout rlSelectLanguage = view.findViewById(R.id.rl_select_language);
|
|
if (Hawk.get(Name.LANGUAGE_SHOW, false)) {
|
|
if (Hawk.get(Name.LANGUAGE_SHOW, false)) {
|
|
rlSelectLanguage.setVisibility(View.VISIBLE);
|
|
rlSelectLanguage.setVisibility(View.VISIBLE);
|
|
@@ -592,7 +608,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
if (!mClickHelper.canClick()) {
|
|
if (!mClickHelper.canClick()) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- resetFinishDelay();
|
|
|
|
|
|
+// resetFinishDelay();
|
|
int id = v.getId();
|
|
int id = v.getId();
|
|
if (id == R.id.dishes_shop_cart_clear) {
|
|
if (id == R.id.dishes_shop_cart_clear) {
|
|
showClearDialog();
|
|
showClearDialog();
|
|
@@ -619,7 +635,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
}
|
|
}
|
|
Log.d(TAG, "onClick:orderHelper 商品名字:" + orderHelper.getOrderList().get(i).selectTag + " 单个商品价格:" + totalSum + " 数量:" + orderHelper.getOrderList().get(i).buyCount);
|
|
Log.d(TAG, "onClick:orderHelper 商品名字:" + orderHelper.getOrderList().get(i).selectTag + " 单个商品价格:" + totalSum + " 数量:" + orderHelper.getOrderList().get(i).buyCount);
|
|
}
|
|
}
|
|
- Log.d(TAG, "onClick:priceList "+priceList);
|
|
|
|
|
|
+ Log.d(TAG, "onClick:priceList " + priceList);
|
|
}
|
|
}
|
|
showLoading();
|
|
showLoading();
|
|
if (App.app.payChannel == Constant.PAY_FREE || manualReason != null) {
|
|
if (App.app.payChannel == Constant.PAY_FREE || manualReason != null) {
|
|
@@ -743,10 +759,10 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
ToastUtil.getInstance().showText(UiUtil.getStringRes(R.string.only_one_code));
|
|
ToastUtil.getInstance().showText(UiUtil.getStringRes(R.string.only_one_code));
|
|
return; // 直接返回,不继续执行
|
|
return; // 直接返回,不继续执行
|
|
} else {
|
|
} else {
|
|
- if (PreventSpeedClickUtil.isFastClick()){
|
|
|
|
|
|
+ if (PreventSpeedClickUtil.isFastClick()) {
|
|
Log.d(TAG, "PreventSpeedClickUtil:1 ");
|
|
Log.d(TAG, "PreventSpeedClickUtil:1 ");
|
|
getDiscountCodeOverseas(arrayCode[shoppingNumber], id);
|
|
getDiscountCodeOverseas(arrayCode[shoppingNumber], id);
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
Log.d(TAG, "PreventSpeedClickUtil:2 ");
|
|
Log.d(TAG, "PreventSpeedClickUtil:2 ");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -764,7 +780,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
private void showDialogCreditCard() {
|
|
private void showDialogCreditCard() {
|
|
Log.d(TAG, "showDialogCreditCard: ");
|
|
Log.d(TAG, "showDialogCreditCard: ");
|
|
LogUtils.logWrite("弹出刷卡对话框");
|
|
LogUtils.logWrite("弹出刷卡对话框");
|
|
- removeFinish();
|
|
|
|
|
|
+// removeFinish();
|
|
mCreditCardDialog = new CreditCardDialog(getContext(), getActivity());
|
|
mCreditCardDialog = new CreditCardDialog(getContext(), getActivity());
|
|
Log.d(TAG, "showDialogCreditCard: " + coin);
|
|
Log.d(TAG, "showDialogCreditCard: " + coin);
|
|
mCreditCardDialog.setListener(new DialogClickListener() {
|
|
mCreditCardDialog.setListener(new DialogClickListener() {
|
|
@@ -795,7 +811,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
case 132://失败
|
|
case 132://失败
|
|
break;
|
|
break;
|
|
case 1000:
|
|
case 1000:
|
|
- resetFinishDelay();
|
|
|
|
|
|
+// resetFinishDelay();
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -822,7 +838,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
public void run() {
|
|
public void run() {
|
|
checkManualMode();
|
|
checkManualMode();
|
|
}
|
|
}
|
|
- },4*60*1000);
|
|
|
|
|
|
+ }, 4 * 60 * 1000);
|
|
} else {
|
|
} else {
|
|
checkManualMode();
|
|
checkManualMode();
|
|
}
|
|
}
|
|
@@ -920,7 +936,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
AppCompatImageView effectView = sauceEffectViews[selectCount];
|
|
AppCompatImageView effectView = sauceEffectViews[selectCount];
|
|
effectView.setImageBitmap(null);
|
|
effectView.setImageBitmap(null);
|
|
}
|
|
}
|
|
- Log.d(TAG, "selectSauce:1 "+selectCount);
|
|
|
|
|
|
+ Log.d(TAG, "selectSauce:1 " + selectCount);
|
|
initIceCream();
|
|
initIceCream();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1375,7 +1391,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
if (!mClickHelper.canClick()) {
|
|
if (!mClickHelper.canClick()) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- resetFinishDelay();
|
|
|
|
|
|
+// resetFinishDelay();
|
|
DishesBean dishesBean = (DishesBean) v.getTag();
|
|
DishesBean dishesBean = (DishesBean) v.getTag();
|
|
|
|
|
|
int position = adapter.indexOf(dishesBean);
|
|
int position = adapter.indexOf(dishesBean);
|
|
@@ -1409,7 +1425,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
// return;
|
|
// return;
|
|
// }
|
|
// }
|
|
UISoundHelper.getInstance().playSelectFlavor(false);
|
|
UISoundHelper.getInstance().playSelectFlavor(false);
|
|
- removeFinish();
|
|
|
|
|
|
+// removeFinish();
|
|
|
|
|
|
if (getFragmentManager() != null) {
|
|
if (getFragmentManager() != null) {
|
|
Fragment f = null;
|
|
Fragment f = null;
|
|
@@ -1581,11 +1597,11 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
case Name.MDBRS232://mdb威佛上电了
|
|
case Name.MDBRS232://mdb威佛上电了
|
|
break;
|
|
break;
|
|
case Name.CURRENCYCHANGES://入钞了
|
|
case Name.CURRENCYCHANGES://入钞了
|
|
- tvMoney.setText(haveMoney + (Global.hasmoney.doubleValue() + Global.hascoin.doubleValue())+Hawk.get(Name.UNIT_OF_CURRENCY_TIME, ""));
|
|
|
|
|
|
+ tvMoney.setText(haveMoney + (Global.hasmoney.doubleValue() + Global.hascoin.doubleValue()) + Hawk.get(Name.UNIT_OF_CURRENCY_TIME, ""));
|
|
Log.d(TAG, "event: " + Global.hascoin.doubleValue());
|
|
Log.d(TAG, "event: " + Global.hascoin.doubleValue());
|
|
if (payMixDialog != null && payMixDialog.isShowing()) {
|
|
if (payMixDialog != null && payMixDialog.isShowing()) {
|
|
if (Global.hasmoney.doubleValue() + Global.hascoin.doubleValue() >= pri) {
|
|
if (Global.hasmoney.doubleValue() + Global.hascoin.doubleValue() >= pri) {
|
|
- tvMoney.setText(haveMoney + (Global.hasmoney.doubleValue() + Global.hascoin.doubleValue() - pri)+Hawk.get(Name.UNIT_OF_CURRENCY_TIME, ""));
|
|
|
|
|
|
+ tvMoney.setText(haveMoney + (Global.hasmoney.doubleValue() + Global.hascoin.doubleValue() - pri) + Hawk.get(Name.UNIT_OF_CURRENCY_TIME, ""));
|
|
remainMoney = Global.hasmoney.doubleValue() + Global.hascoin.doubleValue() - pri;
|
|
remainMoney = Global.hasmoney.doubleValue() + Global.hascoin.doubleValue() - pri;
|
|
payPaperSuccess(); // 收钞完成
|
|
payPaperSuccess(); // 收钞完成
|
|
EventBus.getDefault().post(new ApiMessageEvent("cashsale",
|
|
EventBus.getDefault().post(new ApiMessageEvent("cashsale",
|
|
@@ -1651,7 +1667,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
|
|
|
|
|
|
|
|
private void showPayMixDialog() {
|
|
private void showPayMixDialog() {
|
|
- removeFinish();
|
|
|
|
|
|
+// removeFinish();
|
|
if (payMixDialog == null) {
|
|
if (payMixDialog == null) {
|
|
payMixDialog = new PayMixDialog(getContext(), getActivity());
|
|
payMixDialog = new PayMixDialog(getContext(), getActivity());
|
|
}
|
|
}
|
|
@@ -1677,7 +1693,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 1000:
|
|
case 1000:
|
|
- resetFinishDelay();
|
|
|
|
|
|
+// resetFinishDelay();
|
|
Log.d(TAG, "dismiss: 1000");
|
|
Log.d(TAG, "dismiss: 1000");
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -1686,7 +1702,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
payMixDialog.show();
|
|
payMixDialog.show();
|
|
dismissLoading();
|
|
dismissLoading();
|
|
if (Global.hasmoney.doubleValue() + Global.hascoin.doubleValue() >= pri) {
|
|
if (Global.hasmoney.doubleValue() + Global.hascoin.doubleValue() >= pri) {
|
|
- tvMoney.setText(haveMoney + (Global.hasmoney.doubleValue() + Global.hascoin.doubleValue() - pri)+Hawk.get(Name.UNIT_OF_CURRENCY_TIME, ""));
|
|
|
|
|
|
+ tvMoney.setText(haveMoney + (Global.hasmoney.doubleValue() + Global.hascoin.doubleValue() - pri) + Hawk.get(Name.UNIT_OF_CURRENCY_TIME, ""));
|
|
payPaperSuccess(); // 收钞完成
|
|
payPaperSuccess(); // 收钞完成
|
|
EventBus.getDefault().post(new ApiMessageEvent("cashsale", ByteUtils.decimal2fitHex((long) (coin * 100), 4) + ";" + ByteUtils.decimal2fitHex((long) 1, 4)));
|
|
EventBus.getDefault().post(new ApiMessageEvent("cashsale", ByteUtils.decimal2fitHex((long) (coin * 100), 4) + ";" + ByteUtils.decimal2fitHex((long) 1, 4)));
|
|
} else {
|
|
} else {
|
|
@@ -1736,7 +1752,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
ToastUtil.getInstance().showText("金额异常");
|
|
ToastUtil.getInstance().showText("金额异常");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- removeFinish();
|
|
|
|
|
|
+// removeFinish();
|
|
if (mMdbCreditCardDialog == null) {
|
|
if (mMdbCreditCardDialog == null) {
|
|
mMdbCreditCardDialog = new MdbCreditCardDialog(getContext());
|
|
mMdbCreditCardDialog = new MdbCreditCardDialog(getContext());
|
|
mMdbCreditCardDialog.setCanTouchOutsideDismiss(false);
|
|
mMdbCreditCardDialog.setCanTouchOutsideDismiss(false);
|
|
@@ -1801,7 +1817,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
}, 3000);
|
|
}, 3000);
|
|
break;
|
|
break;
|
|
case 1000:
|
|
case 1000:
|
|
- resetFinishDelay();
|
|
|
|
|
|
+// resetFinishDelay();
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1836,6 +1852,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
private List<Double> getPriceList;
|
|
private List<Double> getPriceList;
|
|
|
|
|
|
// 进入手动制作的界面
|
|
// 进入手动制作的界面
|
|
|
|
+ @SuppressLint("ClickableViewAccessibility")
|
|
private void manualMake() {
|
|
private void manualMake() {
|
|
Log.d(TAG, "manualMake orderHelper: " + orderHelper.getOrderList().toString());
|
|
Log.d(TAG, "manualMake orderHelper: " + orderHelper.getOrderList().toString());
|
|
if (arrayCode != null) {
|
|
if (arrayCode != null) {
|
|
@@ -1904,7 +1921,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
shoppingTrolleyDialogChoosePay.dismiss();
|
|
shoppingTrolleyDialogChoosePay.dismiss();
|
|
}
|
|
}
|
|
if (getFragmentManager() != null) {
|
|
if (getFragmentManager() != null) {
|
|
-
|
|
|
|
|
|
+ flbuy.setOnTouchListener(null);
|
|
removeFinish();
|
|
removeFinish();
|
|
LinkedList<MakeIceCreamBean> iceCreamOrders = OrderHelper.getInstance().generateMakingIceCream();
|
|
LinkedList<MakeIceCreamBean> iceCreamOrders = OrderHelper.getInstance().generateMakingIceCream();
|
|
Log.d(TAG, "manualMake: MakeIceCreamBean" + iceCreamOrders);
|
|
Log.d(TAG, "manualMake: MakeIceCreamBean" + iceCreamOrders);
|
|
@@ -1956,7 +1973,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
|
|
|
|
public void carsPay(String productNameMap) {
|
|
public void carsPay(String productNameMap) {
|
|
showLoading();
|
|
showLoading();
|
|
- removeFinish();
|
|
|
|
|
|
+// removeFinish();
|
|
Log.d(TAG, "carsPay: " + productNameMap);
|
|
Log.d(TAG, "carsPay: " + productNameMap);
|
|
RequestBody body = RequestBody.create(MediaType.parse("application/json;charset=utf-8"), productNameMap);
|
|
RequestBody body = RequestBody.create(MediaType.parse("application/json;charset=utf-8"), productNameMap);
|
|
String url = "tOrder/iceCreamCarsPay?clientId=" + Heartbeat.deviceId;
|
|
String url = "tOrder/iceCreamCarsPay?clientId=" + Heartbeat.deviceId;
|
|
@@ -2020,7 +2037,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
|
|
|
|
private void getCodeSuccess(String rd_Pic, String sn) {
|
|
private void getCodeSuccess(String rd_Pic, String sn) {
|
|
LogUtil.d(TAG, "getCodeSuccess: " + rd_Pic);
|
|
LogUtil.d(TAG, "getCodeSuccess: " + rd_Pic);
|
|
- resetFinishDelay();
|
|
|
|
|
|
+// resetFinishDelay();
|
|
showDialogScan(rd_Pic, sn);
|
|
showDialogScan(rd_Pic, sn);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2035,7 +2052,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
Global.makeStatus = Name.Idle;
|
|
Global.makeStatus = Name.Idle;
|
|
BaseConstant.CANCEL_POLL = false;
|
|
BaseConstant.CANCEL_POLL = false;
|
|
Log.d(TAG, "showDialogScan: 关闭了重新计时");
|
|
Log.d(TAG, "showDialogScan: 关闭了重新计时");
|
|
- startFinishDelay();
|
|
|
|
|
|
+// startFinishDelay();
|
|
break;
|
|
break;
|
|
case 130:
|
|
case 130:
|
|
// closeLoading();
|
|
// closeLoading();
|
|
@@ -2057,7 +2074,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
|
|
|
|
break;
|
|
break;
|
|
case 1000:
|
|
case 1000:
|
|
- resetFinishDelay();
|
|
|
|
|
|
+// resetFinishDelay();
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2272,6 +2289,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
}, 1000);
|
|
}, 1000);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
int number = 0;
|
|
int number = 0;
|
|
|
|
|
|
private String localOrderSn = UUID.randomUUID().toString().replace("-", "");
|
|
private String localOrderSn = UUID.randomUUID().toString().replace("-", "");
|