Browse Source

sprint 2 changes before firebase setup

new_design
Santosh Bhandary 4 years ago
parent
commit
8747ab1bab
  1. 15
      app/src/main/java/com/swifttech/remit/android/features/changepassNPin/presenter/ChangePassNPinViewModel.java
  2. 12
      app/src/main/java/com/swifttech/remit/android/features/changepassword/presenter/ChangePasswordV2Presenter.java
  3. 10
      app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/presenter/KYCV3ViewModel.java
  4. 1
      app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/view/documents/KYCIDTypeFragment.java
  5. 12
      app/src/main/java/com/swifttech/remit/android/features/login/presenter/LoginV2Presenter.java
  6. 24
      app/src/main/java/com/swifttech/remit/android/features/registerv2/existingcustomer/presenter/ExistingCustomerRegisterV2Presenter.java
  7. 27
      app/src/main/java/com/swifttech/remit/android/features/registerv2/newcustomer/presenter/NewRegisterV2Presenter.java
  8. 1
      app/src/main/res/values/strings.xml

15
app/src/main/java/com/swifttech/remit/android/features/changepassNPin/presenter/ChangePassNPinViewModel.java

@ -163,41 +163,40 @@ public class ChangePassNPinViewModel extends BaseViewModel implements ChangePass
boolean isCurrentPasswordValid(CharSequence password) { boolean isCurrentPasswordValid(CharSequence password) {
if (password != null && password.length() > 0) {
if(password!=null && password.toString().trim().matches("^(?=.*[A-Z])(?=.*[0-9])(?=.*[a-z]).{8,24}$")){
this.currentPassword = password.toString(); this.currentPassword = password.toString();
changePassNPinLiveData.setCurrentPasswordInputLiveData(new FormInputStateDTO<>(true, null)); changePassNPinLiveData.setCurrentPasswordInputLiveData(new FormInputStateDTO<>(true, null));
return true; return true;
} else {
}else{
this.currentPassword = null; this.currentPassword = null;
changePassNPinLiveData.setCurrentPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_empty_error)));
changePassNPinLiveData.setCurrentPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_error_text)));
return false; return false;
} }
} }
boolean isNewPasswordValid(CharSequence password) { boolean isNewPasswordValid(CharSequence password) {
if (password != null && password.length() > 0) {
if (password!=null && password.toString().trim().matches("^(?=.*[A-Z])(?=.*[0-9])(?=.*[a-z]).{8,24}$")) {
this.newPassword = password.toString(); this.newPassword = password.toString();
changePassNPinLiveData.setNewPasswordInputLiveData(new FormInputStateDTO<>(true, null)); changePassNPinLiveData.setNewPasswordInputLiveData(new FormInputStateDTO<>(true, null));
return true; return true;
} else { } else {
this.newPassword = null; this.newPassword = null;
changePassNPinLiveData.setNewPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_empty_error)));
changePassNPinLiveData.setNewPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_error_text)));
return false; return false;
} }
} }
boolean isConfirmPasswordValid(CharSequence password) { boolean isConfirmPasswordValid(CharSequence password) {
if (password != null && password.length() > 0) {
if (password!=null && password.toString().trim().matches("^(?=.*[A-Z])(?=.*[0-9])(?=.*[a-z]).{8,24}$")) {
this.confirmPassword = password.toString(); this.confirmPassword = password.toString();
changePassNPinLiveData.setConfirmPasswordInputLiveData(new FormInputStateDTO<>(true, null)); changePassNPinLiveData.setConfirmPasswordInputLiveData(new FormInputStateDTO<>(true, null));
return true; return true;
} else { } else {
this.confirmPassword = null; this.confirmPassword = null;
changePassNPinLiveData.setConfirmPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_empty_error)));
changePassNPinLiveData.setConfirmPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_error_text)));
return false; return false;
} }

12
app/src/main/java/com/swifttech/remit/android/features/changepassword/presenter/ChangePasswordV2Presenter.java

