Browse Source

View binding fixes in kyc customer form

master
Preyea Regmi 5 years ago
parent
commit
569deb9085
  1. BIN
      .idea/caches/build_file_checksums.ser
  2. 7
      app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV3/presenter/KYCV3PresenterInterface.java
  3. 56
      app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV3/presenter/KYCV3ViewModel.java
  4. 14
      app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV3/view/personal/CustomerDetailFragment.java
  5. 10
      app/src/main/java/com/gmeremit/online/gmeremittance_native/splash_screen/presenter/SplashScreenPresenter.java
  6. 4
      app/src/main/java/com/gmeremit/online/gmeremittance_native/splash_screen/view/SplashScreen.java

BIN
.idea/caches/build_file_checksums.ser

7
app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV3/presenter/KYCV3PresenterInterface.java

@ -21,7 +21,7 @@ import io.reactivex.Observable;
public interface KYCV3PresenterInterface extends BasePresenterInterface { public interface KYCV3PresenterInterface extends BasePresenterInterface {
void onCustomerDetailFormReady(boolean isReady);
void onCustomerDetailFormReady(CustomerDetailFragment.Form1ViewBindings form1ViewBindings,CustomerDetailFragment.Form2ViewBindings form2ViewBindings,CustomerDetailFragment.Form3ViewBindings form3ViewBindings);
void onPennyTestFormReady(boolean isReady); void onPennyTestFormReady(boolean isReady);
LiveData<KYCRelatedDataDTO> getCustomerDetailRelatedFormLiveData(); LiveData<KYCRelatedDataDTO> getCustomerDetailRelatedFormLiveData();
@ -114,11 +114,6 @@ public interface KYCV3PresenterInterface extends BasePresenterInterface {
interface KYCV3CustomerDetailViewContractInterface extends BaseContractInterface interface KYCV3CustomerDetailViewContractInterface extends BaseContractInterface
{ {
CustomerDetailFragment.Form1ViewBindings getForm1ViewBindings();
CustomerDetailFragment.Form2ViewBindings getForm2ViewBindings();
CustomerDetailFragment.Form3ViewBindings getForm3ViewBindings();
void enablePassportNumberFocusChangeListener(boolean action); void enablePassportNumberFocusChangeListener(boolean action);
void updateAnotherIdNumberMask(int maskType); void updateAnotherIdNumberMask(int maskType);

56
app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV3/presenter/KYCV3ViewModel.java

@ -186,7 +186,7 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
} }
@Override @Override
public void onCustomerDetailFormReady(boolean isReady) {
public void onCustomerDetailFormReady(CustomerDetailFragment.Form1ViewBindings form1ViewBindings,CustomerDetailFragment.Form2ViewBindings form2ViewBindings,CustomerDetailFragment.Form3ViewBindings form3ViewBindings) {
alternateIDImageRequiredLiveData.setValue(false); alternateIDImageRequiredLiveData.setValue(false);
@ -198,14 +198,14 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
return form1Result && form2Result && form3Result; return form1Result && form2Result && form3Result;
}).subscribeWith(new CustomerDetailFormViewBindingObserver())); }).subscribeWith(new CustomerDetailFormViewBindingObserver()));
this.customerDetailViewSubscriptions.add(setUpForm1Validation().subscribe(result -> form1ValidationSubject.onNext(result)));
this.customerDetailViewSubscriptions.add(setUpForm2Validation().subscribe(result -> form2ValidationSubject.onNext(result)));
this.customerDetailViewSubscriptions.add(setUpForm1Validation(form1ViewBindings).subscribe(result -> form1ValidationSubject.onNext(result)));
this.customerDetailViewSubscriptions.add(setUpForm2Validation(form2ViewBindings).subscribe(result -> form2ValidationSubject.onNext(result)));
this.customerDetailViewSubscriptions.add(setUpForm3Validation().subscribe(result -> form3ValidationSubject.onNext(result))); this.customerDetailViewSubscriptions.add(setUpForm3Validation().subscribe(result -> form3ValidationSubject.onNext(result)));
this.customerDetailViewSubscriptions.add(setupAlternateIDRelatedFieldValidation().subscribe(result -> alternateIdRelatedFieldValidationSubject.onNext(result)));
this.customerDetailViewSubscriptions.add(setupPassportRelatedFieldValidation().subscribe(result -> passportRelatedFieldValidationSubject.onNext(result)));
this.customerDetailViewSubscriptions.add(this.view.getCustomerDetailViewContract().getForm3ViewBindings().getAlternateIdDocChangeEvent().subscribe(alternateImage -> alternateIdImageValidationSubject.onNext(alternateImage)));
this.customerDetailViewSubscriptions.add(this.view.getCustomerDetailViewContract().getForm3ViewBindings().getPassporIdDocChangeEvent().subscribe(passportImage -> passportImageValidationSubject.onNext(passportImage)));
this.customerDetailViewSubscriptions.add(this.view.getCustomerDetailViewContract().getForm2ViewBindings().getReferralCodeChangeEvent().subscribe(val -> validator.validateReferralCode(val)));
this.customerDetailViewSubscriptions.add(setupAlternateIDRelatedFieldValidation(form2ViewBindings).subscribe(result -> alternateIdRelatedFieldValidationSubject.onNext(result)));
this.customerDetailViewSubscriptions.add(setupPassportRelatedFieldValidation(form2ViewBindings).subscribe(result -> passportRelatedFieldValidationSubject.onNext(result)));
this.customerDetailViewSubscriptions.add(form3ViewBindings.getAlternateIdDocChangeEvent().subscribe(alternateImage -> alternateIdImageValidationSubject.onNext(alternateImage)));
this.customerDetailViewSubscriptions.add(form3ViewBindings.getPassporIdDocChangeEvent().subscribe(passportImage -> passportImageValidationSubject.onNext(passportImage)));
this.customerDetailViewSubscriptions.add(form2ViewBindings.getReferralCodeChangeEvent().subscribe(val -> validator.validateReferralCode(val)));
if (shouldRedirectToPennyTestScreen) if (shouldRedirectToPennyTestScreen)
@ -334,14 +334,14 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
} }
} }
private Observable<Boolean> setUpForm1Validation() {
private Observable<Boolean> setUpForm1Validation(CustomerDetailFragment.Form1ViewBindings form1ViewBindings) {
return Observable.combineLatest( return Observable.combineLatest(
this.view.getCustomerDetailViewContract().getForm1ViewBindings().getFullNameTextChangeEvent().map(val -> validator.validateFullName(val.toString())),
this.view.getCustomerDetailViewContract().getForm1ViewBindings().getGenderChangeEvent().map(val -> validator.validateGender(val)),
this.view.getCustomerDetailViewContract().getForm1ViewBindings().getDobChangeEvent().map(val -> validator.validatedob(val.toString())),
this.view.getCustomerDetailViewContract().getForm1ViewBindings().getEmailChangeEvent().map(val -> validator.validateEmail(val.toString())),
this.view.getCustomerDetailViewContract().getForm1ViewBindings().getCityChangeEvent().map(val -> validator.validateCity(val)),
this.view.getCustomerDetailViewContract().getForm1ViewBindings().getAddressChangeEvent().map(val -> validator.validateKoreaAddress(val.toString())),
form1ViewBindings.getFullNameTextChangeEvent().map(val -> validator.validateFullName(val.toString())),
form1ViewBindings.getGenderChangeEvent().map(val -> validator.validateGender(val)),
form1ViewBindings.getDobChangeEvent().map(val -> validator.validatedob(val.toString())),
form1ViewBindings.getEmailChangeEvent().map(val -> validator.validateEmail(val.toString())),
form1ViewBindings.getCityChangeEvent().map(val -> validator.validateCity(val)),
form1ViewBindings.getAddressChangeEvent().map(val -> validator.validateKoreaAddress(val.toString())),
//TODO Ocuupation field added //TODO Ocuupation field added
// this.view.getCustomerDetailViewContract().getForm1ViewBindings().getOccupationChangeEvent().map(val -> validator.validateOccupation(val)), // this.view.getCustomerDetailViewContract().getForm1ViewBindings().getOccupationChangeEvent().map(val -> validator.validateOccupation(val)),
(isFullNameValid, isGenderValid, isDobValid, isEmailValid, isCityValid, isAddressValid) -> { (isFullNameValid, isGenderValid, isDobValid, isEmailValid, isCityValid, isAddressValid) -> {
@ -356,11 +356,11 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
} }
private Observable<Boolean> setUpForm2Validation() {
private Observable<Boolean> setUpForm2Validation(CustomerDetailFragment.Form2ViewBindings form2ViewBindings) {
List<Observable<?>> list = new ArrayList<>(); List<Observable<?>> list = new ArrayList<>();
list.add(this.view.getCustomerDetailViewContract().getForm2ViewBindings().getPrimaryBankChangeEvent().map(val -> validator.validateBank(val)));
list.add(this.view.getCustomerDetailViewContract().getForm2ViewBindings().getPrimarnyBankAccountNoChangeEvent().map(val -> validator.validateBankAccountNo(val.toString())));
list.add(this.view.getCustomerDetailViewContract().getForm2ViewBindings().getGMEBranchChangeEvent().map(val -> validator.validateGmeBranch(val)));
list.add(form2ViewBindings.getPrimaryBankChangeEvent().map(val -> validator.validateBank(val)));
list.add(form2ViewBindings.getPrimarnyBankAccountNoChangeEvent().map(val -> validator.validateBankAccountNo(val.toString())));
list.add(form2ViewBindings.getGMEBranchChangeEvent().map(val -> validator.validateGmeBranch(val)));
list.add(alternateIdRelatedFieldValidationSubject); list.add(alternateIdRelatedFieldValidationSubject);
list.add(passportRelatedFieldValidationSubject); list.add(passportRelatedFieldValidationSubject);
return Observable.combineLatest( return Observable.combineLatest(
@ -377,16 +377,16 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
} }
private Observable<Boolean> setupAlternateIDRelatedFieldValidation() {
return Observable.merge(this.view.getCustomerDetailViewContract().getForm2ViewBindings().getAlternateIDNoChangeEvent().map(val -> {
private Observable<Boolean> setupAlternateIDRelatedFieldValidation(CustomerDetailFragment.Form2ViewBindings form2ViewBindings) {
return Observable.merge(form2ViewBindings.getAlternateIDNoChangeEvent().map(val -> {
boolean result = validator.validateAlternateIdNo(val.toString()); boolean result = validator.validateAlternateIdNo(val.toString());
if (validator.hasRequiredDataForAlternatIdVerificationFromServer()) if (validator.hasRequiredDataForAlternatIdVerificationFromServer())
validateAlternateIDFromServer(); validateAlternateIDFromServer();
return result; return result;
}), }),
this.view.getCustomerDetailViewContract().getForm2ViewBindings().getAlternateIDIssuedDateChangeEvent().map(val -> validator.validateAlternateIDIssuedDate(val.toString())),
this.view.getCustomerDetailViewContract().getForm2ViewBindings().getAlternateIDExpiryDateChangeEvent().map(val -> validator.validateAlternateIDExpiryDate(val.toString())),
this.view.getCustomerDetailViewContract().getForm2ViewBindings().getAlternateIdTypeChangeEvent().map(val -> {
form2ViewBindings.getAlternateIDIssuedDateChangeEvent().map(val -> validator.validateAlternateIDIssuedDate(val.toString())),
form2ViewBindings.getAlternateIDExpiryDateChangeEvent().map(val -> validator.validateAlternateIDExpiryDate(val.toString())),
form2ViewBindings.getAlternateIdTypeChangeEvent().map(val -> {
boolean result = validator.validateAlternateIdType(val); boolean result = validator.validateAlternateIdType(val);
if (validator.hasRequiredDataForAlternatIdVerificationFromServer()) if (validator.hasRequiredDataForAlternatIdVerificationFromServer())
validateAlternateIDFromServer(); validateAlternateIDFromServer();
@ -395,12 +395,12 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
); );
} }
private Observable<Boolean> setupPassportRelatedFieldValidation() {
private Observable<Boolean> setupPassportRelatedFieldValidation(CustomerDetailFragment.Form2ViewBindings form2ViewBindings) {
return Observable.combineLatest( return Observable.combineLatest(
this.view.getCustomerDetailViewContract().getForm2ViewBindings().getPassportNumberChangeEvent().map(val -> validator.validatePassportNo(val.toString())),
this.view.getCustomerDetailViewContract().getForm2ViewBindings().getPassportIssuedDateChangeEvent().map(val -> validator.validatePassportIssuedDate(val.toString())),
this.view.getCustomerDetailViewContract().getForm2ViewBindings().getPassportExpiryDateChangeEvent().map(val -> validator.validatePassportExpiryDate(val.toString())),
form2ViewBindings.getPassportNumberChangeEvent().map(val -> validator.validatePassportNo(val.toString())),
form2ViewBindings.getPassportIssuedDateChangeEvent().map(val -> validator.validatePassportIssuedDate(val.toString())),
form2ViewBindings.getPassportExpiryDateChangeEvent().map(val -> validator.validatePassportExpiryDate(val.toString())),
(isPassportNumberValid, isPasspotIssuedDateValid, isPassportExpiryDateValid) -> isPassportNumberValid && isPasspotIssuedDateValid && isPassportExpiryDateValid (isPassportNumberValid, isPasspotIssuedDateValid, isPassportExpiryDateValid) -> isPassportNumberValid && isPasspotIssuedDateValid && isPassportExpiryDateValid
); );

14
app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV3/view/personal/CustomerDetailFragment.java

@ -287,6 +287,11 @@ public class CustomerDetailFragment extends BaseFragment implements KYCV3Present
performDefaultAction(savedInstanceState); performDefaultAction(savedInstanceState);
} }
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
}
private void init() { private void init() {
isAlternatedRelatedViewBeingReset = false; isAlternatedRelatedViewBeingReset = false;
form1ViewBindings = new Form1ViewBindings(); form1ViewBindings = new Form1ViewBindings();
@ -310,7 +315,7 @@ public class CustomerDetailFragment extends BaseFragment implements KYCV3Present
subscribeToCustomerRelatedData(kycv3ViewModel); subscribeToCustomerRelatedData(kycv3ViewModel);
subscribeToSubmitButtonEnable(kycv3ViewModel); subscribeToSubmitButtonEnable(kycv3ViewModel);
kycv3ViewModel.onCustomerDetailFormReady(true);
kycv3ViewModel.onCustomerDetailFormReady(getForm1ViewBindings(),getForm2ViewBindings(),getForm3ViewBindings());
} }
@ -870,17 +875,16 @@ public class CustomerDetailFragment extends BaseFragment implements KYCV3Present
} }
@Override
public Form1ViewBindings getForm1ViewBindings() {
private Form1ViewBindings getForm1ViewBindings() {
return form1ViewBindings; return form1ViewBindings;
} }
@Override
public Form2ViewBindings getForm2ViewBindings() { public Form2ViewBindings getForm2ViewBindings() {
return form2ViewBindings; return form2ViewBindings;
} }
@Override
public Form3ViewBindings getForm3ViewBindings() { public Form3ViewBindings getForm3ViewBindings() {
return form3ViewBindings; return form3ViewBindings;
} }

10
app/src/main/java/com/gmeremit/online/gmeremittance_native/splash_screen/presenter/SplashScreenPresenter.java

@ -90,11 +90,11 @@ public class SplashScreenPresenter extends BasePresenter implements SplashScreen
@Override @Override
public boolean checkSafety() { public boolean checkSafety() {
if (hasRootAccess() || !checkIfAppSafe()) {
view.showPopUpMessage("Access Denied", CustomAlertDialog.AlertType.ALERT, null);
new Handler().postDelayed(() -> view.exitView(), 1500);
return false;
} else
// if (hasRootAccess() || !checkIfAppSafe()) {
// view.showPopUpMessage("Access Denied", CustomAlertDialog.AlertType.ALERT, null);
// new Handler().postDelayed(() -> view.exitView(), 1500);
// return false;
// } else
return true; return true;
} }

4
app/src/main/java/com/gmeremit/online/gmeremittance_native/splash_screen/view/SplashScreen.java

@ -832,8 +832,8 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener,
private void initAntiDebugger() { private void initAntiDebugger() {
boolean isDebuggable = (0 != (getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE)); boolean isDebuggable = (0 != (getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE));
if (isDebuggable)
startAntiDebugger();
// if (isDebuggable)
// startAntiDebugger();
} }
class ChannelIOEventListener extends ChatUtils.ChannelIOListenerAdapter { class ChannelIOEventListener extends ChatUtils.ChannelIOListenerAdapter {

Loading…
Cancel
Save