Browse Source

Input fields made uppercase for new registration and dynamic reciever setup

master
Preyea Regmi 5 years ago
parent
commit
1c442dfe77
  1. BIN
      .idea/caches/build_file_checksums.ser
  2. 11
      app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV3/model/KYCRelatedDataDTO.java
  3. 13
      app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV3/model/PersonalInfoDTO.java
  4. 17
      app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV3/model/PrimaryInformationDTO.java
  5. 1
      app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV3/presenter/KYCV3ViewModel.java
  6. 5
      app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV3/view/personal/CustomerDetailFragment.java
  7. 12
      app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/model/recipientlistingV3/AgentV3Model.java
  8. 11
      app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/model/recipientlistingV3/PaymentMethodV3Model.java
  9. 80
      app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/model/recipientlistingV3/ReceiverInfoV3Model.java
  10. 18
      app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/presenter/recipientaddeditV3/RecipientDetailValidatorV3.java
  11. 6
      app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/utils/EditTextConfigurationFactory.java
  12. 10
      app/src/main/java/com/gmeremit/online/gmeremittance_native/splash_screen/presenter/SplashScreenPresenter.java
  13. 4
      app/src/main/java/com/gmeremit/online/gmeremittance_native/splash_screen/view/SplashScreen.java
  14. 15
      app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/Utils.java
  15. 8
      app/src/main/res/layout/fragment_kyc_customer_detail.xml

BIN
.idea/caches/build_file_checksums.ser

11
app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV3/model/KYCRelatedDataDTO.java

@ -286,4 +286,15 @@ public class KYCRelatedDataDTO {
}
}
public void formatToUpperCase() {
if(primaryInformation!=null)
{
this.primaryInformation=primaryInformation.formatToUpperCase();
}
if(personalInformation!=null)
{
this.personalInformation=personalInformation.formatToUpperCase();
}
}
}

13
app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV3/model/PersonalInfoDTO.java

@ -139,4 +139,17 @@ public class PersonalInfoDTO {
public PersonalInfoDTO createClone() {
return new PersonalInfoDTO(this.fullName, this.gender, this.dob, this.email, this.city, this.address,this.nativeCountry);
}
public PersonalInfoDTO formatToUpperCase() {
return new PersonalInfoDTO(
Utils.formatToUpperCaseSafely(this.fullName),
Utils.formatToUpperCaseSafely(this.gender),
Utils.formatToUpperCaseSafely(this.dob),
Utils.formatToUpperCaseSafely(this.email),
Utils.formatToUpperCaseSafely(this.city),
Utils.formatToUpperCaseSafely(this.address),
Utils.formatToUpperCaseSafely(this.nativeCountry)
);
}
}

17
app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV3/model/PrimaryInformationDTO.java

@ -1,5 +1,6 @@
package com.gmeremit.online.gmeremittance_native.kycV3.model;
import com.gmeremit.online.gmeremittance_native.utils.Utils;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
@ -210,4 +211,20 @@ public class PrimaryInformationDTO {
public boolean isBranchValid() {
return branchId != null && branchId.length() > 0;
}
public PrimaryInformationDTO formatToUpperCase() {
return new PrimaryInformationDTO(
this.bankId,
Utils.formatToUpperCaseSafely(this.bankAccount),
Utils.formatToUpperCaseSafely(this.passportNumber),
Utils.formatToUpperCaseSafely(this.passportIssueDate),
Utils.formatToUpperCaseSafely(this.passportExpiryDate),
Utils.formatToUpperCaseSafely(this.anotherIDType),
Utils.formatToUpperCaseSafely(this.anotherIDNumber),
Utils.formatToUpperCaseSafely(this.anotherIDIssueDate),
Utils.formatToUpperCaseSafely(this.anotherIDExpiryDate),
Utils.formatToUpperCaseSafely(this.branchId),
Utils.formatToUpperCaseSafely(this.refferalCode)
);
}
}

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