@ -103,13 +103,13 @@ public class ChangePasswordV2Presenter extends BaseViewModel implements ChangePa
private String confirmPassword; private String confirmPassword;
boolean isCurrentPasswordValid(CharSequence password) { boolean isCurrentPasswordValid(CharSequence password) {
if (password != null && password.length() > 0) {
if (password!=null && password.toString().trim().matches("^(?=.*[A-Z])(?=.*[0-9])(?=.*[a-z]).{8,24}$")) {
this.currentPassword = password.toString(); this.currentPassword = password.toString();
changePasswordLiveData.setCurrentPasswordInputLiveData(new FormInputStateDTO<>(true, null)); changePasswordLiveData.setCurrentPasswordInputLiveData(new FormInputStateDTO<>(true, null));
return true; return true;
} else { } else {
this.currentPassword = null; this.currentPassword = null;
changePasswordLiveData.setCurrentPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_empty_error)));
changePasswordLiveData.setCurrentPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_error_text)));
return false; return false;
} }
@ -117,27 +117,27 @@ public class ChangePasswordV2Presenter extends BaseViewModel implements ChangePa
boolean isNewPasswordValid(CharSequence password) { boolean isNewPasswordValid(CharSequence password) {
if (password != null && password.length() > 0) {
if (password!=null && password.toString().trim().matches("^(?=.*[A-Z])(?=.*[0-9])(?=.*[a-z]).{8,24}$")) {
this.newPassword = password.toString(); this.newPassword = password.toString();
changePasswordLiveData.setNewPasswordInputLiveData(new FormInputStateDTO<>(true, null)); changePasswordLiveData.setNewPasswordInputLiveData(new FormInputStateDTO<>(true, null));
return true; return true;
} else { } else {
this.newPassword = null; this.newPassword = null;
changePasswordLiveData.setNewPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_empty_error)));
changePasswordLiveData.setNewPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_error_text)));
return false; return false;
} }
} }
boolean isConfirmPasswordValid(CharSequence password) { boolean isConfirmPasswordValid(CharSequence password) {
if (password != null && password.length() > 0) {
if (password!=null && password.toString().trim().matches("^(?=.*[A-Z])(?=.*[0-9])(?=.*[a-z]).{8,24}$")) {
this.confirmPassword = password.toString(); this.confirmPassword = password.toString();
changePasswordLiveData.setConfirmPasswordInputLiveData(new FormInputStateDTO<>(true, null)); changePasswordLiveData.setConfirmPasswordInputLiveData(new FormInputStateDTO<>(true, null));
return true; return true;
} else { } else {
this.confirmPassword = null; this.confirmPassword = null;
changePasswordLiveData.setConfirmPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_empty_error)));
changePasswordLiveData.setConfirmPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_error_text)));
return false; return false;
} }

10
app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/presenter/KYCV3ViewModel.java

