Browse Source

User id instead of email added to api invocation

master
preyearegmi 6 years ago
parent
commit
ff12e9bfab
  1. 32
      app/src/main/AndroidManifest.xml
  2. 45
      app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/CurrencyFormatterTextWatcher.java
  3. 33
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/view/ExchangeMethodV2Activity.java
  4. 1
      app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV2/presenter/KYCV2Presenter.java
  5. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV2/presenter/KYCV2PresenterInterface.java
  6. 11
      app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV2/view/KYCFormV2Activity.java
  7. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV2/presenter/recipientadd/RecipientAddV2Presenter.java
  8. 4
      app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV2/presenter/recipientlisting/RecipientListingV2Presenter.java
  9. 4
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/presenter/SendMoneyV2Presenter.java
  10. 24
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/view/amountdetail/AmountDetailSendMoneyFragment.java
  11. 37
      app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/Utils.java
  12. 13
      app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/other/PersistenceStorageManager.java
  13. 8
      app/src/main/res/layout/activity_exchange_method_v2.xml
  14. 1
      app/src/main/res/layout/dummykyc.xml
  15. 8
      app/src/main/res/layout/fragment_amount_detail_send_money_v2.xml

32
app/src/main/AndroidManifest.xml

@ -48,16 +48,16 @@
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="stateAlwaysHidden"> android:windowSoftInputMode="stateAlwaysHidden">
<!--<intent-filter>-->
<!--<action android:name="HOME" />-->
<intent-filter>
<action android:name="HOME" />
<!--<category android:name="android.intent.category.DEFAULT" />-->
<!--</intent-filter>-->
<!--<intent-filter>-->
<!--<action android:name="android.intent.action.MAIN" />-->
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<!--<category android:name="android.intent.category.LAUNCHER" />-->
<!--</intent-filter>-->
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity> </activity>
<meta-data <meta-data
@ -496,16 +496,16 @@
android:name=".kycV2.view.KYCFormV2Activity" android:name=".kycV2.view.KYCFormV2Activity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"> android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="HOME" />
<!--<intent-filter>-->
<!--<action android:name="HOME" />-->
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<!--<category android:name="android.intent.category.DEFAULT" />-->
<!--</intent-filter>-->
<!--<intent-filter>-->
<!--<action android:name="android.intent.action.MAIN" />-->
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<!--<category android:name="android.intent.category.LAUNCHER" />-->
<!--</intent-filter>-->
</activity> </activity>
<activity <activity
android:name=".loginV2.view.LoginV2Activity" android:name=".loginV2.view.LoginV2Activity"

45
app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/CurrencyFormatterTextWatcher.java

@ -0,0 +1,45 @@
package com.gmeremit.online.gmeremittance_native.customwidgets;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;
import com.gmeremit.online.gmeremittance_native.utils.Utils;
import java.lang.ref.WeakReference;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Locale;
public class CurrencyFormatterTextWatcher implements TextWatcher {
private final EditText editTextWeakReference;
public CurrencyFormatterTextWatcher(EditText editText) {
editTextWeakReference = editText;
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable editable) {
EditText editText = editTextWeakReference;
if (editText == null) return;
String s = editable.toString();
if (s.isEmpty()) return;
editText.removeTextChangedListener(this);
String originalString = s.toString();
//setting text after format to EditText
editText.setText(Utils.formatCurrency(originalString));
editText.setSelection(editText.getText().length());
editText.addTextChangedListener(this);
}
}

33
app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/view/ExchangeMethodV2Activity.java

