Browse Source

Reciever name decomposed

master
preyearegmi 6 years ago
parent
commit
a0064adf1c
  1. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/base/PrivilegedGateway.java
  2. 6
      app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV2/adapter/RecipientListingRvAdapter.java
  3. 23
      app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV2/presenter/recipientadd/RecipientAddV2Presenter.java
  4. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV2/presenter/recipientadd/RecipientAddV2PresenterInterface.java
  5. 5
      app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV2/view/recipientadd/RecipientAddV2Activity.java
  6. 22
      app/src/main/res/layout/activity_recipient_v2.xml

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/base/PrivilegedGateway.java

@ -12,7 +12,7 @@ public abstract class PrivilegedGateway implements PrivilegedGatewayInterface {
@Override
public String getAuth(){
return "Basic "+GmeApplication.getStorage().getString(PrefKeys.USER_ACCESS_CODE,"");
return "Bearer "+GmeApplication.getStorage().getString(PrefKeys.USER_ACCESS_CODE,"");
}
@Override

6
app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV2/adapter/RecipientListingRvAdapter.java

@ -49,10 +49,10 @@ public class RecipientListingRvAdapter extends RecyclerView.Adapter<RecipientLis
return true;
}
});
// String middlName=recipientInfo.getMiddleName()==null||recipientInfo.getMiddleName().equalsIgnoreCase(" ")?"":recipientInfo.getMiddleName()+" ";
// holder.setUserName(recipientInfo.getFirstName()+" "+middlName+recipientInfo.getLastName());
String middlName=recipientInfo.getMiddleName()==null||recipientInfo.getMiddleName().equalsIgnoreCase(" ")?"":recipientInfo.getMiddleName()+" ";
holder.setUserName(recipientInfo.getFirstName()+" "+middlName+recipientInfo.getLastName());
holder.setUserName(recipientInfo.getFirstName());
// holder.setUserName(recipientInfo.getFirstName());
holder.setUserInitial(Utils.capitalizeFirstLetterFromWord(recipientInfo.getFirstName())+Utils.capitalizeFirstLetterFromWord(recipientInfo.getLastName()));
}

23
app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV2/presenter/recipientadd/RecipientAddV2Presenter.java

@ -51,13 +51,7 @@ public class RecipientAddV2Presenter extends BasePresenter implements RecipientA
public void addRecipient(String firstName, String middleName, String lastName, CountryDetailModel selectedCountry,
ProvinceDetailModel selectedProvince, DistrictDetailModel selectedDistrict,
String address, RelationDetailModel selectedRelation, String mobileNo, String email, TransferDetailModel selectedTransfer, String selectedRecipientId) {
// if (checkStringNotEmpty(firstName) &&
//// checkStringNotEmpty(lastName) &&
// checkStringNotEmpty(address) &&
//// Utils.isValidEmail(email)&&
// checkStringNotEmpty(mobileNo) &&
// validateLocation(selectedCountry, selectedProvince, selectedDistrict) &&
// selectedRelation != null && selectedTransfer != null) {
if(validateData(firstName,middleName,lastName,selectedCountry,selectedProvince,selectedDistrict,address,selectedRelation,mobileNo,email,selectedTransfer))
{
@ -90,6 +84,8 @@ public class RecipientAddV2Presenter extends BasePresenter implements RecipientA
boolean isValid= true;
if(!validateFirstName(firstName))
isValid=false;
if(!validateLastName(lastName))
isValid=false;
if(!validateAddress(address))
isValid=false;
if(!validateMobile(mobileNo))
@ -110,13 +106,24 @@ public class RecipientAddV2Presenter extends BasePresenter implements RecipientA
{
if(!checkStringNotEmpty(firstName))
{
view.setErrorOnFirstName("Name cannot be empty");
view.setErrorOnFirstName("First Name cannot be empty");
return false;
}
view.setErrorOnFirstName(null);
return true;
}
private boolean validateLastName(String lastName)
{
if(!checkStringNotEmpty(lastName))
{
view.setErrorOnLastName("Last Name cannot be empty");
return false;
}
view.setErrorOnLastName(null);
return true;
}
private boolean validateAddress(String address)
{
if(!checkStringNotEmpty(address))

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV2/presenter/recipientadd/RecipientAddV2PresenterInterface.java

@ -50,5 +50,7 @@ public interface RecipientAddV2PresenterInterface extends BasePresenterInterface
void setErrorOnAddress(String message);
void setErrorOnDistrict(String message);
void setErrorOnLastName(String message);
}
}

5
app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV2/view/recipientadd/RecipientAddV2Activity.java

@ -438,6 +438,11 @@ public class RecipientAddV2Activity extends BaseActivity implements View.OnClick
districtWrapper.setError(message);
}
@Override
public void setErrorOnLastName(String message) {
lastnameWrapper.setError(message);
}
@Override
public void onProvinceSelected(ProvinceDetailModel provinceDetailModel) {
this.selectedProvince = provinceDetailModel;

22
app/src/main/res/layout/activity_recipient_v2.xml

@ -44,8 +44,7 @@
<android.support.design.widget.TextInputLayout
app:errorEnabled="true"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:id="@+id/firstnameWrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -61,9 +60,7 @@
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:visibility="gone"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
app:errorEnabled="true"
android:id="@+id/middlenameWrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -79,9 +76,7 @@
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:visibility="gone"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
app:errorEnabled="true"
android:id="@+id/lastnameWrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -99,8 +94,6 @@
<FrameLayout
android:layout_marginEnd="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:id="@+id/countryViewContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -225,8 +218,7 @@
<android.support.design.widget.TextInputLayout
app:errorEnabled="true"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:id="@+id/addressWrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -244,8 +236,6 @@
<FrameLayout
android:layout_marginEnd="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:id="@+id/relationViewContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -284,8 +274,6 @@
<android.support.design.widget.TextInputLayout
app:errorEnabled="true"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:id="@+id/mobileWrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -303,8 +291,6 @@
<android.support.design.widget.TextInputLayout
android:visibility="gone"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:id="@+id/emailWrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"

Loading…
Cancel
Save