Browse Source

Minor ui fixes

master
Preyea Regmi 4 years ago
parent
commit
a33c0a4eae
  1. 6
      app/src/main/java/com/gmeremit/online/gmeremittance_native/profile/view/profilechange/UserPasswordChangeV2Activity.java
  2. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/SendMoneyViewModelFactory.java
  3. 180
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/presenter/SendMoneyV2Presenter.java
  4. 12
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/presenter/SendMoneyV2PresenterInterface.java
  5. 88
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/view/amountdetail/AmountDetailSendMoneyFragment.java
  6. 166
      app/src/main/res/layout/fragment_amount_detail_send_money_v2.xml

6
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)

2
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 extends ViewModel> T create(@NonNull Class<T> modelClass) {
return (T) new SendMoneyV2Presenter(view,new SendMoneyV2Gateway(), sendMoneyRequiredData,new CouponV2Gateway());
return (T) new SendMoneyV2Presenter(view,new SendMoneyV2Gateway(), sendMoneyRequiredData);
}
}

180
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<AmountDetailRelatedDataModel> amountDetailRelatedDataModelLiveData;
private MutableLiveData<ExchangeCalculationModel> exchangeCalculationModelMutableLiveData;
private MutableLiveData<Integer> exchangeRateCouponResetActionLiveData;
private MutableLiveData<Boolean> exchangeRateCouponViewRequiredLiveData;
private MutableLiveData<AmountDetailSendMoneyFragment.CouponDetailViewDTO> couponSelectionLiveData;
private long countDownRemainingValue;
private ArrayList<CouponDTO> 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<BranchListApiResponse> 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<CouponDTO> 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<CouponDTO> 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<Integer> subscribeToExRateCouponAvailableEvent() {
return exchangeRateCouponResetActionLiveData;
}
@Override
public LiveData<Boolean> subscribeToExRateCouponRequireEvent() {
return exchangeRateCouponViewRequiredLiveData;
}
@Override
public LiveData<AmountDetailSendMoneyFragment.CouponDetailViewDTO> 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<ExchangeCalculationApiResponse> {
@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);
}

12
app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/presenter/SendMoneyV2PresenterInterface.java

@ -31,15 +31,9 @@ public interface SendMoneyV2PresenterInterface extends BasePresenterInterface {
LiveData<AmountDetailRelatedDataModel> subscribeToAmountRelatedData();
LiveData<ExchangeCalculationModel> subscribeToExRateData();
LiveData<Integer> subscribeToExRateCouponAvailableEvent();
LiveData<Boolean> subscribeToExRateCouponRequireEvent();
LiveData<AmountDetailSendMoneyFragment.CouponDetailViewDTO> subscribeToCouponSelectedEvent();
void clearPaymentData();
String returnNullOnValidaitonAndSetPaymentModeData(PayoutMode selectedPayoutMode, BankList selectedBank, BankBranchDTO selectedBranch, String text);
String getPaymentModeTitle();
Observable<BranchListApiResponse> 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<CouponDTO> getCouponList();
void onCouponSelected(CouponDTO coupon);
int getSelectedCouponIndex();
WebRequestModel getWebRequestDataForFraudWarning();

88
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<CouponDTO> 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);
}
}

166
app/src/main/res/layout/fragment_amount_detail_send_money_v2.xml

@ -234,171 +234,6 @@
</FrameLayout>
</LinearLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/couponViewContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="8dp"
android:background="@drawable/curve_rectangle_grey_bg"
android:padding="8dp"
android:visibility="gone">
<View
android:id="@+id/view7"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="16dp"
android:background="@color/gray"
android:visibility="visible"
app:layout_constraintBottom_toTopOf="@+id/gmeCouponAppliedAmountTxt"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/gmeCouponTxt" />
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView
android:id="@+id/gmeCouponTitleTxt"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:gravity="start|center_vertical"
android:text="@string/coupon_text"
android:textSize="@dimen/_13ssp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@+id/gmeCouponTxt"
app:layout_constraintEnd_toStartOf="@+id/view6"
app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/gmeCouponTxt" />
<View
android:id="@+id/view6"
android:layout_width="2dp"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:background="@color/gray"
app:layout_constraintBottom_toBottomOf="@+id/gmeCouponTxt"
app:layout_constraintEnd_toStartOf="@+id/gmeCouponTxt"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/gmeCouponTitleTxt"
app:layout_constraintTop_toTopOf="@+id/gmeCouponTxt" />
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView
android:id="@+id/gmeCouponTxt"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:gravity="center_vertical|end"
android:textSize="@dimen/_12ssp"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@+id/view7"
app:layout_constraintEnd_toStartOf="@+id/gmeCoupontDropDown"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/view6"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/gmeCoupontDropDown"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|end"
android:layout_marginStart="@dimen/_4sdp"
android:layout_marginEnd="@dimen/_4sdp"
android:background="@drawable/ic_arrow_down"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="@+id/gmeCouponTxt"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/gmeCouponTxt"
app:layout_constraintTop_toTopOf="@+id/gmeCouponTxt" />
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView
android:id="@+id/gmeCouponAppliedAmountTxt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:gravity="start|center_vertical"
android:text="@string/applied_amount_text"
android:textColor="@color/black"
android:textSize="@dimen/_13ssp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@+id/gmeCouponAppliedAmountValueTxt"
app:layout_constraintEnd_toStartOf="@+id/gmeCouponAppliedAmountValueTxt"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/gmeCouponTitleTxt"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/gmeCouponAppliedAmountValueTxt"
app:txtfontName="@string/bold" />
<View
android:id="@+id/appliedTxtUnderlineView"
android:layout_width="0dp"
android:layout_height="2dp"
android:background="#370096FF"
app:layout_constraintEnd_toEndOf="@id/gmeCouponAppliedAmountTxt"
app:layout_constraintStart_toStartOf="@+id/gmeCouponAppliedAmountTxt"
app:layout_constraintTop_toBottomOf="@+id/gmeCouponAppliedAmountTxt" />
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView
android:id="@+id/gmeCouponAppliedAmountValueTxt"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="2dp"
android:layout_marginBottom="8dp"
android:gravity="center_vertical|end"
android:textColor="@color/colorPrimary"
android:textSize="@dimen/_24ssp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/gmeKRWTxt"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/gmeCouponAppliedAmountTxt"
app:layout_constraintTop_toBottomOf="@+id/view7"
app:txtfontName="@string/bold"
tools:text="25,600" />
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView
android:id="@+id/gmeKRWTxt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:gravity="center_vertical|end"
android:text="KRW"
android:textSize="@dimen/_14ssp"
android:textStyle="bold"
app:layout_constraintBaseline_toBaselineOf="@+id/gmeCouponAppliedAmountValueTxt"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/gmeCouponAppliedAmountValueTxt" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="top"
app:constraint_referenced_ids="view7"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="48dp" />
<androidx.constraintlayout.widget.Group
android:id="@+id/appliedAmountViewGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:constraint_referenced_ids="gmeCouponAppliedAmountValueTxt,appliedTxtUnderlineView,view7,gmeKRWTxt,gmeCouponAppliedAmountTxt"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="8dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeButton
@ -408,6 +243,7 @@
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:text="@string/calculate_text"
android:enabled="true"
/>
</LinearLayout>

Loading…
Cancel
Save