From a33c0a4eae8aded722cea396ff6848842961003c Mon Sep 17 00:00:00 2001 From: Preyea Regmi Date: Thu, 11 Jun 2020 17:04:33 +0545 Subject: [PATCH] Minor ui fixes --- .../UserPasswordChangeV2Activity.java | 6 + .../SendMoneyViewModelFactory.java | 2 +- .../presenter/SendMoneyV2Presenter.java | 180 ++---------------- .../SendMoneyV2PresenterInterface.java | 12 -- .../AmountDetailSendMoneyFragment.java | 88 +-------- .../fragment_amount_detail_send_money_v2.xml | 166 +--------------- 6 files changed, 36 insertions(+), 418 deletions(-) diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/profile/view/profilechange/UserPasswordChangeV2Activity.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/profile/view/profilechange/UserPasswordChangeV2Activity.java index 5e0e137c..d409004c 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/profile/view/profilechange/UserPasswordChangeV2Activity.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/profile/view/profilechange/UserPasswordChangeV2Activity.java @@ -132,6 +132,12 @@ public class UserPasswordChangeV2Activity extends BaseActivity implements Change } } + @OnClick(R.id.iv_back) + public void onBackButtonClicked(View v) + { + onBackPressed(); + } + @OnClick(R.id.btn_submit) diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/SendMoneyViewModelFactory.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/SendMoneyViewModelFactory.java index 68ae414d..75c9ae43 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/SendMoneyViewModelFactory.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/SendMoneyViewModelFactory.java @@ -28,6 +28,6 @@ public class SendMoneyViewModelFactory implements ViewModelProvider.Factory { @NonNull @Override public T create(@NonNull Class modelClass) { - return (T) new SendMoneyV2Presenter(view,new SendMoneyV2Gateway(), sendMoneyRequiredData,new CouponV2Gateway()); + return (T) new SendMoneyV2Presenter(view,new SendMoneyV2Gateway(), sendMoneyRequiredData); } } diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/presenter/SendMoneyV2Presenter.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/presenter/SendMoneyV2Presenter.java index 8e27e8c8..39a8d447 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/presenter/SendMoneyV2Presenter.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/presenter/SendMoneyV2Presenter.java @@ -53,10 +53,8 @@ public class SendMoneyV2Presenter extends BaseViewModel implements SendMoneyV2Pr private final ReceiverInfoV3Model selectedRecipient; private final CompositeDisposable compositeObservable; - private final AutoDebitAccount selectedPaymentType; private final SendMoneyV2ContractInterface view; private final SendMoneyV2GatewayInterface gateway; - private final CouponV2InteractorInterface.CouponV2GatewayInterface couponGateway; //Exrate data @@ -71,57 +69,30 @@ public class SendMoneyV2Presenter extends BaseViewModel implements SendMoneyV2Pr private MutableLiveData amountDetailRelatedDataModelLiveData; private MutableLiveData exchangeCalculationModelMutableLiveData; - private MutableLiveData exchangeRateCouponResetActionLiveData; - private MutableLiveData exchangeRateCouponViewRequiredLiveData; private MutableLiveData couponSelectionLiveData; - private long countDownRemainingValue; private ArrayList couponList; private ExchangeCalculationModel currentExchangeCalcResult; - private CouponDTO selectedCoupon; - public SendMoneyV2Presenter(SendMoneyV2ContractInterface view, SendMoneyV2GatewayInterface gateway, SendMoneyRequiredDataV3 sendMoneyRequiredData, CouponV2InteractorInterface.CouponV2GatewayInterface couponV2Gateway) { + public SendMoneyV2Presenter(SendMoneyV2ContractInterface view, SendMoneyV2GatewayInterface gateway, SendMoneyRequiredDataV3 sendMoneyRequiredData) { this.view = view; this.selectedRecipient = sendMoneyRequiredData.getRecipientInfoModel(); - this.selectedPaymentType = sendMoneyRequiredData.getSelectedAutoDebitAccount(); this.gateway = gateway; - this.couponGateway = couponV2Gateway; this.compositeObservable = new CompositeDisposable(); - countDownRemainingValue = -1; amountDetailRelatedDataModelLiveData = null; exchangeCalculationModelMutableLiveData = null; - exchangeRateCouponResetActionLiveData = new MutableLiveData<>(); - exchangeRateCouponViewRequiredLiveData = new MutableLiveData<>(); + couponSelectionLiveData = new MutableLiveData<>(); } - @Override - public void clearPaymentData() { -// this.selectedPaymentModeData = null; -// this.selectedAccountNo = null; -// this.selectedBranchData = null; -// this.selectedBankData = null; -// this.isAccountValidationRequired = false; - } - @Override - public String returnNullOnValidaitonAndSetPaymentModeData(PayoutMode selectedPayoutMode, BankList selectedBank, BankBranchDTO selectedBranch, String accNo) { - return null; - } - @Override - public String getPaymentModeTitle() { - String selectedLocale = this.gateway.getPreferredLanguage(); - if (selectedLocale.equalsIgnoreCase("ne") || selectedLocale.equalsIgnoreCase("mn")) - return this.selectedRecipient.getCountry() + " " + getStringfromStringId(R.string.pick_money_text) + "?"; - else if (selectedLocale.equalsIgnoreCase("ko")) - return getStringfromStringId(R.string.pick_money_text) + " " + this.selectedRecipient.getCountry(); - else - return getStringfromStringId(R.string.pick_money_text) + " " + this.selectedRecipient.getCountry() + "?"; - } + + + @Override public Observable getBranchListFromNetwork(BankList selectedBank, String searchKeyword) { @@ -179,14 +150,7 @@ public class SendMoneyV2Presenter extends BaseViewModel implements SendMoneyV2Pr this.selectedTransferAmount = transferAmount; } - @Override - public void clearExRateData() { - selectedSendingAmount = null; - selectedExRate = null; - selectedSendingCurrency = null; - selectedRecievingAmount = null; - selectedTransferAmount = null; - } + @Override public void promptPinAndPerformTransaction() { @@ -196,7 +160,7 @@ public class SendMoneyV2Presenter extends BaseViewModel implements SendMoneyV2Pr getPaymentType(), getTransactionAmount(), getKftcId() - ).enableFallbackAuth().withCountdownTimer(countDownRemainingValue) + ).enableFallbackAuth() ).setListener(new GMEAuthManager.GMEAuthListener() { @Override public void onGMEAuthSuccess(GMEAuthSuccessResult result) { @@ -230,20 +194,15 @@ public class SendMoneyV2Presenter extends BaseViewModel implements SendMoneyV2Pr @Override public String getPaymentType() { - if (selectedPaymentType != null && selectedPaymentType.getType() != null) - return selectedPaymentType.getType(); - else - return ""; - } - @Override - public void updateRemainingCountDownValue(long value) { - this.countDownRemainingValue = value; + return "wallet"; } + + @Override public String getKftcId() { - return selectedPaymentType.getKftcAccountId(); + return ""; } @Override @@ -251,28 +210,11 @@ public class SendMoneyV2Presenter extends BaseViewModel implements SendMoneyV2Pr return Utils.removeSpecialCharacterAndDecimalFromCurrency(selectedSendingAmount); } - @Override - public void getCouponRelatedData() { - compositeObservable.add( - this.couponGateway.getCouponList(this.couponGateway.getAuth(), this.couponGateway.getUserIDNumber()) - .doOnSubscribe(subs -> view.showProgressBar(true, "")) - .subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()) - .doFinally(() -> view.showProgressBar(false, "")) - .subscribeWith(new CouponListObserver()) - ); - } - @Override - public ArrayList getCouponList() { - return this.couponList; - } - @Override - public void onCouponSelected(CouponDTO selectedCoupon) { - this.selectedCoupon = selectedCoupon; - couponSelectionLiveData.setValue(calculateNetAppliedAmount()); - } + + + private void preSelectDefaultCouponIfAvailable() { if (couponList == null || couponList.size() == 1) @@ -281,73 +223,18 @@ public class SendMoneyV2Presenter extends BaseViewModel implements SendMoneyV2Pr try { List sortedCouponList = couponList.subList(1, couponList.size()); Collections.sort(sortedCouponList); - onCouponSelected(sortedCouponList.get(0)); } catch (Exception e) { } } - private AmountDetailSendMoneyFragment.CouponDetailViewDTO calculateNetAppliedAmount() { - if (selectedCoupon == null) { - resetCouponData(); - return null; - } - String couponName; - - double serviceFee = 0; - double discountValue = 0; - - serviceFee = Utils.formatCurrencyForComparision(currentExchangeCalcResult.getScCharge()); - discountValue = Utils.formatCurrencyForComparision(selectedCoupon.getDiscountValue()); - - //1 -> Percent Type ; 2 -> Value type - if ("1".equalsIgnoreCase(selectedCoupon.getDiscountType())) { - discountValue = serviceFee * (discountValue / 100); - couponName = "Service Discount " + (selectedCoupon.getDiscountValue() != null ? selectedCoupon.getDiscountValue() : 0) + "%"; - } else { - couponName = "Service Discount " + (selectedCoupon.getDiscountValue() != null ? Utils.formatCurrency(selectedCoupon.getDiscountValue()) : 0) + " KRW"; - } - - - String netAppliedAmount = Utils.formatCurrency(String.valueOf(Utils.formatCurrencyForComparision(currentExchangeCalcResult.getCollAmt()) - discountValue)); - - - return new AmountDetailSendMoneyFragment.CouponDetailViewDTO(couponName, netAppliedAmount); - } private String calculatedDiscountedServiceFee() { + return selectedTransferFee; - if (selectedCoupon == null) - return selectedTransferFee; - else { - double serviceFee = 0; - double discountValue = 0; - - serviceFee = Utils.formatCurrencyForComparision(currentExchangeCalcResult.getScCharge()); - discountValue = Utils.formatCurrencyForComparision(selectedCoupon.getDiscountValue()); - - if ("1".equalsIgnoreCase(selectedCoupon.getDiscountType())) { - return String.valueOf(serviceFee - (serviceFee * (discountValue / 100))); - } else { - return String.valueOf(serviceFee - discountValue); - } - - } } - @Override - public int getSelectedCouponIndex() { - if (couponList != null && selectedCoupon != null) { - String selectedCouponSchemeId = selectedCoupon.getSchemeId(); - for (int i = 1; i < couponList.size(); i++) { - if (couponList.get(i).getSchemeId().equalsIgnoreCase(selectedCouponSchemeId)) - return i; - } - } - - return 0; - } private void performSendMoneyTransaction(String password, boolean isBiometricUsed) { @@ -380,7 +267,7 @@ public class SendMoneyV2Presenter extends BaseViewModel implements SendMoneyV2Pr sendMoneyAPIRequestBody.setPayOutPartner(selectedRecipient.getPayoutPartner()); - sendMoneyAPIRequestBody.setPaymentType(selectedPaymentType.getType()); + sendMoneyAPIRequestBody.setPaymentType("wallet"); sendMoneyAPIRequestBody.setpCurr(selectedSendingCurrency); @@ -406,12 +293,12 @@ public class SendMoneyV2Presenter extends BaseViewModel implements SendMoneyV2Pr sendMoneyAPIRequestBody.setIsAgreed(Constants.TRUE_STRING); //KFTC Related Params - sendMoneyAPIRequestBody.setKftcAccountId(selectedPaymentType.getKftcAccountId()); + sendMoneyAPIRequestBody.setKftcAccountId(""); sendMoneyAPIRequestBody.setTxnPassword(password); sendMoneyAPIRequestBody.setUseBiometric(isBiometricUsed); - sendMoneyAPIRequestBody.setSchemeId(selectedCoupon != null ? selectedCoupon.getSchemeId() : ""); + sendMoneyAPIRequestBody.setSchemeId( ""); compositeObservable.add( gateway.performSendMoneyTransaction(gateway.getAuth(), sendMoneyAPIRequestBody) @@ -488,7 +375,7 @@ public class SendMoneyV2Presenter extends BaseViewModel implements SendMoneyV2Pr gateway.sendDataForForexCalculation(gateway.getAuth(), senderCountryId, senderCurrency, recieverCurrency, Utils.removeCommaFromAmount(senderAmount), Utils.removeCommaFromAmount(recieveAmount), paymentMethodId, calculationPreference, recipientCountryName, - recipientCountryID, bankId, paymentPartnerId, gateway.getUserID(), selectedPaymentType.getType()) + recipientCountryID, bankId, paymentPartnerId, gateway.getUserID(), "wallet") .doOnSubscribe(subs -> view.showProgressBar(true, "")) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) @@ -526,61 +413,34 @@ public class SendMoneyV2Presenter extends BaseViewModel implements SendMoneyV2Pr return exchangeCalculationModelMutableLiveData; } - @Override - public LiveData subscribeToExRateCouponAvailableEvent() { - return exchangeRateCouponResetActionLiveData; - } - - @Override - public LiveData subscribeToExRateCouponRequireEvent() { - return exchangeRateCouponViewRequiredLiveData; - } - @Override - public LiveData subscribeToCouponSelectedEvent() { - return couponSelectionLiveData; - } - private void resetCouponData() { - selectedCoupon = null; - exchangeRateCouponResetActionLiveData.setValue(couponList != null ? couponList.size() - 1 : 0); - } - private void showCouponRelatedData(boolean action) { - selectedCoupon = null; - exchangeRateCouponViewRequiredLiveData.setValue(action); - } public class ExchangeRateCalcObserver extends GenericApiObserverResponse { @Override protected void onSuccess(ExchangeCalculationApiResponse exchangeCalculationApiResponse) { - resetCouponData(); if (exchangeCalculationApiResponse.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) { currentExchangeCalcResult = exchangeCalculationApiResponse.getData(); exchangeCalculationModelMutableLiveData.setValue(exchangeCalculationApiResponse.getData()); - showCouponRelatedData(true); preSelectDefaultCouponIfAvailable(); } else { view.showPopUpMessage(exchangeCalculationApiResponse.getMsg(), CustomAlertDialog.AlertType.FAILED, null); - showCouponRelatedData(false); } } @Override public void onFailed(String message) { - showCouponRelatedData(false); - resetCouponData(); view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, null); } @Override protected void onConnectionNotEstablished(String message) { - showCouponRelatedData(false); - resetCouponData(); + view.showPopUpMessage(message, CustomAlertDialog.AlertType.NO_INTERNET, null); } diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/presenter/SendMoneyV2PresenterInterface.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/presenter/SendMoneyV2PresenterInterface.java index 6a95d591..97d8094d 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/presenter/SendMoneyV2PresenterInterface.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/presenter/SendMoneyV2PresenterInterface.java @@ -31,15 +31,9 @@ public interface SendMoneyV2PresenterInterface extends BasePresenterInterface { LiveData subscribeToAmountRelatedData(); LiveData subscribeToExRateData(); - LiveData subscribeToExRateCouponAvailableEvent(); - LiveData subscribeToExRateCouponRequireEvent(); - LiveData subscribeToCouponSelectedEvent(); - void clearPaymentData(); - String returnNullOnValidaitonAndSetPaymentModeData(PayoutMode selectedPayoutMode, BankList selectedBank, BankBranchDTO selectedBranch, String text); - String getPaymentModeTitle(); Observable getBranchListFromNetwork(BankList selectedBank, String searchKeyword); @@ -49,7 +43,6 @@ public interface SendMoneyV2PresenterInterface extends BasePresenterInterface { void setSendingAmount(String sendingAmount, String recipientCurrencyCode, String selectedExRate, String recievingAmount, String transferFee, boolean calcBy, String forexId,String transferAmount); - void clearExRateData(); void promptPinAndPerformTransaction(); @@ -57,18 +50,13 @@ public interface SendMoneyV2PresenterInterface extends BasePresenterInterface { String getPaymentType(); - void updateRemainingCountDownValue(long value); String getKftcId(); String getTransactionAmount(); - void getCouponRelatedData(); - ArrayList getCouponList(); - void onCouponSelected(CouponDTO coupon); - int getSelectedCouponIndex(); WebRequestModel getWebRequestDataForFraudWarning(); diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/view/amountdetail/AmountDetailSendMoneyFragment.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/view/amountdetail/AmountDetailSendMoneyFragment.java index b5d5ee84..8f2f4696 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/view/amountdetail/AmountDetailSendMoneyFragment.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/view/amountdetail/AmountDetailSendMoneyFragment.java @@ -9,6 +9,7 @@ import androidx.annotation.Nullable; import androidx.constraintlayout.widget.Group; import androidx.core.view.ViewCompat; import androidx.core.widget.NestedScrollView; +import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProviders; import androidx.transition.TransitionManager; @@ -76,16 +77,6 @@ public class AmountDetailSendMoneyFragment extends BaseFragment implements View. @BindView(R.id.recepientCurrencyTextView) TextView recepientCurrencyTextView; - @BindView(R.id.gmeCouponTxt) - TextView gmeCouponTxt; - - @BindView(R.id.gmeCouponTitleTxt) - TextView gmeCouponTitleTxt; - - - @BindView(R.id.couponViewContainer) - ViewGroup couponViewContainer; - @BindView(R.id.countrySelectionSpinner) ViewGroup countrySelectionSpinner; @@ -96,14 +87,9 @@ public class AmountDetailSendMoneyFragment extends BaseFragment implements View. @BindView(R.id.rootView) ViewGroup rootView; - @BindView(R.id.appliedAmountViewGroup) - Group appliedAmountViewGroup; - @BindView(R.id.gmeCouponAppliedAmountValueTxt) - TextView gmeCouponAppliedAmountValueTxt; - @BindView(R.id.gmeCouponAppliedAmountTxt) - TextView gmeCouponAppliedAmountTxt; + @BindView(R.id.nestedScrollView) NestedScrollView nestedScrollView; @@ -128,6 +114,7 @@ public class AmountDetailSendMoneyFragment extends BaseFragment implements View. private String selectedExRateId; private String selectedExRateWithoutTrunc; private String selectedTransferAmount; + private SendMoneyV2Presenter viewmodel; @Override @@ -144,14 +131,12 @@ public class AmountDetailSendMoneyFragment extends BaseFragment implements View. } private void init() { + viewmodel= new ViewModelProvider(requireActivity()).get(SendMoneyV2Presenter.class); this.sendAmountTextWatcher = new SendAmountTextWatcher(); this.recepientAmountTextWatcher = new RecipientAmountTextWatcher(); interpolator = new AccelerateDecelerateInterpolator(); setupRecyclerView(); registerTextWatchers(true); - String appliedAmountString = getContext().getString(R.string.applied_amount_text).replaceAll(" ", "\n"); - gmeCouponAppliedAmountTxt.setText(appliedAmountString); -// couponViewContainer.setVisibility(View.VISIBLE); } @Override @@ -161,7 +146,6 @@ public class AmountDetailSendMoneyFragment extends BaseFragment implements View. recieveMoneyEditText.setOnEditorActionListener(this); sendMoneyEditText.setOnEditorActionListener(this); countrySelectionSpinner.setOnClickListener(this); -// rootView.setOnTouchListener((v, event) -> focusOutAndHideKeyboard()); } @Override @@ -171,7 +155,6 @@ public class AmountDetailSendMoneyFragment extends BaseFragment implements View. recieveMoneyEditText.setOnEditorActionListener(null); sendMoneyEditText.setOnEditorActionListener(null); countrySelectionSpinner.setOnClickListener(null); -// rootView.setOnTouchListener(null); } @@ -220,7 +203,6 @@ public class AmountDetailSendMoneyFragment extends BaseFragment implements View. private void performDefaultAction(Bundle savedInstance) { shouldCaulatedByRecipient = false; - SendMoneyV2Presenter viewmodel= ViewModelProviders.of(getActivity()).get(SendMoneyV2Presenter.class); viewmodel.subscribeToAmountRelatedData().observe(getViewLifecycleOwner(), data -> { amountDetailRelatedData = data; @@ -258,30 +240,12 @@ public class AmountDetailSendMoneyFragment extends BaseFragment implements View. }); - (ViewModelProviders.of(getActivity()).get(SendMoneyV2Presenter.class)).subscribeToExRateCouponAvailableEvent().observe(getViewLifecycleOwner(), this::resetCouponView); - (ViewModelProviders.of(getActivity()).get(SendMoneyV2Presenter.class)).subscribeToExRateCouponRequireEvent().observe(getViewLifecycleOwner(), this::showCouponRelatedView); - (ViewModelProviders.of(getActivity()).get(SendMoneyV2Presenter.class)).subscribeToCouponSelectedEvent().observe(getViewLifecycleOwner(), this::showCoupon); - viewmodel.getCouponRelatedData(); - } - private void resetCouponView(int couponListSize) { - hideAppliedAmountView(true); - gmeCouponTxt.setText(String.valueOf(couponListSize)); - couponViewContainer.setVisibility(View.VISIBLE); } - private void showCouponRelatedView(boolean action) - { - if(action) - { - couponViewContainer.setVisibility(View.VISIBLE); - } - else - { - couponViewContainer.setVisibility(View.GONE); - } - } + + @Override public void onClick(View v) { @@ -296,7 +260,7 @@ public class AmountDetailSendMoneyFragment extends BaseFragment implements View. hideKeyBoard(); sendMoneyEditText.clearFocus(); recieveMoneyEditText.clearFocus(); - (ViewModelProviders.of(getActivity()).get(SendMoneyV2Presenter.class)).setSendingAmount(sendMoneyEditText.getText().toString(), amountDetailRelatedData.getDefaultSelectedCurrency().getCurrencyCode(), selectedExRateWithoutTrunc, selectedRecipientAmount, selectedTransferFeeAmount, shouldCaulatedByRecipient, selectedExRateId, selectedTransferAmount); + viewmodel.setSendingAmount(sendMoneyEditText.getText().toString(), amountDetailRelatedData.getDefaultSelectedCurrency().getCurrencyCode(), selectedExRateWithoutTrunc, selectedRecipientAmount, selectedTransferFeeAmount, shouldCaulatedByRecipient, selectedExRateId, selectedTransferAmount); ((SendMoneyActionListener) getActivity()).showTransactionReviewPage(); } @@ -320,7 +284,7 @@ public class AmountDetailSendMoneyFragment extends BaseFragment implements View. return; } - (ViewModelProviders.of(getActivity()).get(SendMoneyV2Presenter.class)).getForex(recieveMoneyEditText.getText().toString(), sendMoneyEditText.getText().toString(), shouldCaulatedByRecipient, amountDetailRelatedData.getDefaultSelectedCurrency().getCurrencyCode()); + viewmodel.getForex(recieveMoneyEditText.getText().toString(), sendMoneyEditText.getText().toString(), shouldCaulatedByRecipient, amountDetailRelatedData.getDefaultSelectedCurrency().getCurrencyCode()); } private void showSelectedCurrency(String selectedCountryCode, String selectedCountryCurrency) { @@ -416,44 +380,10 @@ public class AmountDetailSendMoneyFragment extends BaseFragment implements View. return false; } - private void hideAppliedAmountView(boolean action) { - TransitionManager.beginDelayedTransition(couponViewContainer); - if (action) { - appliedAmountViewGroup.setVisibility(View.GONE); - } - else { - appliedAmountViewGroup.setVisibility(View.VISIBLE); - nestedScrollView.smoothScrollTo(0,continueBtn.getBottom()); - } - } - - @OnClick(R.id.couponViewContainer) - public void showCouponList() { - ArrayList objectList = (ViewModelProviders.of(getActivity()).get(SendMoneyV2Presenter.class)).getCouponList(); - int currentSelectedIndex = (ViewModelProviders.of(getActivity()).get(SendMoneyV2Presenter.class)).getSelectedCouponIndex(); - - CouponListBottomSheetDialog.showCouponList(objectList,currentSelectedIndex, new CouponListAdapter.CouponOnClickListener() { - @Override - public void onCouponClicked(CouponDTO coupon) { - (ViewModelProviders.of(getActivity()).get(SendMoneyV2Presenter.class)).onCouponSelected(coupon); - } - - @Override - public void onNoCouponSelected() { - } - }).show(getActivity().getSupportFragmentManager(), "CoupLinBottomSheetFrag"); - } - private void showCoupon(CouponDetailViewDTO couponDetail) { - if (couponDetail != null) { - gmeCouponTxt.setText(couponDetail.couponName); - gmeCouponAppliedAmountValueTxt.setText(couponDetail.appliedAmount); - hideAppliedAmountView(false); - } - } private boolean validateAll() { return validateAmountIsNotEmpty(sendMoneyEditText.getText().toString()) && validateAmountIsNotEmpty(recieveMoneyEditText.getText().toString()); @@ -543,7 +473,6 @@ public class AmountDetailSendMoneyFragment extends BaseFragment implements View. updateRecievingAmount(""); updateButtonToCalculate(true); showTransferfeeAndExRate(false, "", "", ""); - showCouponRelatedView(false); } } @@ -565,7 +494,6 @@ public class AmountDetailSendMoneyFragment extends BaseFragment implements View. updateSendAmount(""); updateButtonToCalculate(true); showTransferfeeAndExRate(false, "", "", ""); - showCouponRelatedView(false); } } diff --git a/app/src/main/res/layout/fragment_amount_detail_send_money_v2.xml b/app/src/main/res/layout/fragment_amount_detail_send_money_v2.xml index cadda7a1..3ce1a542 100644 --- a/app/src/main/res/layout/fragment_amount_detail_send_money_v2.xml +++ b/app/src/main/res/layout/fragment_amount_detail_send_money_v2.xml @@ -234,171 +234,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -