Browse Source

Send Money Flow almost fixes

master
preyearegmi 6 years ago
parent
commit
3dcd2c9461
  1. 1
      app/src/main/java/com/gmeremit/online/gmeremittance_native/base/PrivilegedGateway.java
  2. 18
      app/src/main/java/com/gmeremit/online/gmeremittance_native/kycform/view/DocumentsActivity.java
  3. 27
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/gateway/SendMoneyV2Gateway.java
  4. 4
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/presenter/SendMoneyV2InteractorInterface.java
  5. 73
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/presenter/SendMoneyV2Presenter.java
  6. 24
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/view/SendMoneyV2Activity.java
  7. 414
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/view/amountdetail/AmountDetailSendMoneyFragment.java
  8. 1
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sign_in/model/LoginModel.java
  9. 22
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sign_in/model/data/LoginApiResponseModelV2.java
  10. 301
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sign_in/model/data/SignInResponse.java
  11. 12
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sign_in/presenter/LoginPresenter.java
  12. 22
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sign_in/view/LoginView.java
  13. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/user_profile/model/UserProfileModel.java
  14. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/Utils.java
  15. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/base/RefreshModal.java
  16. 4
      app/src/main/res/layout/fragment_amount_detail_send_money_v2.xml
  17. 17
      app/src/main/res/layout/fragment_payout_mode_send_money_v2.xml

1
app/src/main/java/com/gmeremit/online/gmeremittance_native/base/PrivilegedGateway.java

@ -52,4 +52,5 @@ public abstract class PrivilegedGateway implements PrivilegedGatewayInterface {
public String getUserID() { public String getUserID() {
return GmeApplication.getStorage().getString(PrefKeys.USER_ID,""); return GmeApplication.getStorage().getString(PrefKeys.USER_ID,"");
} }
} }

18
app/src/main/java/com/gmeremit/online/gmeremittance_native/kycform/view/DocumentsActivity.java

@ -201,15 +201,15 @@ public class DocumentsActivity extends AppCompatActivity implements KycFormContr
@Override @Override
public void redirectToNextVeiw(SignInResponse signInResponse) { public void redirectToNextVeiw(SignInResponse signInResponse) {
persistenceStorageManager.setIsKycFirst(true); persistenceStorageManager.setIsKycFirst(true);
persistenceStorageManager.setUserId(signInResponse.userId);
persistenceStorageManager.setNickName(signInResponse.nickName);
persistenceStorageManager.setImageUrl(signInResponse.dpUrl);
persistenceStorageManager.setBankName(signInResponse.primaryBankName);
persistenceStorageManager.setBALANCE(signInResponse.availableBalance);
persistenceStorageManager.setWalletNumber(signInResponse.walletNumber);
persistenceStorageManager.setRewardPoint(signInResponse.rewardPoint);
persistenceStorageManager.setFirstName(signInResponse.firstName);
persistenceStorageManager.setFullName(Utility.getName(signInResponse.firstName,signInResponse.middleName,signInResponse.lastName));
persistenceStorageManager.setUserId(signInResponse.getUserId());
persistenceStorageManager.setNickName(signInResponse.getNickName());
persistenceStorageManager.setImageUrl(signInResponse.getDpUrl());
persistenceStorageManager.setBankName(signInResponse.getPrimaryBankName());
persistenceStorageManager.setBALANCE(signInResponse.getAvailableBalance());
persistenceStorageManager.setWalletNumber(signInResponse.getWalletNumber());
persistenceStorageManager.setRewardPoint(signInResponse.getRewardPoint());
persistenceStorageManager.setFirstName(signInResponse.getFirstName());
persistenceStorageManager.setFullName(Utility.getName(signInResponse.getFirstName(),signInResponse.getMiddleName(),signInResponse.getLastName()));
//persistenceStorageManager.setVerifiedUser(signInResponse.verified); //persistenceStorageManager.setVerifiedUser(signInResponse.verified);
startActivity(new Intent(this, HomeActivity.class)); startActivity(new Intent(this, HomeActivity.class));

27
app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/gateway/SendMoneyV2Gateway.java

@ -4,6 +4,8 @@ import com.gmeremit.online.gmeremittance_native.agentsV2.model.AgentsListApiResp
import com.gmeremit.online.gmeremittance_native.agentsV2.presenter.AgentListV2InteractorInterface; import com.gmeremit.online.gmeremittance_native.agentsV2.presenter.AgentListV2InteractorInterface;
import com.gmeremit.online.gmeremittance_native.base.PrivilegedGateway; import com.gmeremit.online.gmeremittance_native.base.PrivilegedGateway;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse; import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.SendMoneyAPIRequestBody;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.SendMoneyTransactionResponseBody;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.amountdetail.BranchListApiResponse; import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.amountdetail.BranchListApiResponse;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.payoutmode.AccountValidationApiResponse; import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.payoutmode.AccountValidationApiResponse;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.payoutmode.PayoutModeApiResponse; import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.payoutmode.PayoutModeApiResponse;
@ -82,33 +84,16 @@ public class SendMoneyV2Gateway extends PrivilegedGateway implements SendMoneyV2
return HttpClientV2.getInstance().accountValidationV2(auth,jsonObject); return HttpClientV2.getInstance().accountValidationV2(auth,jsonObject);
} }
@Override @Override
public Observable<PayoutModeApiResponse> getAgentInfoListFromNetwork(String auth, String recipientCountryId, String recipientId) {
return HttpClientV2.getInstance().getPayoutModeForSendMoneyV2(auth,recipientCountryId,recipientId);
// PayoutModeApiResponse payoutModeApiResponse;
// Gson gson=new GsonBuilder().create();
// payoutModeApiResponse=gson.fromJson(mockedPaymentModeString,PayoutModeApiResponse.class);
// return Observable.just(payoutModeApiResponse);
public Observable<SendMoneyTransactionResponseBody> performSendMoneyTransaction(String auth, SendMoneyAPIRequestBody requestBody) {
return HttpClientV2.getInstance().performSendMoneyTransactionV2(auth,requestBody);
} }
@Override
public String getUserFirstName() {
return null;
}
@Override @Override
public String getUserLastName() {
return null;
public Observable<PayoutModeApiResponse> getAgentInfoListFromNetwork(String auth, String recipientCountryId, String recipientId) {
return HttpClientV2.getInstance().getPayoutModeForSendMoneyV2(auth,recipientCountryId,recipientId);
} }
@Override
public String getUserIDType() {
return null;
}
@Override
public String getUserIDNumber() {
return null;
}
} }