@ -250,6 +250,7 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
genderList.add(new IDTextDTO("F", getStringfromStringId(R.string.female_text)));
data.setGenderList(genderList);
data.seedInitialData();
data.formatToUpperCase();
this.validator = new CustomerDetailViewValidator(data);
boolean isCustomerKorean = validator.getKycRelatedDataDTO().isUserOfKoreanNative();

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

@ -292,7 +292,10 @@ public class CustomerDetailFragment extends BaseFragment implements KYCV3Present
form2.setVisibility(GONE);
form3.setVisibility(GONE);
ed_firstname.setFilters(new InputFilter[]{new GmeEditText.RegExInputFilter("^[A-Z ]+$")});
ed_address.setFilters(new InputFilter[]{new GmeEditText.RegExInputFilter("^[a-zA-Z ]+$"), new InputFilter.LengthFilter(50)});
ed_referral.setFilters(new InputFilter[]{new GmeEditText.RegExInputFilter("^[\\x00-\\x60]+$")});
ed_email.setFilters(new InputFilter[]{new GmeEditText.RegExInputFilter("^[\\x00-\\x60]+$")});
ed_passportId.setFilters(new InputFilter[]{new GmeEditText.RegExInputFilter("^[\\x00-\\x60]+$")});
ed_address.setFilters(new InputFilter[]{new GmeEditText.RegExInputFilter("^[A-Z ]+$"), new InputFilter.LengthFilter(50)});
KYCV3ViewModel kycv3ViewModel = ViewModelProviders.of(getActivity()).get(KYCV3ViewModel.class);
subscribeToCustomerRelatedDataError(kycv3ViewModel);

12
app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/model/recipientlistingV3/AgentV3Model.java

@ -3,6 +3,7 @@ package com.gmeremit.online.gmeremittance_native.recipientV3.model.recipientlist
import android.os.Parcel;
import android.os.Parcelable;
import com.gmeremit.online.gmeremittance_native.utils.Utils;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
@ -114,4 +115,15 @@ public class AgentV3Model implements Parcelable {
public String toString() {
return this.name;
}
public AgentV3Model formatToAllFieldsToUpperCase() {
return new AgentV3Model(
this.id,
Utils.formatToUpperCaseSafely(this.name),
Utils.formatToUpperCaseSafely(this.localizedName),
this.branch,
Utils.formatToUpperCaseSafely(this.accountNo)
);
}
}

11
app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/model/recipientlistingV3/PaymentMethodV3Model.java

@ -3,6 +3,7 @@ package com.gmeremit.online.gmeremittance_native.recipientV3.model.recipientlist
import android.os.Parcel;
import android.os.Parcelable;
import com.gmeremit.online.gmeremittance_native.utils.Utils;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
@ -71,7 +72,6 @@ public class PaymentMethodV3Model implements Parcelable {
}
@Override
public int describeContents() {
return 0;
@ -103,4 +103,13 @@ public class PaymentMethodV3Model implements Parcelable {
return new PaymentMethodV3Model[size];
}
};
public PaymentMethodV3Model formatToAllFieldsToUpperCase() {
return new PaymentMethodV3Model(
this.id,
Utils.formatToUpperCaseSafely(this.name),
Utils.formatToUpperCaseSafely(this.localizedName),
this.currency
);
}
}

80
app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/model/recipientlistingV3/ReceiverInfoV3Model.java

