Browse Source

added prefix of Mobile Number to "+81" and lenght to 14 including mobile prefix.

new_design
Santosh Bhandary 4 years ago
parent
commit
6883c56526
  1. 3
      app/build.gradle
  2. 2
      app/src/main/java/com/swifttech/remit/android/common/customwidgets/CustomProgressDialog.java
  3. 1
      app/src/main/java/com/swifttech/remit/android/features/home/gateway/HomeV2Gateway.java
  4. 3
      app/src/main/java/com/swifttech/remit/android/features/kyc/existingCustomer/model/ExistingPersonalInfoDTO.java
  5. 27
      app/src/main/java/com/swifttech/remit/android/features/kyc/existingCustomer/view/personal/ExistingCustomerDetailFragment.java
  6. 2
      app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/model/PersonalInfoDTO.java
  7. 27
      app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/view/personal/CustomerDetailFragment.java
  8. 2
      app/src/main/java/com/swifttech/remit/android/features/otpverification/presenter/OTPVerificationPresenter.java
  9. 28
      app/src/main/java/com/swifttech/remit/android/features/otpverification/view/OTPRequestFragment.java
  10. 2
      app/src/main/java/com/swifttech/remit/android/features/registerv2/existingcustomer/presenter/ExistingCustomerRegisterV2Presenter.java
  11. 29
      app/src/main/java/com/swifttech/remit/android/features/registerv2/existingcustomer/view/ExistingCustomerRegistrationRequestFragment.java
  12. 1
      app/src/main/java/com/swifttech/remit/android/features/userprofile/gateway/UserProfileGateway.java
  13. 4
      app/src/main/java/com/swifttech/remit/android/features/userprofile/model/UserProfile.java
  14. 2
      app/src/main/res/layout/fragment_existing_customer_registration_request.xml
  15. 2
      app/src/main/res/layout/fragment_existing_customer_registration_submit.xml
  16. 2
      app/src/main/res/layout/fragment_existing_kyc_customer_detail.xml
  17. 2
      app/src/main/res/layout/fragment_kyc_customer_detail.xml
  18. 4
      app/src/main/res/layout/fragment_otp_request.xml

3
app/build.gradle

@ -167,4 +167,7 @@ dependencies {
testImplementation "org.mockito:mockito-core:3.0.0"
implementation project(path: ':rxbiometric')
debugImplementation 'com.readystatesoftware.chuck:library:1.1.0'
releaseImplementation 'com.readystatesoftware.chuck:library-no-op:1.1.0'
}

2
app/src/main/java/com/swifttech/remit/android/common/customwidgets/CustomProgressDialog.java

@ -62,6 +62,6 @@ public class CustomProgressDialog extends DialogFragment {
public void updateMessage(String message) {
// progressBarTxt.setText(message);
progressBarTxt.setText(message);
}
}

1
app/src/main/java/com/swifttech/remit/android/features/home/gateway/HomeV2Gateway.java

@ -197,6 +197,7 @@ public class HomeV2Gateway extends PrivilegedGateway implements HomeV2Interactor
userInfoModelV2.setWalletNumber(sharedPreferenceEditor.getString(PrefKeys.USER_WALLET_NUMBER, ""));
userInfoModelV2.setYearlyLimit(sharedPreferenceEditor.getString(PrefKeys.USER_YEARLY_REMAINING_LIMIT, ""));
userInfoModelV2.setCustomerEmail(sharedPreferenceEditor.getString(PrefKeys.USER_CUSTOMER_EMAIL, ""));
userInfoModelV2.setExistingCustomer(sharedPreferenceEditor.getBoolean(PrefKeys.IS_EXISTING_USER, false));
userStateCache = new UserCachedState(userInfoModelV2.getKyc(), userInfoModelV2.isVerified(), userInfoModelV2.getEmail(), userInfoModelV2.getUserDob());

3
app/src/main/java/com/swifttech/remit/android/features/kyc/existingCustomer/model/ExistingPersonalInfoDTO.java

@ -218,10 +218,9 @@ public class ExistingPersonalInfoDTO {
}
public boolean isMobileNumberValid() {
return Utils.isStringNotNullOrEmpty(this.mobile)&&this.mobile.length()>6&&this.mobile.length()<16;
return Utils.isStringNotNullOrEmpty(this.mobile)&&this.mobile.startsWith("+81")&&this.mobile.length()>6&&this.mobile.length()<15;
}
public boolean isEmailValid() {
return Utils.isValidEmail(this.email);
}

