coupod code area updatef
This commit is contained in:
@@ -6,6 +6,7 @@ import android.support.v7.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.EditText;
|
||||
|
||||
import com.google.android.gms.common.api.Api;
|
||||
|
||||
@@ -44,7 +45,7 @@ import retrofit2.Response;
|
||||
public class PaymentMethodFragment extends CreateOrderBaseFragment {
|
||||
|
||||
@BindView(R.id.paymentMethodsRecyclerView) RecyclerView paymentMethodsRecyclerView;
|
||||
@BindView(R.id.couponCodePizzalinkEditText) AppEditText couponCodeAppEditText;
|
||||
@BindView(R.id.couponCodeEditText) EditText couponCodeEditText;
|
||||
|
||||
@BindString(R.string.app_name) String appName;
|
||||
@BindString(R.string.alert_choose_payment_method) String choosePaymentMethodText;
|
||||
@@ -95,13 +96,13 @@ public class PaymentMethodFragment extends CreateOrderBaseFragment {
|
||||
break;
|
||||
}
|
||||
|
||||
if(couponCodeAppEditText.isEmpty()){
|
||||
if(couponCodeEditText.getText().toString().isEmpty()){
|
||||
SessionHelper.clearSelectedCoupon();
|
||||
createOrderActivity.setSelectedPaymentMethod(selectedPaymentMethod);
|
||||
createOrderActivity.onNextClicked(FRAGMENT_NAME);
|
||||
}
|
||||
else {
|
||||
createOrderActivity.setCouponCode(couponCodeAppEditText.getText());
|
||||
createOrderActivity.setCouponCode(couponCodeEditText.getText().toString());
|
||||
checkCoupon();
|
||||
}
|
||||
|
||||
@@ -114,7 +115,7 @@ public class PaymentMethodFragment extends CreateOrderBaseFragment {
|
||||
private void initViews(){
|
||||
CreateOrderActivity createOrderActivity = (CreateOrderActivity) BaseActivity.currentActivity;
|
||||
if(createOrderActivity.getCouponCode() != null){
|
||||
couponCodeAppEditText.setText(createOrderActivity.getCouponCode());
|
||||
couponCodeEditText.setText(createOrderActivity.getCouponCode());
|
||||
}
|
||||
initRecyclerView();
|
||||
}
|
||||
@@ -237,7 +238,7 @@ public class PaymentMethodFragment extends CreateOrderBaseFragment {
|
||||
Call<ResponseObject<CheckCouponModel>> call =
|
||||
ApiService.apiInterface.checkCoupon(
|
||||
"/" + SessionHelper.getSelectedStore().getStoreName() + ApiEndPoints.API_CHECK_COUPON + SessionHelper.getCustomerToken().getToken(),
|
||||
couponCodeAppEditText.getText());
|
||||
couponCodeEditText.getText().toString());
|
||||
call.enqueue(new Callback<ResponseObject<CheckCouponModel>>() {
|
||||
@Override
|
||||
public void onResponse(Call<ResponseObject<CheckCouponModel>> call, Response<ResponseObject<CheckCouponModel>> response) {
|
||||
|
||||
Reference in New Issue
Block a user