@ -9,6 +9,7 @@ import com.gmeremit.online.gmeremittance_native.recipientV3.model.recipientadded
import com.gmeremit.online.gmeremittance_native.recipientV3.model.recipientaddeditV3.dynamicvalidation.PaymentBankModel;
import com.gmeremit.online.gmeremittance_native.recipientV3.model.recipientaddeditV3.dynamicvalidation.PayoutProvincesModel;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.payoutmode.BankBranchDTO;
import com.gmeremit.online.gmeremittance_native.utils.Utils;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
@ -581,4 +582,83 @@ public class ReceiverInfoV3Model implements Parcelable {
if(this.lastName!=null&&this.lastName.length()>0)
this.lastName=lastName.toUpperCase();
}
public ReceiverInfoV3Model(String firstName, String middleName, String lastName, String localFirstName, String localMiddleName, String localLastName, String fullName, String localFullName, PaymentMethodV3Model paymentMethod, AgentV3Model agent, String receiverId, String country, String countryId, String countryCode, String address, String state, String stateId, String city, String email, String mobile, String relationship, String relationshipId, String district, String districtId, String purposeOfRemit, String purposeOfRemitId, String idType, String idNumber, String payoutPartner, String nativeCountry, String nativeCountryId, String nativeCountryCode, String isPartnerChanged) {
this.firstName = firstName;
this.middleName = middleName;
this.lastName = lastName;
this.localFirstName = localFirstName;
this.localMiddleName = localMiddleName;
this.localLastName = localLastName;
this.fullName = fullName;
this.localFullName = localFullName;
this.paymentMethod = paymentMethod;
this.agent = agent;
this.receiverId = receiverId;
this.country = country;
this.countryId = countryId;
this.countryCode = countryCode;
this.address = address;
this.state = state;
this.stateId = stateId;
this.city = city;
this.email = email;
this.mobile = mobile;
this.relationship = relationship;
this.relationshipId = relationshipId;
this.district = district;
this.districtId = districtId;
this.purposeOfRemit = purposeOfRemit;
this.purposeOfRemitId = purposeOfRemitId;
this.idType = idType;
this.idNumber = idNumber;
this.payoutPartner = payoutPartner;
this.nativeCountry = nativeCountry;
this.nativeCountryId = nativeCountryId;
this.nativeCountryCode = nativeCountryCode;
this.isPartnerChanged = isPartnerChanged;
}
public ReceiverInfoV3Model formatToAllFieldsToUpperCase() {
return new ReceiverInfoV3Model(
Utils.formatToUpperCaseSafely(this.firstName),
Utils.formatToUpperCaseSafely(this.middleName),
Utils.formatToUpperCaseSafely(this.lastName),
Utils.formatToUpperCaseSafely(this.localFirstName),
Utils.formatToUpperCaseSafely(this.localMiddleName),
Utils.formatToUpperCaseSafely(this.localLastName),
Utils.formatToUpperCaseSafely(this.fullName),
Utils.formatToUpperCaseSafely(this.localFullName),
this.paymentMethod.formatToAllFieldsToUpperCase(),
this.agent.formatToAllFieldsToUpperCase(),
Utils.formatToUpperCaseSafely(this.receiverId),
Utils.formatToUpperCaseSafely(this.country),
this.countryId,
this.countryCode,
Utils.formatToUpperCaseSafely(this.address),
Utils.formatToUpperCaseSafely(this.state),
this.stateId,
Utils.formatToUpperCaseSafely(this.city),
Utils.formatToUpperCaseSafely(this.email),
Utils.formatToUpperCaseSafely(this.mobile),
Utils.formatToUpperCaseSafely(this.relationship),
this.relationshipId,
Utils.formatToUpperCaseSafely(this.district),
this.districtId,
Utils.formatToUpperCaseSafely(this.purposeOfRemit),
this.purposeOfRemitId,
Utils.formatToUpperCaseSafely(this.idType),
Utils.formatToUpperCaseSafely(this.idNumber),
Utils.formatToUpperCaseSafely(this.payoutPartner),
Utils.formatToUpperCaseSafely(this.nativeCountry),
this.nativeCountryId,
this.nativeCountryCode,
this.isPartnerChanged
);
}
}

18
app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/presenter/recipientaddeditV3/RecipientDetailValidatorV3.java