@ -62,6 +62,7 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
private PublishSubject<Boolean> form1ValidationSubject; private PublishSubject<Boolean> form1ValidationSubject;
private PublishSubject<Boolean> form2ValidationSubject; private PublishSubject<Boolean> form2ValidationSubject;
private CustomerDetailViewLiveData.CustomerDetailViewBinding viewBindings; private CustomerDetailViewLiveData.CustomerDetailViewBinding viewBindings;
private Boolean isBackAdditionalRequired;
public KYCV3ViewModel(KYCV3ViewContractInterface view, KYCV3GatewayInterface gatewayInterface, FileDownloadGateway fileDownloadGateway, LoginV2InteractorInterface.Login2GatewayInterface loginGateway, String userId, String userPwd) { public KYCV3ViewModel(KYCV3ViewContractInterface view, KYCV3GatewayInterface gatewayInterface, FileDownloadGateway fileDownloadGateway, LoginV2InteractorInterface.Login2GatewayInterface loginGateway, String userId, String userPwd) {
this.compositeDisposable = new CompositeDisposable(); this.compositeDisposable = new CompositeDisposable();
@ -232,6 +233,7 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
purposeOfRegistration=new IDTextDTO(purposeOfRegisterId,purposeOfRegisterId); purposeOfRegistration=new IDTextDTO(purposeOfRegisterId,purposeOfRegisterId);
} }
IDTextDTO additionalId= data.getAdditionalIdTypeFromId(personalInfoDTO.getAdditionalIdType());
customerDetailLiveData.getEmployerNameLiveData().postValue(new FormInputStateDTO<>(true, null, personalInfoDTO.getEmployeerName())); customerDetailLiveData.getEmployerNameLiveData().postValue(new FormInputStateDTO<>(true, null, personalInfoDTO.getEmployeerName()));
customerDetailLiveData.getOccupationsLiveData().postValue(new FormInputStateDTO<>(true, null, occupation)); customerDetailLiveData.getOccupationsLiveData().postValue(new FormInputStateDTO<>(true, null, occupation));
customerDetailLiveData.getSourceOfFundLiveData().postValue(new FormInputStateDTO<>(true, null,sourceOfFund )); customerDetailLiveData.getSourceOfFundLiveData().postValue(new FormInputStateDTO<>(true, null,sourceOfFund ));
@ -239,7 +241,7 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
customerDetailLiveData.getMonthlyIncomeLiveData().postValue(new FormInputStateDTO<>(true, null, data.getMonthlyIncomeFromId(personalInfoDTO.getMonthlyIncome()))); customerDetailLiveData.getMonthlyIncomeLiveData().postValue(new FormInputStateDTO<>(true, null, data.getMonthlyIncomeFromId(personalInfoDTO.getMonthlyIncome())));
customerDetailLiveData.getBusinessTypeLiveData().postValue(new FormInputStateDTO<>(true, null, data.getBusinessTypeFromId(personalInfoDTO.getBusinessType()))); customerDetailLiveData.getBusinessTypeLiveData().postValue(new FormInputStateDTO<>(true, null, data.getBusinessTypeFromId(personalInfoDTO.getBusinessType())));
customerDetailLiveData.getIdTypeLiveData().postValue(new FormInputStateDTO<>(true, null, data.getIDypeFromId(personalInfoDTO.getIdType()))); customerDetailLiveData.getIdTypeLiveData().postValue(new FormInputStateDTO<>(true, null, data.getIDypeFromId(personalInfoDTO.getIdType())));
customerDetailLiveData.getAdditionalIdTypeLiveData().postValue(new FormInputStateDTO<>(true, null, data.getAdditionalIdTypeFromId(personalInfoDTO.getAdditionalIdType())));
customerDetailLiveData.getAdditionalIdTypeLiveData().postValue(new FormInputStateDTO<>(true, null,additionalId) );
customerDetailLiveData.getMobileNumberLiveData().postValue(new FormInputStateDTO<>(true, null, mobileNumber)); customerDetailLiveData.getMobileNumberLiveData().postValue(new FormInputStateDTO<>(true, null, mobileNumber));
customerDetailLiveData.getEmailLiveData().postValue(new FormInputStateDTO<>(true, null, personalInfoDTO.getEmail())); customerDetailLiveData.getEmailLiveData().postValue(new FormInputStateDTO<>(true, null, personalInfoDTO.getEmail()));
@ -1069,5 +1071,11 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
} }
} }
public Boolean getBackAdditionalRequired() {
return isBackAdditionalRequired;
}
public void setBackAdditionalRequired(Boolean backAdditionalRequired) {
isBackAdditionalRequired = backAdditionalRequired;
}
} }

1
app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/view/documents/KYCIDTypeFragment.java

@ -81,7 +81,6 @@ public class KYCIDTypeFragment extends BaseFragment {
LinearLayout rootView; LinearLayout rootView;
//
@BindView(R.id.scrollView) @BindView(R.id.scrollView)
NestedScrollView scrollView; NestedScrollView scrollView;

12
app/src/main/java/com/swifttech/remit/android/features/login/presenter/LoginV2Presenter.java

@ -198,18 +198,16 @@ public class LoginV2Presenter extends BaseViewModel implements LoginV2PresenterI
} }
private boolean validatePassword(CharSequence password) { private boolean validatePassword(CharSequence password) {
if (password == null || password.length() < 1) {
loginViewLiveData.setPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_empty_error)));
this.password = null;
return false;
} else {
if(password!=null && password.toString().trim().matches("^(?=.*[A-Z])(?=.*[0-9])(?=.*[a-z]).{8,24}$")){
loginViewLiveData.setPasswordInputLiveData(new FormInputStateDTO<>(true, "")); loginViewLiveData.setPasswordInputLiveData(new FormInputStateDTO<>(true, ""));
this.password = password.toString(); this.password = password.toString();
return true; return true;
}else{
loginViewLiveData.setPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_error_text)));
this.password = null;
return false;
} }
} }
} }

24
app/src/main/java/com/swifttech/remit/android/features/registerv2/existingcustomer/presenter/ExistingCustomerRegisterV2Presenter.java

