|
@ -50,6 +50,9 @@ public class CustomerDetailFragment extends BaseFragment implements KYCV3Present |
|
|
@BindView(R.id.form1) |
|
|
@BindView(R.id.form1) |
|
|
LinearLayout form1; |
|
|
LinearLayout form1; |
|
|
|
|
|
|
|
|
|
|
|
@BindView(R.id.lin_id_information) |
|
|
|
|
|
LinearLayout linIdInformation; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@BindView(R.id.scrollView) |
|
|
@BindView(R.id.scrollView) |
|
|
NestedScrollView scrollView; |
|
|
NestedScrollView scrollView; |
|
@ -182,22 +185,19 @@ public class CustomerDetailFragment extends BaseFragment implements KYCV3Present |
|
|
|
|
|
|
|
|
customerDetailViewBinding = new CustomerDetailViewLiveData.CustomerDetailViewBinding( |
|
|
customerDetailViewBinding = new CustomerDetailViewLiveData.CustomerDetailViewBinding( |
|
|
RxTextView.textChanges(ed_employerName), |
|
|
RxTextView.textChanges(ed_employerName), |
|
|
occupationSelectSubject , |
|
|
|
|
|
|
|
|
occupationSelectSubject, |
|
|
RxTextView.textChanges(ed_monthlyIncome).skipInitialValue(), |
|
|
RxTextView.textChanges(ed_monthlyIncome).skipInitialValue(), |
|
|
RxTextView.textChanges(ed_mobileNumber).skipInitialValue(), |
|
|
RxTextView.textChanges(ed_mobileNumber).skipInitialValue(), |
|
|
businessTypeSelectSubject, |
|
|
businessTypeSelectSubject, |
|
|
RxTextView.textChanges(ed_address).skipInitialValue(), |
|
|
RxTextView.textChanges(ed_address).skipInitialValue(), |
|
|
idTypeSelectSubject , |
|
|
|
|
|
additionalIdTypeSelectSubject , |
|
|
|
|
|
|
|
|
idTypeSelectSubject, |
|
|
|
|
|
additionalIdTypeSelectSubject, |
|
|
purposeOfRegistrationSubject |
|
|
purposeOfRegistrationSubject |
|
|
|
|
|
|
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void performDefaultAction() { |
|
|
private void performDefaultAction() { |
|
|
|
|
|
|
|
|
CustomerDetailViewLiveData customerDetailViewLiveData = kycv3ViewModel.getCustomerRelatedViewEvents(customerDetailViewBinding); |
|
|
CustomerDetailViewLiveData customerDetailViewLiveData = kycv3ViewModel.getCustomerRelatedViewEvents(customerDetailViewBinding); |
|
@ -222,7 +222,7 @@ public class CustomerDetailFragment extends BaseFragment implements KYCV3Present |
|
|
ed_occupation.setText(data.getData().getText()); |
|
|
ed_occupation.setText(data.getData().getText()); |
|
|
occupationSelectSubject.onNext(data.getData()); |
|
|
occupationSelectSubject.onNext(data.getData()); |
|
|
} |
|
|
} |
|
|
}else{ |
|
|
|
|
|
|
|
|
} else { |
|
|
occupationSelectionWrapper.setErrorEnabled(true); |
|
|
occupationSelectionWrapper.setErrorEnabled(true); |
|
|
occupationSelectionWrapper.setError(getString(R.string.invalid_select_occupation_text)); |
|
|
occupationSelectionWrapper.setError(getString(R.string.invalid_select_occupation_text)); |
|
|
focusOnView(occupationSelectionWrapper); |
|
|
focusOnView(occupationSelectionWrapper); |
|
@ -237,7 +237,7 @@ public class CustomerDetailFragment extends BaseFragment implements KYCV3Present |
|
|
if (data.hasData()) { |
|
|
if (data.hasData()) { |
|
|
ed_employerName.setText(data.getData()); |
|
|
ed_employerName.setText(data.getData()); |
|
|
} |
|
|
} |
|
|
} else{ |
|
|
|
|
|
|
|
|
} else { |
|
|
employerNameWrapper.setErrorEnabled(true); |
|
|
employerNameWrapper.setErrorEnabled(true); |
|
|
employerNameWrapper.setError(data.getErrorMessage()); |
|
|
employerNameWrapper.setError(data.getErrorMessage()); |
|
|
focusOnView(employerNameWrapper); |
|
|
focusOnView(employerNameWrapper); |
|
@ -255,7 +255,7 @@ public class CustomerDetailFragment extends BaseFragment implements KYCV3Present |
|
|
} |
|
|
} |
|
|
} else |
|
|
} else |
|
|
monthlyIncomeSelectionWrapper.setErrorEnabled(true); |
|
|
monthlyIncomeSelectionWrapper.setErrorEnabled(true); |
|
|
monthlyIncomeSelectionWrapper.setError(data.getErrorMessage()); |
|
|
|
|
|
|
|
|
monthlyIncomeSelectionWrapper.setError(data.getErrorMessage()); |
|
|
focusOnView(monthlyIncomeSelectionWrapper); |
|
|
focusOnView(monthlyIncomeSelectionWrapper); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -266,7 +266,7 @@ public class CustomerDetailFragment extends BaseFragment implements KYCV3Present |
|
|
if (data.hasData()) { |
|
|
if (data.hasData()) { |
|
|
ed_mobileNumber.setText(data.getData()); |
|
|
ed_mobileNumber.setText(data.getData()); |
|
|
} |
|
|
} |
|
|
} else{ |
|
|
|
|
|
|
|
|
} else { |
|
|
mobileNumberWrapper.setErrorEnabled(true); |
|
|
mobileNumberWrapper.setErrorEnabled(true); |
|
|
mobileNumberWrapper.setError(data.getErrorMessage()); |
|
|
mobileNumberWrapper.setError(data.getErrorMessage()); |
|
|
focusOnView(mobileNumberWrapper); |
|
|
focusOnView(mobileNumberWrapper); |
|
@ -282,7 +282,7 @@ public class CustomerDetailFragment extends BaseFragment implements KYCV3Present |
|
|
ed_idType.setText(data.getData().getText()); |
|
|
ed_idType.setText(data.getData().getText()); |
|
|
idTypeSelectSubject.onNext(data.getData()); |
|
|
idTypeSelectSubject.onNext(data.getData()); |
|
|
} |
|
|
} |
|
|
}else{ |
|
|
|
|
|
|
|
|
} else { |
|
|
idTypeSelectionWrapper.setErrorEnabled(true); |
|
|
idTypeSelectionWrapper.setErrorEnabled(true); |
|
|
idTypeSelectionWrapper.setError(getString(R.string.invalidIdType_text)); |
|
|
idTypeSelectionWrapper.setError(getString(R.string.invalidIdType_text)); |
|
|
focusOnView(idTypeSelectionWrapper); |
|
|
focusOnView(idTypeSelectionWrapper); |
|
@ -298,7 +298,7 @@ public class CustomerDetailFragment extends BaseFragment implements KYCV3Present |
|
|
ed_businesstype.setText(data.getData().getText()); |
|
|
ed_businesstype.setText(data.getData().getText()); |
|
|
businessTypeSelectSubject.onNext(data.getData()); |
|
|
businessTypeSelectSubject.onNext(data.getData()); |
|
|
} |
|
|
} |
|
|
}else{ |
|
|
|
|
|
|
|
|
} else { |
|
|
businessTypeSelectionWrapper.setErrorEnabled(true); |
|
|
businessTypeSelectionWrapper.setErrorEnabled(true); |
|
|
businessTypeSelectionWrapper.setError(getString(R.string.invalidBusinessType_text)); |
|
|
businessTypeSelectionWrapper.setError(getString(R.string.invalidBusinessType_text)); |
|
|
focusOnView(businessTypeSelectionWrapper); |
|
|
focusOnView(businessTypeSelectionWrapper); |
|
@ -330,7 +330,7 @@ public class CustomerDetailFragment extends BaseFragment implements KYCV3Present |
|
|
ed_address.setText(data.getData()); |
|
|
ed_address.setText(data.getData()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} else{ |
|
|
|
|
|
|
|
|
} else { |
|
|
addressWrapper.setErrorEnabled(true); |
|
|
addressWrapper.setErrorEnabled(true); |
|
|
addressWrapper.setError(data.getErrorMessage()); |
|
|
addressWrapper.setError(data.getErrorMessage()); |
|
|
focusOnView(addressWrapper); |
|
|
focusOnView(addressWrapper); |
|
@ -348,7 +348,7 @@ public class CustomerDetailFragment extends BaseFragment implements KYCV3Present |
|
|
kycv3ViewModel.setBackAdditionalRequired(data.getData().getBackRequired()); |
|
|
kycv3ViewModel.setBackAdditionalRequired(data.getData().getBackRequired()); |
|
|
additionalIdTypeSelectSubject.onNext(data.getData()); |
|
|
additionalIdTypeSelectSubject.onNext(data.getData()); |
|
|
} |
|
|
} |
|
|
}else{ |
|
|
|
|
|
|
|
|
} else { |
|
|
additionalIdTypeSelectionWrapper.setErrorEnabled(true); |
|
|
additionalIdTypeSelectionWrapper.setErrorEnabled(true); |
|
|
additionalIdTypeSelectionWrapper.setError(getString(R.string.invalid_additional_id_type_text)); |
|
|
additionalIdTypeSelectionWrapper.setError(getString(R.string.invalid_additional_id_type_text)); |
|
|
focusOnView(additionalIdTypeSelectionWrapper); |
|
|
focusOnView(additionalIdTypeSelectionWrapper); |
|
@ -549,16 +549,21 @@ public class CustomerDetailFragment extends BaseFragment implements KYCV3Present |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void onFragmentedSelected() { |
|
|
public void onFragmentedSelected() { |
|
|
|
|
|
if (kycv3ViewModel.getKycSelectedOption().getType().equals("MKYC")) { |
|
|
|
|
|
linIdInformation.setVisibility(View.VISIBLE); |
|
|
|
|
|
} else { |
|
|
|
|
|
linIdInformation.setVisibility(View.GONE); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void focusOnView(View view){ |
|
|
|
|
|
boolean isVisible=isViewVisible(view); |
|
|
|
|
|
if(!isVisible){ |
|
|
|
|
|
scrollView.post(() -> scrollView.setScrollY(view.getTop()+25)); |
|
|
|
|
|
|
|
|
private void focusOnView(View view) { |
|
|
|
|
|
boolean isVisible = isViewVisible(view); |
|
|
|
|
|
if (!isVisible) { |
|
|
|
|
|
scrollView.post(() -> scrollView.setScrollY(view.getTop() + 25)); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public boolean isViewVisible( View view) { |
|
|
|
|
|
|
|
|
public boolean isViewVisible(View view) { |
|
|
Rect scrollBounds = new Rect(); |
|
|
Rect scrollBounds = new Rect(); |
|
|
scrollView.getDrawingRect(scrollBounds); |
|
|
scrollView.getDrawingRect(scrollBounds); |
|
|
|
|
|
|
|
|