@ -81,7 +81,7 @@ public class RecipientDetailValidatorV3 {
if (receiverInfoV3Model == null)
this.recipientInfo = new ReceiverInfoV3Model();
else
this.recipientInfo = receiverInfoV3Model;
this.recipientInfo = receiverInfoV3Model.formatToAllFieldsToUpperCase();
this.view = view;
validationRuleModelMap = new HashMap<>();
@ -168,9 +168,9 @@ public class RecipientDetailValidatorV3 {
recipientInfo.setCountryId(selectedCountryServiceData.getCountryId());
recipientInfo.setCountryCode(selectedCountryServiceData.getCountryCode());
recipientInfo.setCountry(selectedCountryServiceData.getCountryName());
recipientInfo.setCountry(Utils.formatToUpperCaseSafely(selectedCountryServiceData.getCountryName()));
view.updateValueToWidgetSelectedCountry(selectedCountryServiceData.getCountryName());
view.updateValueToWidgetSelectedCountry(Utils.formatToUpperCaseSafely(selectedCountryServiceData.getCountryName()));
view.showSelectedCountryFlag(CountryFlagMapper.getFlagFromCountryCode(selectedCountryServiceData.getCountryCode()));
@ -184,9 +184,9 @@ public class RecipientDetailValidatorV3 {
//By default we update native country same as selected Country
view.updateValueToWidgetNativeCountry(selectedCountryServiceData.getCountryName());
view.updateValueToWidgetNativeCountry(Utils.formatToUpperCaseSafely(selectedCountryServiceData.getCountryName()));
view.showNativeCountryFlag(CountryFlagMapper.getFlagFromCountryCode(selectedCountryServiceData.getCountryCode()));
recipientInfo.setNativeCountry(selectedCountryServiceData.getCountryName());
recipientInfo.setNativeCountry(Utils.formatToUpperCaseSafely(selectedCountryServiceData.getCountryName()));
recipientInfo.setNativeCountryCode(selectedCountryServiceData.getCountryCode());
recipientInfo.setNativeCountryId(selectedCountryServiceData.getCountryId());
}
@ -197,9 +197,9 @@ public class RecipientDetailValidatorV3 {
recipientInfo.setCountryId(selectedCountryServiceData.getCountryId());
recipientInfo.setCountryCode(selectedCountryServiceData.getCountryCode());
recipientInfo.setCountry(selectedCountryServiceData.getCountryName());
recipientInfo.setCountry(Utils.formatToUpperCaseSafely(selectedCountryServiceData.getCountryName()));
view.updateValueToWidgetSelectedCountry(selectedCountryServiceData.getCountryName());
view.updateValueToWidgetSelectedCountry(Utils.formatToUpperCaseSafely(selectedCountryServiceData.getCountryName()));
view.showSelectedCountryFlag(CountryFlagMapper.getFlagFromCountryCode(selectedCountryServiceData.getCountryCode()));
@ -213,9 +213,9 @@ public class RecipientDetailValidatorV3 {
//By default we update native country same as selected Country
view.updateValueToWidgetNativeCountry(selectedCountryServiceData.getCountryName());
view.updateValueToWidgetNativeCountry(Utils.formatToUpperCaseSafely(selectedCountryServiceData.getCountryName()));
view.showNativeCountryFlag(CountryFlagMapper.getFlagFromCountryCode(selectedCountryServiceData.getCountryCode()));
recipientInfo.setNativeCountry(selectedCountryServiceData.getCountryName());
recipientInfo.setNativeCountry(Utils.formatToUpperCaseSafely(selectedCountryServiceData.getCountryName()));
recipientInfo.setNativeCountryCode(selectedCountryServiceData.getCountryCode());
recipientInfo.setNativeCountryId(selectedCountryServiceData.getCountryId());
}

6
app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/utils/EditTextConfigurationFactory.java

@ -13,16 +13,16 @@ public class EditTextConfigurationFactory {
maxLength = 0;
switch (keyword) {
case "A":
return new EditTextConfiguration(InputType.TYPE_CLASS_TEXT, isLocalKeyboardAllowed, "[a-zA-Z\\s]+", maxLength);
return new EditTextConfiguration(InputType.TYPE_CLASS_TEXT|InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS, isLocalKeyboardAllowed, "[A-Z\\s]+", maxLength);
case "N":
return new EditTextConfiguration(InputType.TYPE_CLASS_NUMBER, isLocalKeyboardAllowed, "[0-9]+", maxLength);
case "AN":
return new EditTextConfiguration(InputType.TYPE_CLASS_TEXT, isLocalKeyboardAllowed, "[a-zA-Z0-9\\s]+", maxLength);
return new EditTextConfiguration(InputType.TYPE_CLASS_TEXT|InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS, isLocalKeyboardAllowed, "[A-Z0-9\\s]+", maxLength);
case "ANS":
return new EditTextConfiguration(InputType.TYPE_CLASS_TEXT, isLocalKeyboardAllowed, "^[\\x00-\\x7F]+$", maxLength);
return new EditTextConfiguration(InputType.TYPE_CLASS_TEXT|InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS, isLocalKeyboardAllowed, "^[\\x00-\\x60]+$", maxLength);
default:
return new EditTextConfiguration(InputType.TYPE_CLASS_TEXT, true, null, maxLength);

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
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;
}

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() {
boolean isDebuggable = (0 != (getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE));
if (isDebuggable)
startAntiDebugger();
// if (isDebuggable)
// startAntiDebugger();
}
class ChannelIOEventListener extends ChatUtils.ChannelIOListenerAdapter {

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

@ -13,8 +13,10 @@ import android.net.NetworkInfo;
import android.os.Build;
import android.os.Environment;
import android.provider.Settings;
import androidx.core.content.ContextCompat;
import androidx.appcompat.app.AlertDialog;
import android.text.TextUtils;
import android.text.format.DateUtils;
import android.util.Base64;
@ -71,7 +73,6 @@ public class Utils {
}
public static String getBaseAccessCode(String accessCode, Context context) {
String deviceId = getDeviceID(context);
String maincode = accessCode + ":" + deviceId;
@ -508,7 +509,7 @@ public class Utils {
}
public static String formatCurrencyWithoutTruncatingDecimal(String unformattedcurrency) {
if(unformattedcurrency==null)
if (unformattedcurrency == null)
return "0";
String pattern = "\\.0+$";
Pattern p = Pattern.compile(pattern);
@ -663,7 +664,7 @@ public class Utils {
}
public static Double formatCurrencyForComparision(String amount) {
Double convertedAmount=0.0;
Double convertedAmount = 0.0;
try {
convertedAmount = Double.parseDouble(amount.replaceAll(",", "").trim());
} catch (Exception e) {
@ -749,6 +750,12 @@ public class Utils {
public static boolean isStringNotNullOrEmpty(String anotherIDType) {
return(anotherIDType!=null&&anotherIDType.length()>0);
return (anotherIDType != null && anotherIDType.length() > 0);
}
public static String formatToUpperCaseSafely(String unformatted) {
if (unformatted == null)
return null;
return unformatted.toUpperCase();
}
}

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

@ -159,7 +159,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionDone"
android:inputType="textEmailAddress"
android:inputType="textEmailAddress|textCapCharacters"
app:maxLengthLimiter="100" />
</com.gmeremit.online.gmeremittance_native.customwidgets.GMETextInputLayout>
@ -228,6 +229,7 @@
android:layout_height="wrap_content"
android:layout_marginEnd="24dp"
android:imeOptions="actionDone"
android:inputType="text|textCapCharacters"
android:singleLine="true" />
</com.gmeremit.online.gmeremittance_native.customwidgets.GMETextInputLayout>
@ -372,7 +374,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionDone"
android:inputType="textNoSuggestions" />
android:inputType="text|textCapCharacters|textNoSuggestions"
/>
</com.gmeremit.online.gmeremittance_native.customwidgets.GMETextInputLayout>
<FrameLayout
@ -695,6 +698,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionDone"
android:inputType="text|textCapCharacters"
app:maxLengthLimiter="30" />
</com.gmeremit.online.gmeremittance_native.customwidgets.GMETextInputLayout>

Loading…
Cancel
Save