@ -351,26 +351,26 @@ public class ExistingCustomerRegisterV2Presenter extends BaseViewModel implement
} }
public boolean validatePassword(CharSequence password) { public boolean validatePassword(CharSequence password) {
if (password == null || password.length() < 6 || Utility.trim(password).length()<1) {
existingRegisterSubmitViewLiveData.setNewPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_policy_text)));
this.password = null;
return false;
} else {
if(password!=null && password.toString().trim().matches("^(?=.*[A-Z])(?=.*[0-9])(?=.*[a-z]).{8,24}$")) {
existingRegisterSubmitViewLiveData.setNewPasswordInputLiveData(new FormInputStateDTO<>(true, "")); existingRegisterSubmitViewLiveData.setNewPasswordInputLiveData(new FormInputStateDTO<>(true, ""));
this.password = password.toString(); this.password = password.toString();
return true; return true;
}else{
existingRegisterSubmitViewLiveData.setNewPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_error_text)));
this.password = null;
return false;
} }
} }
public boolean validateConfirmPassword(CharSequence confirmPassword) {
if (confirmPassword == null || confirmPassword.length() < 6 || Utility.trim(confirmPassword).length()<1) {
existingRegisterSubmitViewLiveData.setConfirmPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.confirm_password_policy_text)));
this.confirmPassword = null;
return false;
} else {
public boolean validateConfirmPassword(CharSequence password) {
if(password!=null && password.toString().trim().matches("^(?=.*[A-Z])(?=.*[0-9])(?=.*[a-z]).{8,24}$")) {
existingRegisterSubmitViewLiveData.setConfirmPasswordInputLiveData(new FormInputStateDTO<>(true, "")); existingRegisterSubmitViewLiveData.setConfirmPasswordInputLiveData(new FormInputStateDTO<>(true, ""));
this.confirmPassword = confirmPassword.toString();
this.confirmPassword = password.toString();
return true; return true;
}else{
existingRegisterSubmitViewLiveData.setConfirmPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_error_text)));
this.confirmPassword = null;
return false;
} }
} }

27
app/src/main/java/com/swifttech/remit/android/features/registerv2/newcustomer/presenter/NewRegisterV2Presenter.java

@ -289,29 +289,26 @@ public class NewRegisterV2Presenter extends BaseViewModel implements NewRegister
} }
private boolean validatePassword(CharSequence password) { private boolean validatePassword(CharSequence password) {
if (password == null || password.length() < 6|| Utility.trim(password).length()<1) {
newExistingRegisterViewLiveData.setPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_policy_text)));
this.password = null;
return false;
} else {
if(password!=null && password.toString().trim().matches("^(?=.*[A-Z])(?=.*[0-9])(?=.*[a-z]).{8,24}$")) {
newExistingRegisterViewLiveData.setPasswordInputLiveData(new FormInputStateDTO<>(true, "")); newExistingRegisterViewLiveData.setPasswordInputLiveData(new FormInputStateDTO<>(true, ""));
this.password = password.toString(); this.password = password.toString();
return true; return true;
}else{
newExistingRegisterViewLiveData.setPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_error_text)));
this.password = null;
return false;
} }
} }
public boolean validateConfirmPassword(CharSequence confirmPassWord) {
if (confirmPassWord == null || confirmPassWord.length() < 6 || Utility.trim(confirmPassWord).length()<1) {
newExistingRegisterViewLiveData.setConfirmPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.confirm_password_policy_text)));
this.confirmPassword = null;
return false;
} else {
public boolean validateConfirmPassword(CharSequence password) {
if(password!=null && password.toString().trim().matches("^(?=.*[A-Z])(?=.*[0-9])(?=.*[a-z]).{8,24}$")) {
newExistingRegisterViewLiveData.setConfirmPasswordInputLiveData(new FormInputStateDTO<>(true, "")); newExistingRegisterViewLiveData.setConfirmPasswordInputLiveData(new FormInputStateDTO<>(true, ""));
this.confirmPassword = confirmPassWord.toString();
this.confirmPassword = password.toString();
return true; return true;
}else{
newExistingRegisterViewLiveData.setConfirmPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_error_text)));
this.confirmPassword = null;
return false;
} }
} }
} }

1
app/src/main/res/values/strings.xml

@ -1019,4 +1019,5 @@ All the configurations are done from backend web application system which allows
<string name="send_money_success_footer_text">to JME within next working day to transmit this request.\nAfter payment please check notices to get JME Number for this transfer.</string> <string name="send_money_success_footer_text">to JME within next working day to transmit this request.\nAfter payment please check notices to get JME Number for this transfer.</string>
<string name="request_summary_text">REQUEST SUMMARY</string> <string name="request_summary_text">REQUEST SUMMARY</string>
<string name="payout_agent_bank_text">Payout Agent/Bank</string> <string name="payout_agent_bank_text">Payout Agent/Bank</string>
<string name="password_error_text">Password should contain atleast one number,one uppercase letter, one lowercase letter and minimum 8 Characters</string>
</resources> </resources>
Loading…
Cancel
Save