27
app/src/main/java/com/swifttech/remit/android/features/kyc/existingCustomer/view/personal/ExistingCustomerDetailFragment.java

@ -2,6 +2,9 @@ package com.swifttech.remit.android.features.kyc.existingCustomer.view.personal;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.text.Editable;
import android.text.Selection;
import android.text.TextWatcher;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
@ -147,6 +150,30 @@ public class ExistingCustomerDetailFragment extends BaseFragment implements Exis
visaStatusSelectionSubject
);
ed_mobileNumber.setText("+81");
ed_mobileNumber.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
}
@Override
public void afterTextChanged(Editable s) {
if(!s.toString().startsWith("+81")){
ed_mobileNumber.setText("+81");
Selection.setSelection(ed_mobileNumber.getText(), ed_mobileNumber.getText().length());
}
}
});
}

2
app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/model/PersonalInfoDTO.java

@ -200,7 +200,7 @@ public class PersonalInfoDTO {
}
public boolean isMobileNumberValid() {
return Utils.isStringNotNullOrEmpty(this.mobile)&&this.mobile.length()>6&&this.mobile.length()<16;
return Utils.isStringNotNullOrEmpty(this.mobile)&&this.mobile.startsWith("+81")&&this.mobile.length()>6&&this.mobile.length()<15;
}

27
app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/view/personal/CustomerDetailFragment.java

@ -2,6 +2,9 @@ package com.swifttech.remit.android.features.kyc.newCustomer.view.personal;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.text.Editable;
import android.text.Selection;
import android.text.TextWatcher;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
@ -149,6 +152,30 @@ public class CustomerDetailFragment extends BaseFragment implements KYCV3Present
additionalIdTypeSelectSubject
);
ed_mobileNumber.setText("+81");
ed_mobileNumber.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
}
@Override
public void afterTextChanged(Editable s) {
if(!s.toString().startsWith("+81")){
ed_mobileNumber.setText("+81");
Selection.setSelection(ed_mobileNumber.getText(), ed_mobileNumber.getText().length());
}
}
});
}

2
app/src/main/java/com/swifttech/remit/android/features/otpverification/presenter/OTPVerificationPresenter.java

@ -81,7 +81,7 @@ public class OTPVerificationPresenter extends BaseViewModel implements OTPVerifi
}
private boolean validateMobileNoForOTPRequest(CharSequence mobileNumber) {
if(mobileNumber!=null&&mobileNumber.length()>0) {
if( mobileNumber.toString().startsWith("+81")&&mobileNumber!=null&&mobileNumber.length()>6) {
this.selectedMobileNumber = mobileNumber.toString();
return true;
}

28
app/src/main/java/com/swifttech/remit/android/features/otpverification/view/OTPRequestFragment.java

@ -1,6 +1,9 @@
package com.swifttech.remit.android.features.otpverification.view;
import android.os.Bundle;
import android.text.Editable;
import android.text.Selection;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -46,12 +49,37 @@ public class OTPRequestFragment extends BaseFragment {
private void performDefaultAction(Bundle savedInstanceState) {
viewModel.subscribeToMobileNumberValidationEvent(RxTextView.textChanges(mobileEditText).skipInitialValue()).observe(getViewLifecycleOwner(),btnSubmit::setEnabled);
mobileEditText.setText("+81");
mobileEditText.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
}
@Override
public void afterTextChanged(Editable s) {
if(!s.toString().startsWith("+81")){
mobileEditText.setText("+81");
Selection.setSelection(mobileEditText.getText(), mobileEditText.getText().length());
}
}
});
}
private void init() {
viewModel=new ViewModelProvider(requireActivity()).get(OTPVerificationPresenter.class);
}

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

