This commit is contained in:
2020-01-18 16:43:24 +03:00
parent 018d02e507
commit 98038521dc

View File

@@ -104,7 +104,6 @@ public class CreateOrderSummaryFragment extends CreateOrderBaseFragment {
private ProductOnOrderSummaryRecyclerAdapter productOnOrderSummaryRecyclerAdapter; private ProductOnOrderSummaryRecyclerAdapter productOnOrderSummaryRecyclerAdapter;
private StoreShiftModel storeShiftModel; private StoreShiftModel storeShiftModel;
private PaymentTokenModel braintreePaymentTokenModel; private PaymentTokenModel braintreePaymentTokenModel;
private boolean isChoosingDeliveyTimeForFreeShipping;
public CreateOrderSummaryFragment() {} public CreateOrderSummaryFragment() {}
@@ -324,7 +323,6 @@ public class CreateOrderSummaryFragment extends CreateOrderBaseFragment {
@Override @Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
DialogHelper.showLoadingDialog(); DialogHelper.showLoadingDialog();
isChoosingDeliveyTimeForFreeShipping = false;
checkDeliveryTime(); checkDeliveryTime();
} }
}, },
@@ -333,7 +331,6 @@ public class CreateOrderSummaryFragment extends CreateOrderBaseFragment {
@Override @Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
DialogHelper.showLoadingDialog(); DialogHelper.showLoadingDialog();
isChoosingDeliveyTimeForFreeShipping = true;
getDeliveryTimeOfStore(null); getDeliveryTimeOfStore(null);
} }
}, },
@@ -352,7 +349,6 @@ public class CreateOrderSummaryFragment extends CreateOrderBaseFragment {
@Override @Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
DialogHelper.showLoadingDialog(); DialogHelper.showLoadingDialog();
isChoosingDeliveyTimeForFreeShipping = true;
getDeliveryTimeOfStore(null); getDeliveryTimeOfStore(null);
} }
}, },
@@ -468,7 +464,7 @@ public class CreateOrderSummaryFragment extends CreateOrderBaseFragment {
final int nowMonth = nowDate.get(Calendar.MONTH); final int nowMonth = nowDate.get(Calendar.MONTH);
final int nowDay = nowDate.get(Calendar.DAY_OF_MONTH); final int nowDay = nowDate.get(Calendar.DAY_OF_MONTH);
if(isChoosingDeliveyTimeForFreeShipping && nowDate.get(Calendar.HOUR_OF_DAY) == 23){ if(nowDate.get(Calendar.HOUR_OF_DAY) == 23){
nowDate.add(Calendar.DAY_OF_YEAR, 1); nowDate.add(Calendar.DAY_OF_YEAR, 1);
} }
@@ -518,10 +514,14 @@ public class CreateOrderSummaryFragment extends CreateOrderBaseFragment {
dateOfOrder.get(Calendar.MONTH) == nowDate.get(Calendar.MONTH) && dateOfOrder.get(Calendar.MONTH) == nowDate.get(Calendar.MONTH) &&
dateOfOrder.get(Calendar.DAY_OF_MONTH) == nowDate.get(Calendar.DAY_OF_MONTH); dateOfOrder.get(Calendar.DAY_OF_MONTH) == nowDate.get(Calendar.DAY_OF_MONTH);
if(isTheSameDate && isChoosingDeliveyTimeForFreeShipping){ if(isTheSameDate &&
createOrderActivity.getSelectedShippingMethod().getCode().toLowerCase().equals(ApiConstants.SHIPPING_METHOD_CODE_FREE_SHIPPING)){
nowDate.add( Calendar.MINUTE, 65); nowDate.add( Calendar.MINUTE, 65);
} }
// createOrderActivity.getSelectedShippingMethod().getCode().equalsIgnoreCase(ApiConstants.SHIPPING_METHOD_CODE_PICK_UP_FROM_STORE) else if(isTheSameDate &&
createOrderActivity.getSelectedShippingMethod().getCode().toLowerCase().equals(ApiConstants.SHIPPING_METHOD_CODE_PICK_UP_FROM_STORE)){
nowDate.add( Calendar.MINUTE, 25);
}
else if(isTheSameDate){ else if(isTheSameDate){
nowDate.add( Calendar.MINUTE, 10); nowDate.add( Calendar.MINUTE, 10);
} }