@ -17,6 +17,7 @@ import android.widget.TextView;
import com.gmeremit.online.gmeremittance_native.R; import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.base.BaseActivity; import com.gmeremit.online.gmeremittance_native.base.BaseActivity;
import com.gmeremit.online.gmeremittance_native.customwidgets.CurrencyFormatterTextWatcher;
import com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView; import com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView;
import com.gmeremit.online.gmeremittance_native.customwidgets.exchangecountrylistingdialog.CountryFlagMapper; import com.gmeremit.online.gmeremittance_native.customwidgets.exchangecountrylistingdialog.CountryFlagMapper;
import com.gmeremit.online.gmeremittance_native.customwidgets.exchangecountrylistingdialog.ExchangeRateCurrencyListingDialog; import com.gmeremit.online.gmeremittance_native.customwidgets.exchangecountrylistingdialog.ExchangeRateCurrencyListingDialog;
@ -25,6 +26,7 @@ import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.Count
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.PaymentMode; import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.PaymentMode;
import com.gmeremit.online.gmeremittance_native.exchange_rate.presenter.ExchangeRateV2Presenter; import com.gmeremit.online.gmeremittance_native.exchange_rate.presenter.ExchangeRateV2Presenter;
import com.gmeremit.online.gmeremittance_native.exchange_rate.presenter.ExchangeRateV2PresenterInterface; import com.gmeremit.online.gmeremittance_native.exchange_rate.presenter.ExchangeRateV2PresenterInterface;
import com.gmeremit.online.gmeremittance_native.utils.Utils;
import java.util.List; import java.util.List;
@ -83,6 +85,8 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod
private boolean shouldCaulatedByRecipient; private boolean shouldCaulatedByRecipient;
private SendAmountTextWatcher sendAmountTextWatcher; private SendAmountTextWatcher sendAmountTextWatcher;
private RecipientAmountTextWatcher recepientAmountTextWatcher; private RecipientAmountTextWatcher recepientAmountTextWatcher;
private CurrencyFormatterTextWatcher sendCurrencyFormatterTextWatcher;
private CurrencyFormatterTextWatcher recepientCurrencyFormatterTextWatcher;
private Interpolator interpolator; private Interpolator interpolator;
@Override @Override
@ -146,7 +150,6 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod
iv_back.setOnClickListener(this); iv_back.setOnClickListener(this);
} }
@Override @Override
@ -223,7 +226,7 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod
if (seedValue != null) { if (seedValue != null) {
registerAvailableTextWatchersForEditText(this.sendMoneyEditText, false); registerAvailableTextWatchersForEditText(this.sendMoneyEditText, false);
registerAvailableTextWatchersForEditText(this.recieveMoneyEditText, false); registerAvailableTextWatchersForEditText(this.recieveMoneyEditText, false);
this.recieveMoneyEditText.setText(seedValue);
this.recieveMoneyEditText.setText(Utils.formatCurrency(seedValue));
shouldCaulatedByRecipient = true; shouldCaulatedByRecipient = true;
registerAvailableTextWatchersForEditText(this.sendMoneyEditText, true); registerAvailableTextWatchersForEditText(this.sendMoneyEditText, true);
registerAvailableTextWatchersForEditText(this.recieveMoneyEditText, true); registerAvailableTextWatchersForEditText(this.recieveMoneyEditText, true);
@ -239,7 +242,7 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod
if (seedValue != null) { if (seedValue != null) {
registerAvailableTextWatchersForEditText(this.sendMoneyEditText, false); registerAvailableTextWatchersForEditText(this.sendMoneyEditText, false);
registerAvailableTextWatchersForEditText(this.recieveMoneyEditText, false); registerAvailableTextWatchersForEditText(this.recieveMoneyEditText, false);
this.sendMoneyEditText.setText(seedValue);
this.sendMoneyEditText.setText(Utils.formatCurrency(seedValue));
shouldCaulatedByRecipient = false; shouldCaulatedByRecipient = false;
recieveMoneyEditText.setText(""); recieveMoneyEditText.setText("");
registerAvailableTextWatchersForEditText(this.sendMoneyEditText, true); registerAvailableTextWatchersForEditText(this.sendMoneyEditText, true);
@ -248,8 +251,7 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod
//We are taking first item as default as we don't have any default item enlisted //We are taking first item as default as we don't have any default item enlisted
CountryPaymentService firstSelectedItem = countryPaymentServiceList.get(0); CountryPaymentService firstSelectedItem = countryPaymentServiceList.get(0);
for(CountryPaymentService item:countryPaymentServiceList)
{
for (CountryPaymentService item : countryPaymentServiceList) {
if (item.getCountryCode().equalsIgnoreCase("NP")) { if (item.getCountryCode().equalsIgnoreCase("NP")) {
firstSelectedItem = item; firstSelectedItem = item;
break; break;
@ -274,11 +276,23 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod
if (recepientAmountTextWatcher == null) if (recepientAmountTextWatcher == null)
recepientAmountTextWatcher = new RecipientAmountTextWatcher(); recepientAmountTextWatcher = new RecipientAmountTextWatcher();
if (recepientCurrencyFormatterTextWatcher == null)
recepientCurrencyFormatterTextWatcher = new CurrencyFormatterTextWatcher(recieveMoneyEditText);
if (sendCurrencyFormatterTextWatcher == null)
sendCurrencyFormatterTextWatcher = new CurrencyFormatterTextWatcher(sendMoneyEditText);
sendMoneyEditText.addTextChangedListener(sendAmountTextWatcher); sendMoneyEditText.addTextChangedListener(sendAmountTextWatcher);
recieveMoneyEditText.addTextChangedListener(recepientAmountTextWatcher); recieveMoneyEditText.addTextChangedListener(recepientAmountTextWatcher);
sendMoneyEditText.addTextChangedListener(sendCurrencyFormatterTextWatcher);
recieveMoneyEditText.addTextChangedListener(recepientCurrencyFormatterTextWatcher);
} else { } else {
sendMoneyEditText.addTextChangedListener(null);
recieveMoneyEditText.addTextChangedListener(null);
sendMoneyEditText.removeTextChangedListener(sendAmountTextWatcher);
recieveMoneyEditText.addTextChangedListener(recepientCurrencyFormatterTextWatcher);
sendMoneyEditText.addTextChangedListener(sendCurrencyFormatterTextWatcher);
recieveMoneyEditText.addTextChangedListener(recepientCurrencyFormatterTextWatcher);
} }
} }
@ -311,8 +325,8 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod
registerAvailableTextWatchersForEditText(recieveMoneyEditText, false); registerAvailableTextWatchersForEditText(recieveMoneyEditText, false);
registerAvailableTextWatchersForEditText(sendMoneyEditText, false); registerAvailableTextWatchersForEditText(sendMoneyEditText, false);
this.recieveMoneyEditText.setText(recipientAmount);
this.sendMoneyEditText.setText(sendAmount);
this.recieveMoneyEditText.setText(Utils.formatCurrency(recipientAmount));
this.sendMoneyEditText.setText(Utils.formatCurrency(sendAmount));
this.exchangeRateTxtView.setVisibility(View.INVISIBLE); this.exchangeRateTxtView.setVisibility(View.INVISIBLE);
@ -373,5 +387,4 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod
registerAvailableTextWatchersForEditText(sendMoneyEditText, true); registerAvailableTextWatchersForEditText(sendMoneyEditText, true);
} }
} }
} }