@ -284,7 +284,7 @@ public class ExistingCustomerRegisterV2Presenter extends BaseViewModel implement
this.mobileNumber = null;
return false;
}
else if ( mobileNumber.toString().trim().length() < 6||mobileNumber.toString().trim().length()>15) {
else if ( !mobileNumber.toString().startsWith("+81")||mobileNumber.toString().trim().length() < 6||mobileNumber.toString().trim().length()>14) {
existingRegisterRequestViewLiveData.setMobileNoInputLiveData(new FormInputStateDTO<>(false, "Invalid mobile number"));
this.mobileNumber = null;
return false;

29
app/src/main/java/com/swifttech/remit/android/features/registerv2/existingcustomer/view/ExistingCustomerRegistrationRequestFragment.java

@ -1,6 +1,9 @@
package com.swifttech.remit.android.features.registerv2.existingcustomer.view;
import android.os.Bundle;
import android.text.Editable;
import android.text.Selection;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -90,12 +93,36 @@ public class ExistingCustomerRegistrationRequestFragment extends BaseFragment {
dobSelectionSubject
)
);
existingCustomerRegistrationRequestLiveData.getDobInputLiveData().observe(getViewLifecycleOwner(),this::onDOBStateChanged);
existingCustomerRegistrationRequestLiveData.getMobileNoInputLiveData().observe(getViewLifecycleOwner(),this::onMobileNoStateChanged);
existingCustomerRegistrationRequestLiveData.getIdNumberInputLiveData().observe(getViewLifecycleOwner(),this::onIdNoStateChanged);
existingCustomerRegistrationRequestLiveData.getAllFormValidLiveData().observe(getViewLifecycleOwner(),this::onAllFieldValid);
mobile_edTxt.setText("+81");
mobile_edTxt.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
}
@Override
public void afterTextChanged(Editable s) {
if(!s.toString().startsWith("+81")){
mobile_edTxt.setText("+81");
Selection.setSelection(mobile_edTxt.getText(), mobile_edTxt.getText().length());
}
}
});
}
private void onAllFieldValid(FormInputStateDTO formInputStateDTO) {

1
app/src/main/java/com/swifttech/remit/android/features/userprofile/gateway/UserProfileGateway.java

@ -24,6 +24,7 @@ public class UserProfileGateway extends PrivilegedGateway implements UserProfile
userProfile.verified = storage.getBoolean(PrefKeys.USER_KYC_VERIFIED, false);
userProfile.yearlyLimit = storage.getString(PrefKeys.USER_YEARLY_REMAINING_LIMIT, "");
userProfile.referral = storage.getString(PrefKeys.USER_REFERRAL_CODE, "");
userProfile.isExistingCustomer = storage.getBoolean(PrefKeys.IS_EXISTING_USER, false);
return userProfile;
}

4
app/src/main/java/com/swifttech/remit/android/features/userprofile/model/UserProfile.java

@ -85,6 +85,10 @@ public class UserProfile {
@Expose
public String referral;
@SerializedName("isExistingCustomer")
@Expose
public Boolean isExistingCustomer;
public UserProfile() {
this.availableBalance="0";

2
app/src/main/res/layout/fragment_existing_customer_registration_request.xml

@ -53,7 +53,7 @@
style="@style/MTextInputEditText"
android:inputType="phone"
android:imeOptions="actionDone"
android:maxLength="15"
android:maxLength="14"
android:digits="0123456789"
/>

2
app/src/main/res/layout/fragment_existing_customer_registration_submit.xml

@ -36,7 +36,7 @@
app:endIconMode="clear_text"
android:hint="@string/userid_title_text"
>
<!--Todo is userId_edTxt must have to be Mobile Number only ? -->
<com.swifttech.remit.android.common.view.MTextInputEditText
android:id="@+id/userId_edTxt"
style="@style/MTextInputEditText"

2
app/src/main/res/layout/fragment_existing_kyc_customer_detail.xml

@ -103,7 +103,7 @@
style="@style/MTextInputEditText"
android:inputType="phone"
android:digits="0123456789"
android:maxLength="15"
android:maxLength="14"
android:imeOptions="actionNext"
/>
</com.swifttech.remit.android.common.view.MTextInputLayout>

2
app/src/main/res/layout/fragment_kyc_customer_detail.xml

@ -103,7 +103,7 @@
style="@style/MTextInputEditText"
android:inputType="phone"
android:digits="0123456789"
android:maxLength="15"
android:maxLength="14"
android:imeOptions="actionNext"
/>
</com.swifttech.remit.android.common.view.MTextInputLayout>

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

@ -35,11 +35,9 @@
style="@style/MTextInputEditText"
android:inputType="phone"
android:imeOptions="actionDone"
android:maxLength="15"
android:maxLength="14"
android:digits="0123456789"
/>
</com.swifttech.remit.android.common.view.MTextInputLayout>

Loading…
Cancel
Save