4
app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/presenter/SendMoneyV2InteractorInterface.java

@ -4,6 +4,8 @@ import com.gmeremit.online.gmeremittance_native.agentsV2.model.AgentsListApiResp
import com.gmeremit.online.gmeremittance_native.base.BaseInteractorInterface; import com.gmeremit.online.gmeremittance_native.base.BaseInteractorInterface;
import com.gmeremit.online.gmeremittance_native.base.PrivilegedGatewayInterface; import com.gmeremit.online.gmeremittance_native.base.PrivilegedGatewayInterface;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse; import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.SendMoneyAPIRequestBody;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.SendMoneyTransactionResponseBody;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.amountdetail.BranchListApiResponse; import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.amountdetail.BranchListApiResponse;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.payoutmode.AccountValidationApiResponse; import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.payoutmode.AccountValidationApiResponse;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.payoutmode.PayoutModeApiResponse; import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.payoutmode.PayoutModeApiResponse;
@ -42,5 +44,7 @@ public interface SendMoneyV2InteractorInterface extends BaseInteractorInterface
String payoutPartner, String payoutPartner,
String processId); String processId);
Observable<SendMoneyTransactionResponseBody> performSendMoneyTransaction(String auth, SendMoneyAPIRequestBody requestBody);
} }
} }

73
app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/presenter/SendMoneyV2Presenter.java

@ -3,11 +3,13 @@ package com.gmeremit.online.gmeremittance_native.sendmoneyV2.presenter;
import android.util.Log; import android.util.Log;
import com.gmeremit.online.gmeremittance_native.base.BasePresenter; import com.gmeremit.online.gmeremittance_native.base.BasePresenter;
import com.gmeremit.online.gmeremittance_native.customwidgets.CustomAlertDialog;
import com.gmeremit.online.gmeremittance_native.customwidgets.passwordpromptdialog.PasswordPromptDialog; import com.gmeremit.online.gmeremittance_native.customwidgets.passwordpromptdialog.PasswordPromptDialog;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse; import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.recipientV2.model.recipientlisting.RecipientInfoModel; import com.gmeremit.online.gmeremittance_native.recipientV2.model.recipientlisting.RecipientInfoModel;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.gateway.SendMoneyV2Gateway; import com.gmeremit.online.gmeremittance_native.sendmoneyV2.gateway.SendMoneyV2Gateway;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.SendMoneyAPIRequestBody; import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.SendMoneyAPIRequestBody;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.SendMoneyTransactionResponseBody;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.amountdetail.AmountDetailRelatedDataModel; import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.amountdetail.AmountDetailRelatedDataModel;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.amountdetail.BranchListApiResponse; import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.amountdetail.BranchListApiResponse;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.amountdetail.RecipientCurrencyModel; import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.amountdetail.RecipientCurrencyModel;
@ -119,9 +121,8 @@ public class SendMoneyV2Presenter extends BasePresenter implements SendMoneyV2Pr
@Override @Override
public Observable<AccountValidationApiResponse> validateAccountIfRequired() { public Observable<AccountValidationApiResponse> validateAccountIfRequired() {
//TODO uncomment for live
// if(isAccountValidationRequired&&selectedAccountNo!=null)
// return sendDataForAccountValidation().subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
if(isAccountValidationRequired&&selectedAccountNo!=null)
return sendDataForAccountValidation().subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
return Observable.just(new AccountValidationApiResponse(Constants.SUCCESS_CODE_V2,"","")); return Observable.just(new AccountValidationApiResponse(Constants.SUCCESS_CODE_V2,"",""));
} }
@ -179,42 +180,8 @@ public class SendMoneyV2Presenter extends BasePresenter implements SendMoneyV2Pr
SendMoneyAPIRequestBody sendMoneyAPIRequestBody= new SendMoneyAPIRequestBody(); SendMoneyAPIRequestBody sendMoneyAPIRequestBody= new SendMoneyAPIRequestBody();
// "user": "sender email",
// "senderId": "353434",
// "receiverId": "43434",
// "deliveryMethodId": "serviceType",
// "pBranch": "bank branch",
// "pAgent": "agent",
//
// "payOutPartner":""
// "paymentType": "wallet",
//
// "pCurr": "pay out currency NPR",
// "collCurr": "KRW",
// "collAmt": "1000 KRW",
// "payoutAmt": "100 NPR",
// "transferAmt": "1000",
// "serviceCharge": "12",
// "discount": "",
// "exRate": "exRate",
// "calBy": "",
// "tpExRate": "exRate",
// "tpPCurr": "pCurr",
// "foreX_SESSION_ID": "",
//
// "purposeOfRemittance":"",
// "sourceOfFund": "",
// "relWithSender": "",
// "occupation": "",
// "ipAddress": "",
// "rState": "",
// "rLocation": "",
//
// "isAgreed": "",
// "txnPassword": "",
sendMoneyAPIRequestBody.setUser(gateway.getUserEmailID()); sendMoneyAPIRequestBody.setUser(gateway.getUserEmailID());
sendMoneyAPIRequestBody.setSenderId(gateway.getUserID());
sendMoneyAPIRequestBody.setSenderId(gateway.getUserIDNumber());
sendMoneyAPIRequestBody.setReceiverId(selectedRecipient.getRecipientId()); sendMoneyAPIRequestBody.setReceiverId(selectedRecipient.getRecipientId());
@ -234,7 +201,7 @@ public class SendMoneyV2Presenter extends BasePresenter implements SendMoneyV2Pr
sendMoneyAPIRequestBody.setCalBy(selectedCalcBy); sendMoneyAPIRequestBody.setCalBy(selectedCalcBy);
sendMoneyAPIRequestBody.setTpExRate(selectedExRate); sendMoneyAPIRequestBody.setTpExRate(selectedExRate);
sendMoneyAPIRequestBody.setTpPCurr(selectedSendingCurrency); sendMoneyAPIRequestBody.setTpPCurr(selectedSendingCurrency);
sendMoneyAPIRequestBody.setForeXSESSIONID(selectedSendingCurrency);
sendMoneyAPIRequestBody.setForeXSESSIONID(selectedForexId);
sendMoneyAPIRequestBody.setPurposeOfRemittance(selectedRecipient.getReasonId()); sendMoneyAPIRequestBody.setPurposeOfRemittance(selectedRecipient.getReasonId());
sendMoneyAPIRequestBody.setSourceOfFund(""); sendMoneyAPIRequestBody.setSourceOfFund("");
@ -253,17 +220,18 @@ public class SendMoneyV2Presenter extends BasePresenter implements SendMoneyV2Pr
Log.d("SendMoneyV2",dummyString); Log.d("SendMoneyV2",dummyString);
compositeObservable.add(
gateway.performSendMoneyTransaction(gateway.getAuth(),sendMoneyAPIRequestBody)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribeWith(new SendMoneyTransactionObserver())
);
} }
private SendMoneyAPIRequestBody collectDataFromPaymentModeData(SendMoneyAPIRequestBody sendMoneyAPIRequestBody) {
return sendMoneyAPIRequestBody;
}
@Override @Override
public void onViewDestroyed() { public void onViewDestroyed() {
@ -370,22 +338,29 @@ public class SendMoneyV2Presenter extends BasePresenter implements SendMoneyV2Pr
} }
public class SendMoneyTransactionObserver extends GenericApiObserverResponse<SendMoneyTransactionObserver>
public class SendMoneyTransactionObserver extends GenericApiObserverResponse<SendMoneyTransactionResponseBody>
{ {
@Override @Override
protected void onSuccess(SendMoneyTransactionObserver sendMoneyTransactionObserver) {
protected void onSuccess(SendMoneyTransactionResponseBody sendMoneyResponse) {
if(sendMoneyResponse.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2))
{
Log.d("SendMoneyV2",sendMoneyResponse.getId());
}
else
{
view.showPopUpMessage(sendMoneyResponse.getMsg(), CustomAlertDialog.AlertType.FAILED,null);
}
} }
@Override @Override
public void onFailed(String message) { public void onFailed(String message) {
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED,null);
} }
@Override @Override
protected void onConnectionNotEstablished(String message) { protected void onConnectionNotEstablished(String message) {
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED,null);
} }
} }
} }