1
app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV2/presenter/KYCV2Presenter.java

@ -70,6 +70,7 @@ public class KYCV2Presenter extends BasePresenter implements KYCV2PresenterInter
protected void onSuccess(KYCRelatedDataResponse kycRelatedDataResponse) { protected void onSuccess(KYCRelatedDataResponse kycRelatedDataResponse) {
if(kycRelatedDataResponse.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) if(kycRelatedDataResponse.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2))
{ {
view.lazyInstatiateViewForKyc();
KYCRelatedDataModel data=kycRelatedDataResponse.getKycRelatedDataModel(); KYCRelatedDataModel data=kycRelatedDataResponse.getKycRelatedDataModel();
view.getView1Contract().setKycRelatedData(data.getNativeCountry(),data.getOccupation(),data.getProvinceList()); view.getView1Contract().setKycRelatedData(data.getNativeCountry(),data.getOccupation(),data.getProvinceList());
view.getView2Contract().setKycRelatedData(data.getBank(),data.getIdType(),data.getSourceOfFund()); view.getView2Contract().setKycRelatedData(data.getBank(),data.getIdType(),data.getSourceOfFund());

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV2/presenter/KYCV2PresenterInterface.java

@ -46,6 +46,8 @@ public interface KYCV2PresenterInterface extends BasePresenterInterface {
KYCView2ContractInterface getView2Contract(); KYCView2ContractInterface getView2Contract();
KYCView3ContractInterface getView3Contract(); KYCView3ContractInterface getView3Contract();
void lazyInstatiateViewForKyc();
/** /**
* First KYC Form Contract * First KYC Form Contract
*/ */

11
app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV2/view/KYCFormV2Activity.java

@ -82,8 +82,7 @@ public class KYCFormV2Activity extends BaseActivity implements KYCV2ActionListen
private void initialize() { private void initialize() {
presenter=new KYCV2Presenter(this); presenter=new KYCV2Presenter(this);
setupViewPager();
setUpTabLayout();
backButton.setVisibility(View.VISIBLE); backButton.setVisibility(View.VISIBLE);
} }
@ -237,4 +236,12 @@ public class KYCFormV2Activity extends BaseActivity implements KYCV2ActionListen
public KYCView3ContractInterface getView3Contract() { public KYCView3ContractInterface getView3Contract() {
return kycView3; return kycView3;
} }
@Override
public void lazyInstatiateViewForKyc() {
setupViewPager();
setUpTabLayout();
onPageSelected(0);
viewPager.setCurrentItem(0);
}
} }

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

@ -58,7 +58,7 @@ public class RecipientAddV2Presenter extends BasePresenter implements RecipientA
selectedRelation != null && selectedTransfer != null) { selectedRelation != null && selectedTransfer != null) {
this.compositeDisposable.add(this.gateway.addRecipientAndSendToServer(gateway.getAuth(), this.compositeDisposable.add(this.gateway.addRecipientAndSendToServer(gateway.getAuth(),
gateway.getUserEmailID(),
gateway.getUserID(),
firstName, middleName, lastName, firstName, middleName, lastName,
selectedCountry.getId(), selectedCountry.getId(),
(selectedProvince) == null ? "" : selectedProvince.getId(), (selectedProvince) == null ? "" : selectedProvince.getId(),

4
app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV2/presenter/recipientlisting/RecipientListingV2Presenter.java

@ -38,7 +38,7 @@ public class RecipientListingV2Presenter extends BasePresenter implements Recipi
@Override @Override
public void getAllRecipientList() { public void getAllRecipientList() {
compositeDisposable.add( compositeDisposable.add(
this.gateway.getAllRecipientFromNetwork(gateway.getAuth(),gateway.getUserEmailID())
this.gateway.getAllRecipientFromNetwork(gateway.getAuth(),gateway.getUserID())
.doOnSubscribe(disposable -> view.showProgressBar(true, "Fetching data...")) .doOnSubscribe(disposable -> view.showProgressBar(true, "Fetching data..."))
.doFinally(() -> view.showProgressBar(false, "")) .doFinally(() -> view.showProgressBar(false, ""))
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
@ -50,7 +50,7 @@ public class RecipientListingV2Presenter extends BasePresenter implements Recipi
@Override @Override
public void deleteRecipient(String recipientId) { public void deleteRecipient(String recipientId) {
compositeDisposable.add( compositeDisposable.add(
this.gateway.deleteRecipientFromNetwork(gateway.getAuth(),gateway.getUserEmailID(),recipientId)
this.gateway.deleteRecipientFromNetwork(gateway.getAuth(),gateway.getUserID(),recipientId)
.doOnSubscribe(disposable -> view.showProgressBar(true, "Deleting recipient...")) .doOnSubscribe(disposable -> view.showProgressBar(true, "Deleting recipient..."))
.doFinally(() -> view.showProgressBar(false, "")) .doFinally(() -> view.showProgressBar(false, ""))
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())

4
app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/presenter/SendMoneyV2Presenter.java

@ -188,7 +188,7 @@ public class SendMoneyV2Presenter extends BasePresenter implements SendMoneyV2Pr
SendMoneyAPIRequestBody sendMoneyAPIRequestBody = new SendMoneyAPIRequestBody(); SendMoneyAPIRequestBody sendMoneyAPIRequestBody = new SendMoneyAPIRequestBody();
sendMoneyAPIRequestBody.setUser(gateway.getUserEmailID());
sendMoneyAPIRequestBody.setUser(gateway.getUserID());
sendMoneyAPIRequestBody.setSenderId(gateway.getUserIDNumber()); sendMoneyAPIRequestBody.setSenderId(gateway.getUserIDNumber());
sendMoneyAPIRequestBody.setReceiverId(selectedRecipient.getRecipientId()); sendMoneyAPIRequestBody.setReceiverId(selectedRecipient.getRecipientId());
@ -290,7 +290,7 @@ public class SendMoneyV2Presenter extends BasePresenter implements SendMoneyV2Pr
return gateway.sendDataForForexCalculation(gateway.getAuth(), senderCountryId, return gateway.sendDataForForexCalculation(gateway.getAuth(), senderCountryId,
senderCurrency, recieverCurrency, senderAmount, senderCurrency, recieverCurrency, senderAmount,
recieveAmount, paymentMethodId, calculationPreference, recipientCountryName, recieveAmount, paymentMethodId, calculationPreference, recipientCountryName,
recipientCountryID, bankId, paymentPartnerId, gateway.getUserEmailID())
recipientCountryID, bankId, paymentPartnerId, gateway.getUserID())
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()); .observeOn(AndroidSchedulers.mainThread());
} }

24
app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/view/amountdetail/AmountDetailSendMoneyFragment.java

@ -22,6 +22,7 @@ import android.widget.TextView;
import com.gmeremit.online.gmeremittance_native.R; import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.base.BaseFragment; import com.gmeremit.online.gmeremittance_native.base.BaseFragment;
import com.gmeremit.online.gmeremittance_native.customwidgets.CurrencyFormatterTextWatcher;
import com.gmeremit.online.gmeremittance_native.customwidgets.CustomAlertDialog; import com.gmeremit.online.gmeremittance_native.customwidgets.CustomAlertDialog;
import com.gmeremit.online.gmeremittance_native.customwidgets.exchangecountrylistingdialog.CountryFlagMapper; import com.gmeremit.online.gmeremittance_native.customwidgets.exchangecountrylistingdialog.CountryFlagMapper;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse; import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse;
@ -31,6 +32,7 @@ import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.amountdetail.R
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.view.SendMoneyActionListener; import com.gmeremit.online.gmeremittance_native.sendmoneyV2.view.SendMoneyActionListener;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.view.SendMoneyV2Activity; import com.gmeremit.online.gmeremittance_native.sendmoneyV2.view.SendMoneyV2Activity;
import com.gmeremit.online.gmeremittance_native.utils.Constants; import com.gmeremit.online.gmeremittance_native.utils.Constants;
import com.gmeremit.online.gmeremittance_native.utils.Utils;
import com.gmeremit.online.gmeremittance_native.utils.https.GenericApiObserverResponse; import com.gmeremit.online.gmeremittance_native.utils.https.GenericApiObserverResponse;
import butterknife.BindView; import butterknife.BindView;
@ -82,6 +84,8 @@ public class AmountDetailSendMoneyFragment extends BaseFragment implements View.
private String selectedsendingCurrency; private String selectedsendingCurrency;
private SendAmountTextWatcher sendAmountTextWatcher; private SendAmountTextWatcher sendAmountTextWatcher;
private RecipientAmountTextWatcher recepientAmountTextWatcher; private RecipientAmountTextWatcher recepientAmountTextWatcher;
private CurrencyFormatterTextWatcher sendCurrencyFormatterTextWatcher;
private CurrencyFormatterTextWatcher recepientCurrencyFormatterTextWatcher;
private String selectedExRateId; private String selectedExRateId;
private String selectedExRateWithoutTrunc; private String selectedExRateWithoutTrunc;
@ -436,13 +440,13 @@ public class AmountDetailSendMoneyFragment extends BaseFragment implements View.
private void updateSendAmount(String amount) { private void updateSendAmount(String amount) {
registerAvailableTextWatchersForEditText(sendMoneyEditText, false); registerAvailableTextWatchersForEditText(sendMoneyEditText, false);
sendMoneyEditText.setText(amount);
sendMoneyEditText.setText(Utils.formatCurrency(amount));
registerAvailableTextWatchersForEditText(sendMoneyEditText, true); registerAvailableTextWatchersForEditText(sendMoneyEditText, true);
} }
private void updateRecievingAmount(String amount) { private void updateRecievingAmount(String amount) {
registerAvailableTextWatchersForEditText(recieveMoneyEditText, false); registerAvailableTextWatchersForEditText(recieveMoneyEditText, false);
recieveMoneyEditText.setText(amount);
recieveMoneyEditText.setText(Utils.formatCurrency(amount));
registerAvailableTextWatchersForEditText(recieveMoneyEditText, true); registerAvailableTextWatchersForEditText(recieveMoneyEditText, true);
} }
@ -453,11 +457,23 @@ public class AmountDetailSendMoneyFragment extends BaseFragment implements View.
if (recepientAmountTextWatcher == null) if (recepientAmountTextWatcher == null)
recepientAmountTextWatcher = new RecipientAmountTextWatcher(); recepientAmountTextWatcher = new RecipientAmountTextWatcher();
if (recepientCurrencyFormatterTextWatcher == null)
recepientCurrencyFormatterTextWatcher = new CurrencyFormatterTextWatcher(recieveMoneyEditText);
if (sendCurrencyFormatterTextWatcher == null)
sendCurrencyFormatterTextWatcher = new CurrencyFormatterTextWatcher(sendMoneyEditText);
sendMoneyEditText.addTextChangedListener(sendAmountTextWatcher); sendMoneyEditText.addTextChangedListener(sendAmountTextWatcher);
recieveMoneyEditText.addTextChangedListener(recepientAmountTextWatcher); recieveMoneyEditText.addTextChangedListener(recepientAmountTextWatcher);
sendMoneyEditText.addTextChangedListener(sendCurrencyFormatterTextWatcher);
recieveMoneyEditText.addTextChangedListener(recepientCurrencyFormatterTextWatcher);
} else { } else {
sendMoneyEditText.addTextChangedListener(null);
recieveMoneyEditText.addTextChangedListener(null);
sendMoneyEditText.removeTextChangedListener(sendAmountTextWatcher);
recieveMoneyEditText.removeTextChangedListener(recepientAmountTextWatcher);
sendMoneyEditText.removeTextChangedListener(sendCurrencyFormatterTextWatcher);
recieveMoneyEditText.removeTextChangedListener(recepientCurrencyFormatterTextWatcher);
} }
} }

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

@ -44,6 +44,7 @@ import java.io.IOException;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.NumberFormat; import java.text.NumberFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
@ -110,7 +111,6 @@ public class Utils {
String maincode = persistenceStorageManager.getAccessCode() + ":" + deviceId; String maincode = persistenceStorageManager.getAccessCode() + ":" + deviceId;
return toBase64(maincode); return toBase64(maincode);
}*/ }*/
public static String getBaseAccessCode(String accessCode, Context context) { public static String getBaseAccessCode(String accessCode, Context context) {
String deviceId = getDeviceID(context); String deviceId = getDeviceID(context);
String maincode = accessCode + ":" + deviceId; String maincode = accessCode + ":" + deviceId;
@ -129,6 +129,7 @@ public class Utils {
return null; return null;
} }
public static String fromBase64(String message) { public static String fromBase64(String message) {
byte[] data; byte[] data;
try { try {
@ -181,9 +182,7 @@ public class Utils {
String parsedAmount; String parsedAmount;
try { try {
parsedAmount = NumberFormat.getNumberInstance(Locale.US).format(amount); parsedAmount = NumberFormat.getNumberInstance(Locale.US).format(amount);
}
catch (Exception e)
{
} catch (Exception e) {
parsedAmount = "0.0"; parsedAmount = "0.0";
} }
return parsedAmount; return parsedAmount;
@ -511,31 +510,45 @@ public class Utils {
public static String capitalizeFirstLetterFromWord(String firstName) { public static String capitalizeFirstLetterFromWord(String firstName) {
if (firstName == null || firstName.length() < 1) if (firstName == null || firstName.length() < 1)
return ""; return "";
else
{
else {
return firstName.substring(0, 1).toUpperCase(); return firstName.substring(0, 1).toUpperCase();
} }
} }
public static boolean hasSpecialCharacters(String inputString)
{
public static boolean hasSpecialCharacters(String inputString) {
String spcialCharPatternToMatch = "[\\\\!\"#$%&()*+,./:;<=>?@\\[\\]^_{|}~]+"; String spcialCharPatternToMatch = "[\\\\!\"#$%&()*+,./:;<=>?@\\[\\]^_{|}~]+";
Pattern specialPatternMatcher = Pattern.compile(spcialCharPatternToMatch); Pattern specialPatternMatcher = Pattern.compile(spcialCharPatternToMatch);
Matcher specialMatcher = specialPatternMatcher.matcher(inputString); Matcher specialMatcher = specialPatternMatcher.matcher(inputString);
return specialMatcher.find(); return specialMatcher.find();
} }
public static boolean hasNumbers(String inputString)
{
public static boolean hasNumbers(String inputString) {
String spcialCharPatternToMatch = "[0-9]+"; String spcialCharPatternToMatch = "[0-9]+";
Pattern specialPatternMatcher = Pattern.compile(spcialCharPatternToMatch); Pattern specialPatternMatcher = Pattern.compile(spcialCharPatternToMatch);
Matcher specialMatcher = specialPatternMatcher.matcher(inputString); Matcher specialMatcher = specialPatternMatcher.matcher(inputString);
return specialMatcher.find(); return specialMatcher.find();
} }
public static boolean hasNumbersOnly(String inputString)
{
public static boolean hasNumbersOnly(String inputString) {
return inputString.matches("^\\d+$"); return inputString.matches("^\\d+$");
} }
public static String formatCurrency(String unformmatedCurrency) {
try {
unformmatedCurrency = unformmatedCurrency.replaceAll("\\.\\d*", "");
Long longval;
if (unformmatedCurrency.contains(",")) {
unformmatedCurrency = unformmatedCurrency.replaceAll(",", "");
}
longval = Long.parseLong(unformmatedCurrency);
DecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.US);
formatter.applyPattern("#,###,###,###");
return formatter.format(longval);
} catch (Exception e) {
e.printStackTrace();
return unformmatedCurrency;
}
}
} }

13
app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/other/PersistenceStorageManager.java

@ -67,11 +67,12 @@ public class PersistenceStorageManager {
public String getUserId() { public String getUserId() {
// return pref.getString(USER_ID, DEFAULT_VALUE); // return pref.getString(USER_ID, DEFAULT_VALUE);
String uid= pref.getString(USER_ID, null);
if(uid==null)
return pref.getString(PrefKeys.USER_EMAIL, DEFAULT_VALUE);
else
// String uid= pref.getString(USER_ID, null);
// if(uid==null)
String uid= pref.getString(PrefKeys.USER_ID, DEFAULT_VALUE);
return uid; return uid;
// else
// return uid;
} }
public void setUserId(String userId) { public void setUserId(String userId) {
@ -152,8 +153,8 @@ public class PersistenceStorageManager {
} }
public boolean getIsVerifiedUser() { public boolean getIsVerifiedUser() {
return pref.getBoolean(IS_VERIFIED_USER, false);
// return pref.getBoolean(IS_VERIFIED_USER, false);
return true;
} }
public String getHomeMenus() { public String getHomeMenus() {

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

@ -47,14 +47,14 @@
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeEditText <com.gmeremit.online.gmeremittance_native.customwidgets.GmeEditText
android:id="@+id/sendAmountEdTxt" android:id="@+id/sendAmountEdTxt"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:inputType="numberDecimal" android:inputType="numberDecimal"
android:gravity="center_vertical" android:gravity="center_vertical"
android:backgroundTint="@android:color/transparent" android:backgroundTint="@android:color/transparent"
android:hint="10,000,000" android:hint="10,000,000"
android:textColor="@color/colorPrimary" android:textColor="@color/colorPrimary"
android:imeOptions="actionDone" android:imeOptions="actionDone"
android:textSize="21sp"/>
android:textSize="25sp"/>
</LinearLayout> </LinearLayout>
<FrameLayout <FrameLayout
android:background="@drawable/curve_rectangle_blue_bg" android:background="@drawable/curve_rectangle_blue_bg"
@ -212,14 +212,14 @@
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeEditText <com.gmeremit.online.gmeremittance_native.customwidgets.GmeEditText
android:id="@+id/receiveAmountEdTxt" android:id="@+id/receiveAmountEdTxt"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:inputType="numberDecimal" android:inputType="numberDecimal"
android:gravity="center_vertical" android:gravity="center_vertical"
android:imeOptions="actionDone" android:imeOptions="actionDone"
android:hint="10,000,000" android:hint="10,000,000"
android:backgroundTint="@android:color/transparent" android:backgroundTint="@android:color/transparent"
android:textColor="@color/colorPrimary" android:textColor="@color/colorPrimary"
android:textSize="21sp"/>
android:textSize="25sp"/>
</LinearLayout> </LinearLayout>
<FrameLayout <FrameLayout
android:id="@+id/countrySelectionSpinner" android:id="@+id/countrySelectionSpinner"

1
app/src/main/res/layout/dummykyc.xml

@ -40,7 +40,6 @@
android:gravity="center" android:gravity="center"
android:paddingBottom="15dp" android:paddingBottom="15dp"
android:paddingTop="15dp" android:paddingTop="15dp"
android:text="Tell us a few things about yourself"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="18sp" android:textSize="18sp"
app:layout_collapseMode="parallax" app:layout_collapseMode="parallax"

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

@ -51,14 +51,14 @@
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeEditText <com.gmeremit.online.gmeremittance_native.customwidgets.GmeEditText
android:id="@+id/sendAmountEdTxt" android:id="@+id/sendAmountEdTxt"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:inputType="numberDecimal" android:inputType="numberDecimal"
android:gravity="center_vertical" android:gravity="center_vertical"
android:backgroundTint="@android:color/transparent" android:backgroundTint="@android:color/transparent"
android:hint="10,000,000" android:hint="10,000,000"
android:textColor="@color/colorPrimary" android:textColor="@color/colorPrimary"
android:imeOptions="actionDone" android:imeOptions="actionDone"
android:textSize="21sp"/>
android:textSize="25sp"/>
</LinearLayout> </LinearLayout>
<FrameLayout <FrameLayout
android:background="@drawable/curve_rectangle_blue_bg" android:background="@drawable/curve_rectangle_blue_bg"
@ -168,14 +168,14 @@
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeEditText <com.gmeremit.online.gmeremittance_native.customwidgets.GmeEditText
android:id="@+id/receiveAmountEdTxt" android:id="@+id/receiveAmountEdTxt"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:inputType="numberDecimal" android:inputType="numberDecimal"
android:gravity="center_vertical" android:gravity="center_vertical"
android:imeOptions="actionDone" android:imeOptions="actionDone"
android:hint="10,000,000" android:hint="10,000,000"
android:backgroundTint="@android:color/transparent" android:backgroundTint="@android:color/transparent"
android:textColor="@color/colorPrimary" android:textColor="@color/colorPrimary"
android:textSize="21sp"/>
android:textSize="25sp"/>
</LinearLayout> </LinearLayout>
<FrameLayout <FrameLayout
android:id="@+id/countrySelectionSpinner" android:id="@+id/countrySelectionSpinner"

Loading…
Cancel
Save