24
app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/view/SendMoneyV2Activity.java

@ -44,6 +44,8 @@ public class SendMoneyV2Activity extends BaseActivity implements SendMoneyAction
@BindView(R.id.iv_cancel) @BindView(R.id.iv_cancel)
View iv_cancel; View iv_cancel;
public static String RECIPIENT_DATA="recipientData";
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@ -63,9 +65,14 @@ public class SendMoneyV2Activity extends BaseActivity implements SendMoneyAction
} catch (Exception e) { } catch (Exception e) {
recipientInfoModel = null; recipientInfoModel = null;
} }
addScreenToSendMoneyOnly(R.layout.fragment_payout_mode_send_money_v2, false);
} }
else
{
recipientInfoModel=savedInstanceState.getParcelable(RECIPIENT_DATA);
}
addScreenToSendMoneyOnly(R.layout.fragment_payout_mode_send_money_v2, false);
} }
private void initialize() { private void initialize() {
@ -233,6 +240,19 @@ public class SendMoneyV2Activity extends BaseActivity implements SendMoneyAction
} }
} }
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putParcelable(RECIPIENT_DATA,recipientInfoModel);
}
@Override
public void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
recipientInfoModel=savedInstanceState.getParcelable(RECIPIENT_DATA);
}
@Override @Override
public void promptPassword(PasswordPromptDialog.PasswordPromptListener listener) { public void promptPassword(PasswordPromptDialog.PasswordPromptListener listener) {
PasswordPromptDialog passwordPromptDialog=new PasswordPromptDialog(); PasswordPromptDialog passwordPromptDialog=new PasswordPromptDialog();

414
app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/view/amountdetail/AmountDetailSendMoneyFragment.java

@ -64,7 +64,7 @@ public class AmountDetailSendMoneyFragment extends BaseFragment implements View.
ImageView recepientFlagImageView; ImageView recepientFlagImageView;
private boolean shouldCaulatedByRecipient; private boolean shouldCaulatedByRecipient;
private boolean shouldCalculateExRate=true;
private boolean shouldCalculateExRate = true;
CompositeDisposable compositeDisposable = null; CompositeDisposable compositeDisposable = null;
@ -188,25 +188,20 @@ public class AmountDetailSendMoneyFragment extends BaseFragment implements View.
// { // {
// showToastMessage("Please specify sending amount."); // showToastMessage("Please specify sending amount.");
// } // }
//TODO remove && false
if(shouldCalculateExRate&&false)
{
if(shouldCaulatedByRecipient&&!validateAmountIsNotEmpty(recieveMoneyEditText.getText().toString()))
{
if (shouldCalculateExRate) {
if (shouldCaulatedByRecipient && !validateAmountIsNotEmpty(recieveMoneyEditText.getText().toString())) {
showToastMessage("Please specify either of the amount."); showToastMessage("Please specify either of the amount.");
return; return;
} }
if(!shouldCaulatedByRecipient&&!validateAmountIsNotEmpty(sendMoneyEditText.getText().toString()))
{
if (!shouldCaulatedByRecipient && !validateAmountIsNotEmpty(sendMoneyEditText.getText().toString())) {
showToastMessage("Please specify either of the amount."); showToastMessage("Please specify either of the amount.");
return; return;
} }
getForex(); getForex();
}
else
{
if(validateAll()) {
((SendMoneyActionListener) getActivity()).getPresenter().setSendingAmount(sendMoneyEditText.getText().toString(),selectedsendingCurrency,selectedExRate,selectedRecipientAmount,selectedTransferFeeAmount,shouldCaulatedByRecipient,selectedExRateId);
} else {
if (validateAll()) {
((SendMoneyActionListener) getActivity()).getPresenter().setSendingAmount(sendMoneyEditText.getText().toString(), selectedsendingCurrency, selectedExRate, selectedRecipientAmount, selectedTransferFeeAmount, shouldCaulatedByRecipient, selectedExRateId);
((SendMoneyV2Activity) getActivity()).addScreenToSendMoney(R.layout.fragment_verification_send_money_v2, true); ((SendMoneyV2Activity) getActivity()).addScreenToSendMoney(R.layout.fragment_verification_send_money_v2, true);
} }
@ -237,252 +232,269 @@ public class AmountDetailSendMoneyFragment extends BaseFragment implements View.
this.recepientCurrencyTextView.setText(selectedCountryCurrency); this.recepientCurrencyTextView.setText(selectedCountryCurrency);
} }
private void showTransferfeeAndExRate(String transferDisplay, String exRateDisplay) {
this.exchangeRateTxtView.setVisibility(View.INVISIBLE);
this.exchangeRateTxtView.setText(exRateDisplay);
this.exchangeRateTxtView.setTranslationY(this.exchangeRateTxtView.getHeight());
this.exchangeRateTxtView.setVisibility(View.VISIBLE);
ViewCompat.animate(this.exchangeRateTxtView).translationY(0).setDuration(550).setInterpolator(this.interpolator).start();
private void showTransferfeeAndExRate(boolean action, String transferDisplay, String exRateDisplay) {
this.transferFeeTxtView.setVisibility(View.INVISIBLE);
this.transferFeeTxtView.setText(transferDisplay);
this.transferFeeTxtView.setTranslationY(this.transferFeeTxtView.getHeight());
this.transferFeeTxtView.setVisibility(View.VISIBLE);
ViewCompat.animate(this.transferFeeTxtView).translationY(0).setDuration(550).setInterpolator(this.interpolator).start();
}
if (action) {
if (this.exchangeRateTxtView.getVisibility() == View.VISIBLE)
this.exchangeRateTxtView.setVisibility(View.INVISIBLE);
this.exchangeRateTxtView.setText(exRateDisplay);
this.exchangeRateTxtView.setTranslationY(this.exchangeRateTxtView.getHeight());
this.exchangeRateTxtView.setVisibility(View.VISIBLE);
ViewCompat.animate(this.exchangeRateTxtView).translationY(0).setDuration(550).setInterpolator(this.interpolator).start();
private void showSendAndRecieveAmount(String sendAmount, String recieveAmount) {
updateSendAmount(sendAmount);
updateRecievingAmount(recieveAmount);
}
private boolean validateAmountIsNotEmpty(String amount) {
return amount != null && amount.length() > 0;
}
if (this.transferFeeTxtView.getVisibility() == View.VISIBLE)
this.transferFeeTxtView.setVisibility(View.INVISIBLE);
this.transferFeeTxtView.setText(transferDisplay);
this.transferFeeTxtView.setTranslationY(this.transferFeeTxtView.getHeight());
this.transferFeeTxtView.setVisibility(View.VISIBLE);
ViewCompat.animate(this.transferFeeTxtView).translationY(0).setDuration(550).setInterpolator(this.interpolator).start();
@Override
public void onCurrencySelected(RecipientCurrencyModel selectedCurrency) {
amountDetailRelatedData.setDefaultSelectedCurrency(selectedCurrency);
} else {
if (exchangeRateTxtView.getVisibility() == View.VISIBLE)
this.exchangeRateTxtView.setVisibility(View.INVISIBLE);
if (exRateCountryListingDialog != null)
exRateCountryListingDialog.dismiss();
exRateCountryListingDialog = null;
if (transferFeeTxtView.getVisibility() == View.VISIBLE) {
this.transferFeeTxtView.setVisibility(View.INVISIBLE);
showSelectedCurrency(amountDetailRelatedData.getDefaultSelectedCurrency().getCountryCode(),amountDetailRelatedData.getDefaultSelectedCurrency().getCurrencyCode());
}
}
} }
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
switch (v.getId()) {
case R.id.sendAmountEdTxt:
if (actionId == EditorInfo.IME_ACTION_DONE) {
hideKeyBoard();
shouldCaulatedByRecipient = false;
if (validateAmountIsNotEmpty(sendMoneyEditText.getText().toString()))
getForex();
else
showToastMessage("Please specify sending amount.");
}
return true;
case R.id.receiveAmountEdTxt:
if (actionId == EditorInfo.IME_ACTION_DONE) {
hideKeyBoard();
shouldCaulatedByRecipient = true;
if (validateAmountIsNotEmpty(recieveMoneyEditText.getText().toString()))
getForex();
else
showToastMessage("Please specify recieving amount.");
}
return true;
private void showSendAndRecieveAmount (String sendAmount, String recieveAmount){
updateSendAmount(sendAmount);
updateRecievingAmount(recieveAmount);
} }
return false;
}
public class ExchangeRateCalcObserver extends GenericApiObserverResponse<ExchangeCalculationApiResponse> {
private boolean validateAmountIsNotEmpty (String amount){
return amount != null && amount.length() > 0;
}
@Override @Override
protected void onSuccess(ExchangeCalculationApiResponse exchangeCalculationApiResponse) {
if(isUIReady()) {
showProgressBar(false, "");
if (exchangeCalculationApiResponse.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) {
ExchangeCalculationModel data = exchangeCalculationApiResponse.getData();
selectedTransferFeeAmount = data.getScCharge();
selectedExRate = data.getExRateDisplay();
selectedRecipientAmount = data.getpAmt();
selectedSendAmount = data.getCollAmt();
selectedsendingCurrency = data.getCollCurr();
selectedExRateId=data.getExrateId();
public void onCurrencySelected (RecipientCurrencyModel selectedCurrency){
amountDetailRelatedData.setDefaultSelectedCurrency(selectedCurrency);
String transferDisplay = " - " + selectedTransferFeeAmount + " " + selectedsendingCurrency + " (Transfer Fee Included)";
String exRateDisplay = " " + selectedExRate + " (Current Exchange Rate)";
if (exRateCountryListingDialog != null)
exRateCountryListingDialog.dismiss();
exRateCountryListingDialog = null;
showTransferfeeAndExRate(transferDisplay, exRateDisplay);
showSendAndRecieveAmount(selectedSendAmount, selectedRecipientAmount);
showSelectedCurrency(amountDetailRelatedData.getDefaultSelectedCurrency().getCountryCode(), amountDetailRelatedData.getDefaultSelectedCurrency().getCurrencyCode());
}
@Override
public boolean onEditorAction (TextView v,int actionId, KeyEvent event){
switch (v.getId()) {
case R.id.sendAmountEdTxt:
if (actionId == EditorInfo.IME_ACTION_DONE) {
hideKeyBoard();
shouldCaulatedByRecipient = false;
if (validateAmountIsNotEmpty(sendMoneyEditText.getText().toString()))
getForex();
else
showToastMessage("Please specify sending amount.");
}
return true;
case R.id.receiveAmountEdTxt:
if (actionId == EditorInfo.IME_ACTION_DONE) {
hideKeyBoard();
shouldCaulatedByRecipient = true;
if (validateAmountIsNotEmpty(recieveMoneyEditText.getText().toString()))
getForex();
else
showToastMessage("Please specify recieving amount.");
}
return true;
} else
showPopUpMessage(exchangeCalculationApiResponse.getMsg(), CustomAlertDialog.AlertType.FAILED, null);
} }
return false;
} }
@Override
public void onFailed(String message) {
showProgressBar(false,"");
showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, null);
}
public class ExchangeRateCalcObserver extends GenericApiObserverResponse<ExchangeCalculationApiResponse> {
@Override
protected void onSuccess(ExchangeCalculationApiResponse exchangeCalculationApiResponse) {
if (isUIReady()) {
showProgressBar(false, "");
if (exchangeCalculationApiResponse.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) {
ExchangeCalculationModel data = exchangeCalculationApiResponse.getData();
selectedTransferFeeAmount = data.getScCharge();
selectedExRate = data.getExRateDisplay();
selectedRecipientAmount = data.getpAmt();
selectedSendAmount = data.getCollAmt();
selectedsendingCurrency = data.getCollCurr();
selectedExRateId = data.getExrateId();
String transferDisplay = " - " + selectedTransferFeeAmount + " " + selectedsendingCurrency + " (Transfer Fee Included)";
String exRateDisplay = " " + selectedExRate + " (Current Exchange Rate)";
showTransferfeeAndExRate(true,transferDisplay, exRateDisplay);
showSendAndRecieveAmount(selectedSendAmount, selectedRecipientAmount);
updateButtonToCalculate(false);
} else
showPopUpMessage(exchangeCalculationApiResponse.getMsg(), CustomAlertDialog.AlertType.FAILED, null);
}
}
@Override
protected void onConnectionNotEstablished(String message) {
showProgressBar(false,"");
showPopUpMessage(message, CustomAlertDialog.AlertType.NO_INTERNET, null);
@Override
public void onFailed(String message) {
showProgressBar(false, "");
showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, null);
}
@Override
protected void onConnectionNotEstablished(String message) {
showProgressBar(false, "");
showPopUpMessage(message, CustomAlertDialog.AlertType.NO_INTERNET, null);
}
} }
}
public class AmountDetailRelatedDataObserver extends GenericApiObserverResponse<AmountDetailRelatedDataModel> {
public class AmountDetailRelatedDataObserver extends GenericApiObserverResponse<AmountDetailRelatedDataModel> {
@Override
protected void onSuccess(AmountDetailRelatedDataModel amountDetailRelatedDataModel) {
if (isUIReady()) {
amountDetailRelatedData = amountDetailRelatedDataModel;
if (amountDetailRelatedData.getDefaultSelectedCurrency() != null)
showSelectedCurrency(amountDetailRelatedData.getDefaultSelectedCurrency().getCountryCode(), amountDetailRelatedData.getDefaultSelectedCurrency().getCurrencyCode());
@Override
protected void onSuccess(AmountDetailRelatedDataModel amountDetailRelatedDataModel) {
if (isUIReady()) {
amountDetailRelatedData = amountDetailRelatedDataModel;
if (amountDetailRelatedData.getDefaultSelectedCurrency() != null)
showSelectedCurrency(amountDetailRelatedData.getDefaultSelectedCurrency().getCountryCode(), amountDetailRelatedData.getDefaultSelectedCurrency().getCurrencyCode());
updateButtonToCalculate(true);
}
scheduleTaskLater(() -> {
amountDetailRelatedData = amountDetailRelatedDataModel;
if (amountDetailRelatedData.getDefaultSelectedCurrency() != null)
showSelectedCurrency(amountDetailRelatedData.getDefaultSelectedCurrency().getCountryCode(), amountDetailRelatedData.getDefaultSelectedCurrency().getCurrencyCode());
updateButtonToCalculate(true);
});
} }
scheduleTaskLater(() -> {
amountDetailRelatedData = amountDetailRelatedDataModel;
if (amountDetailRelatedData.getDefaultSelectedCurrency() != null)
showSelectedCurrency(amountDetailRelatedData.getDefaultSelectedCurrency().getCountryCode(), amountDetailRelatedData.getDefaultSelectedCurrency().getCurrencyCode());
@Override
public void onFailed(String message) {
});
}
}
@Override
public void onFailed(String message) {
@Override
protected void onConnectionNotEstablished(String message) {
}
} }
@Override
protected void onConnectionNotEstablished(String message) {
}
}
private boolean validateAll()
{
if(validateAmountIsNotEmpty(sendMoneyEditText.getText().toString()))
private boolean validateAll ()
{ {
if(validateAmountIsNotEmpty(sendMoneyEditText.getText().toString()))
return true;
if (validateAmountIsNotEmpty(sendMoneyEditText.getText().toString())) {
if (validateAmountIsNotEmpty(sendMoneyEditText.getText().toString()))
return true;
else {
showToastMessage("Please specify recieving amount.");
return false;
}
else
{
showToastMessage("Please specify recieving amount.");
} else {
showToastMessage("Please specify sending amount.");
return false; return false;
} }
} }
else
private void updateButtonToCalculate ( boolean action)
{ {
showToastMessage("Please specify sending amount.");
return false;
shouldCalculateExRate = action;
if (action)
continueBtn.setText("Calculate");
else
continueBtn.setText("Continue");
} }
}
private void updateButtonToCalculate(boolean action)
{
shouldCalculateExRate=action;
if(action)
continueBtn.setText("Calculate");
else
continueBtn.setText("Continue");
}
private void updateSendAmount(String amount)
{
registerAvailableTextWatchersForEditText(sendMoneyEditText,false);
sendMoneyEditText.setText(amount);
registerAvailableTextWatchersForEditText(sendMoneyEditText,true);
}
private void updateRecievingAmount(String amount)
{
registerAvailableTextWatchersForEditText(recieveMoneyEditText,false);
recieveMoneyEditText.setText(amount);
registerAvailableTextWatchersForEditText(recieveMoneyEditText,true);
}
private void registerTextWatchers(boolean action) {
if (action) {
if (sendAmountTextWatcher == null)
sendAmountTextWatcher = new SendAmountTextWatcher();
if (recepientAmountTextWatcher == null)
recepientAmountTextWatcher = new RecipientAmountTextWatcher();
private void updateSendAmount (String amount)
{
registerAvailableTextWatchersForEditText(sendMoneyEditText, false);
sendMoneyEditText.setText(amount);
registerAvailableTextWatchersForEditText(sendMoneyEditText, true);
}
private void updateRecievingAmount (String amount)
{
registerAvailableTextWatchersForEditText(recieveMoneyEditText, false);
recieveMoneyEditText.setText(amount);
registerAvailableTextWatchersForEditText(recieveMoneyEditText, true);
}
sendMoneyEditText.addTextChangedListener(sendAmountTextWatcher);
recieveMoneyEditText.addTextChangedListener(recepientAmountTextWatcher);
} else {
sendMoneyEditText.addTextChangedListener(null);
recieveMoneyEditText.addTextChangedListener(null);
private void registerTextWatchers ( boolean action){
if (action) {
if (sendAmountTextWatcher == null)
sendAmountTextWatcher = new SendAmountTextWatcher();
if (recepientAmountTextWatcher == null)
recepientAmountTextWatcher = new RecipientAmountTextWatcher();
sendMoneyEditText.addTextChangedListener(sendAmountTextWatcher);
recieveMoneyEditText.addTextChangedListener(recepientAmountTextWatcher);
} else {
sendMoneyEditText.addTextChangedListener(null);
recieveMoneyEditText.addTextChangedListener(null);
}
} }
}
private void registerAvailableTextWatchersForEditText(EditText editText, boolean action) {
switch (editText.getId()) {
case R.id.sendAmountEdTxt:
if (action)
sendMoneyEditText.addTextChangedListener(sendAmountTextWatcher);
else
sendMoneyEditText.removeTextChangedListener(sendAmountTextWatcher);
break;
case R.id.receiveAmountEdTxt:
if (action)
recieveMoneyEditText.addTextChangedListener(recepientAmountTextWatcher);
else
recieveMoneyEditText.removeTextChangedListener(recepientAmountTextWatcher);
break;
private void registerAvailableTextWatchersForEditText (EditText editText,boolean action){
switch (editText.getId()) {
case R.id.sendAmountEdTxt:
if (action)
sendMoneyEditText.addTextChangedListener(sendAmountTextWatcher);
else
sendMoneyEditText.removeTextChangedListener(sendAmountTextWatcher);
break;
case R.id.receiveAmountEdTxt:
if (action)
recieveMoneyEditText.addTextChangedListener(recepientAmountTextWatcher);
else
recieveMoneyEditText.removeTextChangedListener(recepientAmountTextWatcher);
break;
}
} }
}
private class SendAmountTextWatcher implements TextWatcher {
private class SendAmountTextWatcher implements TextWatcher {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
}
@Override
public void afterTextChanged(Editable s) {
shouldCaulatedByRecipient = false;
updateRecievingAmount("");
@Override
public void afterTextChanged(Editable s) {
shouldCaulatedByRecipient = false;
updateRecievingAmount("");
updateButtonToCalculate(true);
showTransferfeeAndExRate(false,"","");
}
} }
}
private class RecipientAmountTextWatcher implements TextWatcher {
private class RecipientAmountTextWatcher implements TextWatcher {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
}
@Override
public void afterTextChanged(Editable s) {
shouldCaulatedByRecipient = true;
updateSendAmount("");
@Override
public void afterTextChanged(Editable s) {
shouldCaulatedByRecipient = true;
updateSendAmount("");
updateButtonToCalculate(true);
showTransferfeeAndExRate(false,"","");
}
} }
}
}
}

1
app/src/main/java/com/gmeremit/online/gmeremittance_native/sign_in/model/LoginModel.java

@ -79,6 +79,7 @@ public class LoginModel implements LoginContract.LoginModel {
try{ try{
loginApiResponseModelV2=gson.fromJson(jsonBody,LoginApiResponseModelV2.class); loginApiResponseModelV2=gson.fromJson(jsonBody,LoginApiResponseModelV2.class);
SharedPreferences.Editor sharedPreferenceEditor = GmeApplication.getStorage().edit(); SharedPreferences.Editor sharedPreferenceEditor = GmeApplication.getStorage().edit();

22
app/src/main/java/com/gmeremit/online/gmeremittance_native/sign_in/model/data/LoginApiResponseModelV2.java

@ -86,8 +86,12 @@ public class LoginApiResponseModelV2 {
@SerializedName("Msg") @SerializedName("Msg")
@Expose @Expose
private String msg; private String msg;
@SerializedName("Id")
@Expose
private String id;
@SerializedName("Data")
@Expose
private Object data;
public String getUserId() { public String getUserId() {
return userId; return userId;
@ -305,5 +309,19 @@ public class LoginApiResponseModelV2 {
this.msg = msg; this.msg = msg;
} }
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
} }

301
app/src/main/java/com/gmeremit/online/gmeremittance_native/sign_in/model/data/SignInResponse.java

@ -10,68 +10,321 @@ import com.google.gson.annotations.SerializedName;
public class SignInResponse { public class SignInResponse {
@SerializedName("userId") @SerializedName("userId")
@Expose @Expose
public String userId;
private String userId;
@SerializedName("firstName") @SerializedName("firstName")
@Expose @Expose
public String firstName;
private String firstName;
@SerializedName("middleName") @SerializedName("middleName")
@Expose @Expose
public String middleName;
private String middleName;
@SerializedName("lastName") @SerializedName("lastName")
@Expose @Expose
public String lastName;
private String lastName;
@SerializedName("nickName") @SerializedName("nickName")
@Expose @Expose
public String nickName;
private String nickName;
@SerializedName("email") @SerializedName("email")
@Expose @Expose
public String email;
private String email;
@SerializedName("mobileNumber") @SerializedName("mobileNumber")
@Expose @Expose
public String mobileNumber;
private String mobileNumber;
@SerializedName("rewardPoint") @SerializedName("rewardPoint")
@Expose @Expose
public String rewardPoint;
private String rewardPoint;
@SerializedName("walletNumber") @SerializedName("walletNumber")
@Expose @Expose
public String walletNumber;
private String walletNumber;
@SerializedName("availableBalance") @SerializedName("availableBalance")
@Expose @Expose
public String availableBalance;
private String availableBalance;
@SerializedName("primaryBankName") @SerializedName("primaryBankName")
@Expose @Expose
public String primaryBankName;
private String primaryBankName;
@SerializedName("accessCode") @SerializedName("accessCode")
@Expose @Expose
public String accessCode;
private String accessCode;
@SerializedName("dpUrl") @SerializedName("dpUrl")
@Expose @Expose
public String dpUrl;
private String dpUrl;
@SerializedName("kyc") @SerializedName("kyc")
@Expose @Expose
public Boolean kyc;
private Boolean kyc;
@SerializedName("verified") @SerializedName("verified")
@Expose @Expose
public Boolean verified;
private Boolean verified;
@SerializedName("active") @SerializedName("active")
@Expose @Expose
public Boolean active;
private Boolean active;
@SerializedName("cmRegistrationId") @SerializedName("cmRegistrationId")
@Expose @Expose
public String cmRegistrationId;
private String cmRegistrationId;
@SerializedName("isReferred") @SerializedName("isReferred")
@Expose @Expose
public Boolean isReferred;
private Boolean isReferred;
@SerializedName("country") @SerializedName("country")
@Expose @Expose
public String country;
@SerializedName("city")
private String country;
@SerializedName("province")
@Expose @Expose
public String city;
@SerializedName("address")
private String province;
@SerializedName("provinceId")
@Expose @Expose
public String address;
private String provinceId;
@SerializedName("sourceId") @SerializedName("sourceId")
@Expose @Expose
public String sourceId;
private String sourceId;
@SerializedName("idType")
@Expose
private String idType;
@SerializedName("idNumber")
@Expose
private String idNumber;
@SerializedName("countryCode")
@Expose
private String countryCode;
@SerializedName("ErrorCode")
@Expose
private String errorCode;
@SerializedName("Msg")
@Expose
private String msg;
@SerializedName("Id")
@Expose
private String id;
@SerializedName("Data")
@Expose
private Object data;
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getMiddleName() {
return middleName;
}
public void setMiddleName(String middleName) {
this.middleName = middleName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getMobileNumber() {
return mobileNumber;
}
public void setMobileNumber(String mobileNumber) {
this.mobileNumber = mobileNumber;
}
public String getRewardPoint() {
return rewardPoint;
}
public void setRewardPoint(String rewardPoint) {
this.rewardPoint = rewardPoint;
}
public String getWalletNumber() {
return walletNumber;
}
public void setWalletNumber(String walletNumber) {
this.walletNumber = walletNumber;
}
public String getAvailableBalance() {
return availableBalance;
}
public void setAvailableBalance(String availableBalance) {
this.availableBalance = availableBalance;
}
public String getPrimaryBankName() {
return primaryBankName;
}
public void setPrimaryBankName(String primaryBankName) {
this.primaryBankName = primaryBankName;
}
public String getAccessCode() {
return accessCode;
}
public void setAccessCode(String accessCode) {
this.accessCode = accessCode;
}
public String getDpUrl() {
return dpUrl;
}
public void setDpUrl(String dpUrl) {
this.dpUrl = dpUrl;
}
public Boolean getKyc() {
return kyc;
}
public void setKyc(Boolean kyc) {
this.kyc = kyc;
}
public Boolean getVerified() {
return verified;
}
public void setVerified(Boolean verified) {
this.verified = verified;
}
public Boolean getActive() {
return active;
}
public void setActive(Boolean active) {
this.active = active;
}
public String getCmRegistrationId() {
return cmRegistrationId;
}
public void setCmRegistrationId(String cmRegistrationId) {
this.cmRegistrationId = cmRegistrationId;
}
public Boolean getReferred() {
return isReferred;
}
public void setReferred(Boolean referred) {
isReferred = referred;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getProvinceId() {
return provinceId;
}
public void setProvinceId(String provinceId) {
this.provinceId = provinceId;
}
public String getSourceId() {
return sourceId;
}
public void setSourceId(String sourceId) {
this.sourceId = sourceId;
}
public String getIdType() {
return idType;
}
public void setIdType(String idType) {
this.idType = idType;
}
public String getIdNumber() {
return idNumber;
}
public void setIdNumber(String idNumber) {
this.idNumber = idNumber;
}
public String getCountryCode() {
return countryCode;
}
public void setCountryCode(String countryCode) {
this.countryCode = countryCode;
}
public String getErrorCode() {
return errorCode;
}
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
} }

12
app/src/main/java/com/gmeremit/online/gmeremittance_native/sign_in/presenter/LoginPresenter.java

@ -103,18 +103,18 @@ public class LoginPresenter implements LoginContract.LoginPresenter, LoginContra
public void onSuccessLogin(SignInResponse signInResponse, SignInRequestBody signInJsonBody) { public void onSuccessLogin(SignInResponse signInResponse, SignInRequestBody signInJsonBody) {
loginView.stopDialog(); loginView.stopDialog();
loginView.setBalance(signInResponse.availableBalance);
loginView.setAccessCode(signInResponse.accessCode);
loginView.setEmail(signInResponse.email);
loginView.setBalance(signInResponse.getAvailableBalance());
loginView.setAccessCode(signInResponse.getAccessCode());
loginView.setEmail(signInResponse.getEmail());
loginView.setUserId(signInResponse.userId);
loginView.setUserId(signInResponse.getUserId());
loginView.setPassword(Utils.toBase64(signInJsonBody.password)); loginView.setPassword(Utils.toBase64(signInJsonBody.password));
loginView.redirectToKYCView(signInResponse); loginView.redirectToKYCView(signInResponse);
loginView.setSourceId(signInResponse.sourceId);
loginView.setRewardPoint(signInResponse.rewardPoint);
loginView.setSourceId(signInResponse.getSourceId());
loginView.setRewardPoint(signInResponse.getRewardPoint());
} }
/*** /***

22
app/src/main/java/com/gmeremit/online/gmeremittance_native/sign_in/view/LoginView.java

@ -231,22 +231,22 @@ public class LoginView extends AppCompatActivity implements LoginContract.LoginV
public void redirectToKYCView(SignInResponse signInResponse) { public void redirectToKYCView(SignInResponse signInResponse) {
DisplayUtils.hideKeyboard(this,btn_submit.getRootView()); DisplayUtils.hideKeyboard(this,btn_submit.getRootView());
if (signInResponse.email != null){
if (signInResponse.getEmail() != null){
persistenceStorageManager.checkUserIdType(true); persistenceStorageManager.checkUserIdType(true);
}else { }else {
persistenceStorageManager.checkUserIdType(false); persistenceStorageManager.checkUserIdType(false);
} }
persistenceStorageManager.setUserId(signInResponse.userId);
persistenceStorageManager.setNickName(signInResponse.nickName);
persistenceStorageManager.setImageUrl(signInResponse.dpUrl);
persistenceStorageManager.setBankName(signInResponse.primaryBankName);
persistenceStorageManager.setBALANCE(signInResponse.availableBalance);
persistenceStorageManager.setWalletNumber(signInResponse.walletNumber);
persistenceStorageManager.setRewardPoint(signInResponse.rewardPoint);
persistenceStorageManager.setVerifiedUser(signInResponse.verified);
persistenceStorageManager.setUserId(signInResponse.getUserId());
persistenceStorageManager.setNickName(signInResponse.getNickName());
persistenceStorageManager.setImageUrl(signInResponse.getDpUrl());
persistenceStorageManager.setBankName(signInResponse.getPrimaryBankName());
persistenceStorageManager.setBALANCE(signInResponse.getAvailableBalance());
persistenceStorageManager.setWalletNumber(signInResponse.getWalletNumber());
persistenceStorageManager.setRewardPoint(signInResponse.getRewardPoint());
persistenceStorageManager.setVerifiedUser(signInResponse.getVerified());
if (signInResponse.kyc) {
if (signInResponse.getKyc()) {
persistenceStorageManager.setLoggedin("HOME"); persistenceStorageManager.setLoggedin("HOME");
Intent intent = new Intent(this, HomeActivity.class); Intent intent = new Intent(this, HomeActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
@ -255,7 +255,7 @@ public class LoginView extends AppCompatActivity implements LoginContract.LoginV
} else { } else {
persistenceStorageManager.setLoggedin("KYC"); persistenceStorageManager.setLoggedin("KYC");
Intent intent = new Intent(this, KycFormActivity.class); Intent intent = new Intent(this, KycFormActivity.class);
intent.putExtra(Constants.ISREFERRED,signInResponse.isReferred);
intent.putExtra(Constants.ISREFERRED,signInResponse.getReferred());
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent); startActivity(intent);
finish(); finish();

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/user_profile/model/UserProfileModel.java

@ -455,7 +455,7 @@ public class UserProfileModel implements UserProfileContract.UserProfileModel {
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
}*/ }*/
listener.onSuccessProfilePicUpload(response.body().dpUrl);
listener.onSuccessProfilePicUpload(response.body().getDpUrl());
} else if (response.code() == 401) { } else if (response.code() == 401) {
RefreshModal modal = new RefreshModal(context); RefreshModal modal = new RefreshModal(context);

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/Utils.java

@ -311,7 +311,7 @@ public class Utils {
@Override @Override
public void onResponse(Call<SignInResponse> call, Response<SignInResponse> response) { public void onResponse(Call<SignInResponse> call, Response<SignInResponse> response) {
if (response.isSuccessful()) { if (response.isSuccessful()) {
persistenceStorageManager.setAccessCode(response.body().accessCode);
persistenceStorageManager.setAccessCode(response.body().getAccessCode());
} }
} }

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/base/RefreshModal.java

@ -47,7 +47,7 @@ public class RefreshModal {
// Log.e("BACK", response.code() + " " + response.body().accessCode+" --"); // Log.e("BACK", response.code() + " " + response.body().accessCode+" --");
if (response.isSuccessful()) { if (response.isSuccessful()) {
Log.e(" ", new Gson().toJson(response.body())); Log.e(" ", new Gson().toJson(response.body()));
persistenceStorageManager.setAccessCode(Utils.getBaseAccessCode(response.body().accessCode,context));
persistenceStorageManager.setAccessCode(Utils.getBaseAccessCode(response.body().getAccessCode(),context));
callback.onRefreshSuccess(); callback.onRefreshSuccess();
} else { } else {

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

@ -108,7 +108,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:paddingStart="3dp" android:paddingStart="3dp"
android:paddingEnd="3dp" android:paddingEnd="3dp"
android:layout_height="70dp" />
android:layout_height="60dp" />
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView <com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView
android:id="@+id/transferFeeTxtView" android:id="@+id/transferFeeTxtView"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -129,7 +129,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:paddingStart="3dp" android:paddingStart="3dp"
android:paddingEnd="3dp" android:paddingEnd="3dp"
android:layout_height="70dp" />
android:layout_height="60dp" />
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView <com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView
android:id="@+id/exchangeRateTxtView" android:id="@+id/exchangeRateTxtView"
android:layout_width="match_parent" android:layout_width="match_parent"

17
app/src/main/res/layout/fragment_payout_mode_send_money_v2.xml

@ -71,6 +71,8 @@
android:id="@+id/ed_bank" android:id="@+id/ed_bank"
style="@style/editetxtsingleline" style="@style/editetxtsingleline"
android:enabled="true" android:enabled="true"
android:layout_marginRight="12dp"
android:layout_marginEnd="12dp"
android:focusable="false" android:focusable="false"
android:imeOptions="actionDone" android:imeOptions="actionDone"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -79,11 +81,12 @@
/> />
</android.support.design.widget.TextInputLayout> </android.support.design.widget.TextInputLayout>
<ImageView <ImageView
android:layout_marginRight="12dp"
android:layout_gravity="center_vertical|end" android:layout_gravity="center_vertical|end"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/ic_arrow_down"/>
android:background="@drawable/ic_arrow_down"
/>
</FrameLayout> </FrameLayout>
<FrameLayout <FrameLayout
@ -107,6 +110,8 @@
style="@style/editetxtsingleline" style="@style/editetxtsingleline"
android:enabled="true" android:enabled="true"
android:focusable="false" android:focusable="false"
android:layout_marginRight="12dp"
android:layout_marginEnd="12dp"
android:imeOptions="actionDone" android:imeOptions="actionDone"
android:layout_width="match_parent" android:layout_width="match_parent"
android:singleLine="false" android:singleLine="false"
@ -114,11 +119,12 @@
/> />
</android.support.design.widget.TextInputLayout> </android.support.design.widget.TextInputLayout>
<ImageView <ImageView
android:layout_marginRight="12dp"
android:layout_gravity="center_vertical|end" android:layout_gravity="center_vertical|end"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/ic_arrow_down"/>
android:background="@drawable/ic_arrow_down"
/>
</FrameLayout> </FrameLayout>
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
@ -132,11 +138,14 @@
android:textColorHint="@color/darkgray"> android:textColorHint="@color/darkgray">
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeEditText <com.gmeremit.online.gmeremittance_native.customwidgets.GmeEditText
android:layout_marginRight="12dp"
android:layout_marginEnd="12dp"
android:id="@+id/ed_account" android:id="@+id/ed_account"
style="@style/editetxtsingleline" style="@style/editetxtsingleline"
android:imeOptions="actionDone" android:imeOptions="actionDone"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
</android.support.design.widget.TextInputLayout> </android.support.design.widget.TextInputLayout>
</LinearLayout> </LinearLayout>

Loading…
Cancel
Save