Browse Source

Splash refactored successfully

master
Preyea Regmi 5 years ago
parent
commit
2dcadf99a0
  1. 34
      app/src/main/AndroidManifest.xml
  2. 9
      app/src/main/java/com/gmeremit/online/gmeremittance_native/agentsV2/gateway/AgentListV2Gateway.java
  3. 1
      app/src/main/java/com/gmeremit/online/gmeremittance_native/agentsV2/model/AgentsListApiResponse.java
  4. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/agentsV2/presenter/AgentListV2PresenterInterface.java
  5. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/exchangecountrylistingdialog/CountryListingRvAdapter.java
  6. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/exchangecountrylistingdialog/CountrySelectionListener.java
  7. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/exchangecountrylistingdialog/ExchangeRateCurrencyListingDialog.java
  8. 115
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/gateway/ExchangeRateV2Gateway.java
  9. 28
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/presenter/ExchangeRateV2InteractorInterface.java
  10. 269
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/presenter/ExchangeRateV2Presenter.java
  11. 36
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/presenter/ExchangeRateV2PresenterInterface.java
  12. 623
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/view/ExchangeMethodV2Activity.java
  13. 10
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/adapter/PaymentModeRvAdapter.java
  14. 55
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/gateway/ExchangeRateGateway.java
  15. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/model/PaymentModeMapper.java
  16. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/model/datav2/CountryPaymentService.java
  17. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/model/datav2/CountryPaymentServiceSeedValueApiResponse.java
  18. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/model/datav2/CountryPaymentServiceSeedValueModel.java
  19. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/model/datav2/ExchangeCalculationApiResponse.java
  20. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/model/datav2/ExchangeCalculationModel.java
  21. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/model/datav2/GenericApiResponseModel.java
  22. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/model/datav2/PaymentMode.java
  23. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/model/datav2/PaymentServiceApiResponse.java
  24. 9
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/presenter/ExchangeRateInteractorInterface.java
  25. 15
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/presenter/ExchangeRatePresenter.java
  26. 7
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/presenter/ExchangeRatePresenterInterface.java
  27. 17
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/view/ExchangeRateActivity.java
  28. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/view/PaymentModeViewHolder.java
  29. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/view/SelectedRedBorderDecoration.java
  30. 3
      app/src/main/java/com/gmeremit/online/gmeremittance_native/homeV2/view/HomeActivityV2.java
  31. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/model/recipientaddeditV3/countryservice/ServiceTypeModel.java
  32. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/resendV2/gateway/resend/ReSendMoneyV2Gateway.java
  33. 3
      app/src/main/java/com/gmeremit/online/gmeremittance_native/resendV2/presenter/resend/ReSendMoneyV2InteractorInterface.java
  34. 5
      app/src/main/java/com/gmeremit/online/gmeremittance_native/resendV2/presenter/resend/ReSendMoneyV2Presenter.java
  35. 9
      app/src/main/java/com/gmeremit/online/gmeremittance_native/resendV2/presenter/resend/ReSendMoneyV2PresenterInterface.java
  36. 9
      app/src/main/java/com/gmeremit/online/gmeremittance_native/resendV2/view/amountdetail/ResendMoneyAmountDetailFragment.java
  37. 4
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/adapter/SendMoneyPayoutModeRvAdapter.java
  38. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/gateway/SendMoneyV2Gateway.java
  39. 6
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/presenter/SendMoneyTransactionCompleteV2InteractorInterface.java
  40. 12
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/presenter/SendMoneyTransactionCompleteV2PresenterInterface.java
  41. 3
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/presenter/SendMoneyV2InteractorInterface.java
  42. 5
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/presenter/SendMoneyV2Presenter.java
  43. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/presenter/SendMoneyV2PresenterInterface.java
  44. 3
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/view/amountdetail/AmountDetailExRateCountryListingDialog.java
  45. 10
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/view/amountdetail/AmountDetailSendMoneyFragment.java
  46. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/view/payoutmode/PayoutModeSendMoneyFragment.java
  47. 3
      app/src/main/java/com/gmeremit/online/gmeremittance_native/settings/view/LanguageSelectionListingDialog.java
  48. 4
      app/src/main/java/com/gmeremit/online/gmeremittance_native/socials/view/SocialPrivateWallActivity.java
  49. 6
      app/src/main/java/com/gmeremit/online/gmeremittance_native/splash_screen/adapter/PayoutModeSelectionRVAdapter.java
  50. 6
      app/src/main/java/com/gmeremit/online/gmeremittance_native/splash_screen/gateway/SplashScreenGateway.java
  51. 6
      app/src/main/java/com/gmeremit/online/gmeremittance_native/splash_screen/presenter/SplashScreenInteractorInterface.java
  52. 295
      app/src/main/java/com/gmeremit/online/gmeremittance_native/splash_screen/presenter/SplashScreenPresenter.java
  53. 33
      app/src/main/java/com/gmeremit/online/gmeremittance_native/splash_screen/presenter/SplashScreenPresenterInterface.java
  54. 45
      app/src/main/java/com/gmeremit/online/gmeremittance_native/splash_screen/view/SplashScreen.java
  55. 4
      app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/https/ApiEndpoints.java
  56. 2
      app/src/main/res/layout/activity_bank_account_validation_v2.xml
  57. 2
      app/src/main/res/layout/activity_exchange_method_v2.xml
  58. 2
      app/src/main/res/layout/activity_withdraw_v2.xml
  59. 2
      app/src/main/res/layout/fragment_amount_detail_resend_money_v2.xml
  60. 2
      app/src/main/res/layout/fragment_amount_detail_send_money_v2.xml

34
app/src/main/AndroidManifest.xml

@ -26,7 +26,7 @@
android:theme="@style/AppTheme"
tools:replace="android:allowBackup"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name=".exchange_rate.view.ExchangeRateActivity"
<activity android:name=".exrate.view.ExchangeRateActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="stateAlwaysHidden"></activity>
@ -99,17 +99,7 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity> <!-- <meta-data -->
<!-- android:name="com.facebook.sdk.ApplicationId" -->
<!-- android:value="@string/facebook_app_id" /> -->
<!-- <activity -->
<!-- android:name="com.facebook.FacebookActivity" -->
<!-- android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" -->
<!-- android:label="@string/app_name" /> -->
<!-- <provider -->
<!-- android:name="com.facebook.FacebookContentProvider" -->
<!-- android:authorities="com.facebook.app.FacebookContentProvider331163960743784" -->
<!-- android:exported="true" /> -->
</activity>
<activity
android:name=".socials.view.CommentsActivity"
android:theme="@style/AppTheme.NoActionBar"
@ -208,7 +198,7 @@
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="stateHidden" />
<activity
android:name=".exchange_rate.view.ExchangeMethodV2Activity"
android:name=".exrate.view.ExchangeMethodV2Activity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="stateHidden" />
@ -226,10 +216,7 @@
android:name=".settings.view.SettingsView"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="stateHidden" /> <!-- <activity -->
<!-- android:name="com.yalantis.ucrop.UCropActivity" -->
<!-- android:screenOrientation="portrait" -->
<!-- android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> -->
android:windowSoftInputMode="stateHidden" />
<activity
android:name=".user_profile.view.ProfileActivity"
android:screenOrientation="portrait"
@ -292,19 +279,6 @@
android:name=".kycV2.view.KYCFormV2Activity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar">
<!-- <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.LAUNCHER" /> -->
<!-- </intent-filter> -->
</activity>
<activity
android:name=".loginV2.view.LoginV2Activity"

9
app/src/main/java/com/gmeremit/online/gmeremittance_native/agentsV2/gateway/AgentListV2Gateway.java

@ -5,17 +5,8 @@ import android.util.Log;
import com.gmeremit.online.gmeremittance_native.agentsV2.model.AgentsListApiResponse;
import com.gmeremit.online.gmeremittance_native.agentsV2.presenter.AgentListV2InteractorInterface;
import com.gmeremit.online.gmeremittance_native.base.PrivilegedGateway;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentServiceSeedValueApiResponse;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentServiceSeedValueModel;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.PaymentServiceApiResponse;
import com.gmeremit.online.gmeremittance_native.exchange_rate.presenter.ExchangeRateV2InteractorInterface;
import com.gmeremit.online.gmeremittance_native.utils.https.HttpClientV2;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonObject;
import java.util.List;
import io.reactivex.Observable;

1
app/src/main/java/com/gmeremit/online/gmeremittance_native/agentsV2/model/AgentsListApiResponse.java

@ -1,6 +1,5 @@
package com.gmeremit.online.gmeremittance_native.agentsV2.model;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationModel;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/agentsV2/presenter/AgentListV2PresenterInterface.java

@ -3,8 +3,6 @@ package com.gmeremit.online.gmeremittance_native.agentsV2.presenter;
import com.gmeremit.online.gmeremittance_native.agentsV2.model.AgentInfoModel;
import com.gmeremit.online.gmeremittance_native.base.BaseContractInterface;
import com.gmeremit.online.gmeremittance_native.base.BasePresenterInterface;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentService;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.PaymentMode;
import java.util.List;

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/exchangecountrylistingdialog/CountryListingRvAdapter.java

@ -7,7 +7,7 @@ import android.view.ViewGroup;
import com.bumptech.glide.Glide;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentService;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.CountryPaymentService;
import java.util.ArrayList;
import java.util.List;

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/exchangecountrylistingdialog/CountrySelectionListener.java

@ -1,6 +1,6 @@
package com.gmeremit.online.gmeremittance_native.customwidgets.exchangecountrylistingdialog;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentService;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.CountryPaymentService;
public interface CountrySelectionListener {
void onCountrySelected(CountryPaymentService countryPaymentService);

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/exchangecountrylistingdialog/ExchangeRateCurrencyListingDialog.java

@ -19,7 +19,7 @@ import android.widget.TextView;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.customwidgets.LineDividerItemDecoration;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentService;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.CountryPaymentService;
import java.util.ArrayList;
import java.util.List;

115
app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/gateway/ExchangeRateV2Gateway.java

@ -1,115 +0,0 @@
package com.gmeremit.online.gmeremittance_native.exchange_rate.gateway;
import android.util.Log;
import com.gmeremit.online.gmeremittance_native.base.PrivilegedGateway;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentServiceSeedValueApiResponse;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentServiceSeedValueModel;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.PaymentServiceApiResponse;
import com.gmeremit.online.gmeremittance_native.exchange_rate.presenter.ExchangeRateV2InteractorInterface;
import com.gmeremit.online.gmeremittance_native.utils.https.HttpClientV2;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonObject;
import java.util.ArrayList;
import java.util.List;
import io.reactivex.Observable;
public class ExchangeRateV2Gateway extends PrivilegedGateway implements ExchangeRateV2InteractorInterface.ExchangeRateV2GatewayInterface {
@Override
public Observable<PaymentServiceApiResponse> getPaymentServiceInfoFromServer(String auth) {
return HttpClientV2.getInstance().getPaymentServiceV2(auth);
}
@Override
public Observable<List<CountryPaymentServiceSeedValueModel>> getAllSeedVAlues() {
/**
* azerbaijan 1,000 AZ USD
Bangladesh 100,000 BD USD
Belarus 1,000 BY USD
Cambodia 500 KH USD
Georgia 1,000 GE USD
India 100,000 IN INR
Indonesia 15,000,000 ID IDR
Kazakhstan 1,000 KZ USD
Kyrgyzstan 1,000 KG USD
Malaysia 10,000 MY MYR
Moldova 1,000 MD USD
Mongolia(USD) 1,000 MN USD
Mongolia(MNT) 2,000,000 MN MNT
Myanmar 1,500,000 MM MMK
Nepal 100,000 NP NPR
Pakistan 100,000 PK PKR
Philippines 500 PH PHP
Russian Federation 1,000 RU USD
Singapore 2,000 SG SGD
Sri Lanka(LKR) 100,000 LK LKR
Sri Lanka(USD) 1,000 LK USD
Tajikistan 1,000 TJ USD
Thailand(THB) 30,000 TH THB
Uzbekistan 1,000 UZ USD
Vietnam(VND) 50,000,000 VN VND
Vietnam(USD) 2,000 VN USD
*/
List<CountryPaymentServiceSeedValueModel> seedData=new ArrayList<>();
seedData.add(new CountryPaymentServiceSeedValueModel("AZ","1000","USD"));
seedData.add(new CountryPaymentServiceSeedValueModel("BD","100000","BDT"));
seedData.add(new CountryPaymentServiceSeedValueModel("BY","1000","USD"));
seedData.add(new CountryPaymentServiceSeedValueModel("KH","500","USD"));
seedData.add(new CountryPaymentServiceSeedValueModel("GE","1000","USD"));
seedData.add(new CountryPaymentServiceSeedValueModel("IN","100000","INR"));
// seedData.add(new CountryPaymentServiceSeedValueModel("ID","15000000","IDR"));
seedData.add(new CountryPaymentServiceSeedValueModel("KZ","1000","USD"));
seedData.add(new CountryPaymentServiceSeedValueModel("KG","1000","USD"));
seedData.add(new CountryPaymentServiceSeedValueModel("MY","10000","MYR"));
seedData.add(new CountryPaymentServiceSeedValueModel("MD","1000","USD"));
seedData.add(new CountryPaymentServiceSeedValueModel("MN","2000000","MNT"));
seedData.add(new CountryPaymentServiceSeedValueModel("MN","1000","USD"));
seedData.add(new CountryPaymentServiceSeedValueModel("MM","1500000","MMK"));
seedData.add(new CountryPaymentServiceSeedValueModel("NP","100000","NPR"));
seedData.add(new CountryPaymentServiceSeedValueModel("PK","100000","PKR"));
seedData.add(new CountryPaymentServiceSeedValueModel("PH","500","PHP"));
seedData.add(new CountryPaymentServiceSeedValueModel("RU","1000","USD"));
seedData.add(new CountryPaymentServiceSeedValueModel("SG","2000","SGD"));
seedData.add(new CountryPaymentServiceSeedValueModel("LK","100000","LKR"));
seedData.add(new CountryPaymentServiceSeedValueModel("LK","1000","USD"));
seedData.add(new CountryPaymentServiceSeedValueModel("TJ","1000","USD"));
seedData.add(new CountryPaymentServiceSeedValueModel("TH","30000","THB"));
seedData.add(new CountryPaymentServiceSeedValueModel("UZ","1000","USD"));
seedData.add(new CountryPaymentServiceSeedValueModel("VN","50000000","VND"));
seedData.add(new CountryPaymentServiceSeedValueModel("VN","2000","USD"));
return Observable.just(seedData);
}
@Override
public Observable<ExchangeCalculationApiResponse> sendDataForForexCalculation(String auth,String senderCountryId, String senderCurrency, String recieverCurrency,
String senderAmount, String recieverAmount, String paymentMethodId,
String calculationPreference, String recipientCountryName,String recieverCountryId) {
JsonObject jsonObject=new JsonObject();
jsonObject.addProperty("sCountry",senderCountryId);
jsonObject.addProperty("sCurrency",senderCurrency);
jsonObject.addProperty("pCurrency",recieverCurrency);
jsonObject.addProperty("calcBy",calculationPreference);
jsonObject.addProperty("cAmount",senderAmount);
jsonObject.addProperty("pAmount",recieverAmount);
jsonObject.addProperty("serviceType",paymentMethodId);
jsonObject.addProperty("pCountry",recieverCountryId);
jsonObject.addProperty("pCountryName",recipientCountryName);
return HttpClientV2.getInstance().calculateExchangeRateV2(auth,jsonObject);
}
}

28
app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/presenter/ExchangeRateV2InteractorInterface.java

@ -1,28 +0,0 @@
package com.gmeremit.online.gmeremittance_native.exchange_rate.presenter;
import com.gmeremit.online.gmeremittance_native.base.BaseGatewayInterface;
import com.gmeremit.online.gmeremittance_native.base.BaseInteractorInterface;
import com.gmeremit.online.gmeremittance_native.base.PrivilegedGatewayInterface;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentService;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentServiceSeedValueModel;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.PaymentServiceApiResponse;
import java.util.List;
import io.reactivex.Observable;
public interface ExchangeRateV2InteractorInterface extends BaseInteractorInterface {
interface ExchangeRateV2GatewayInterface extends PrivilegedGatewayInterface
{
//Change to observable rxjava
Observable<PaymentServiceApiResponse> getPaymentServiceInfoFromServer(String auth);
Observable<List<CountryPaymentServiceSeedValueModel>> getAllSeedVAlues();
Observable<ExchangeCalculationApiResponse> sendDataForForexCalculation(String auth,String senderCountryId, String senderCurrency, String recieverCurrency,
String senderAmount, String recieverAmount, String paymentMethodId,
String calculationPreference, String recipientCountryName,String recieverCountryId);
}
}

269
app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/presenter/ExchangeRateV2Presenter.java

@ -1,269 +0,0 @@
package com.gmeremit.online.gmeremittance_native.exchange_rate.presenter;
import com.gmeremit.online.gmeremittance_native.GmeApplication;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.base.BasePresenter;
import com.gmeremit.online.gmeremittance_native.customwidgets.CustomAlertDialog;
import com.gmeremit.online.gmeremittance_native.exchange_rate.gateway.ExchangeRateV2Gateway;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentService;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentServiceSeedValueModel;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationModel;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.PaymentMode;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.PaymentServiceApiResponse;
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 io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.observers.DisposableObserver;
import io.reactivex.schedulers.Schedulers;
public class ExchangeRateV2Presenter extends BasePresenter implements ExchangeRateV2PresenterInterface, ExchangeRateV2InteractorInterface {
private final ExchangeRateV2ContractInterface view;
private final ExchangeRateV2GatewayInterface gateway;
private final CompositeDisposable compositeDisposables;
public ExchangeRateV2Presenter(ExchangeRateV2ContractInterface view,ExchangeRateV2GatewayInterface gateway) {
this.view = view;
this.gateway = gateway;
this.compositeDisposables = new CompositeDisposable();
}
@Override
public void getAllData() {
compositeDisposables.add(
Observable.zip(getPaymentServiceInfo(), getDefaultValue(), PaymentServiceData::new)
.doOnSubscribe(disposable -> this.view.showProgressBar(true, getStringfromStringId(R.string.processing_request_text)))
.observeOn(AndroidSchedulers.mainThread())
.doFinally(() -> this.view.showProgressBar(false, ""))
.subscribeWith(new PaymentServiceDataObserver())
);
}
@Override
public void getForex(CountryPaymentService selectedCountryPaymentService, PaymentMode selectedPaymentMode, String recipientAmount, String sendAmount, boolean shouldCalculatedByRecipient) {
String calculateFlag=shouldCalculatedByRecipient?Constants.CALC_BY_RECIPEINT:Constants.CALC_BY_SENDER;
if(!validateAmount(recipientAmount))
return;
if(!validateAmount(sendAmount))
return;
if(selectedCountryPaymentService==null)
{
view.showToastMessage(getStringfromStringId(R.string.no_currency_selected_error));
return;
}
String sendCountryDefault="118";
String auth = "Basic " + Utils.toBase64("172017F9EC11222E8107142733:QRK2UM0Q:" + GmeApplication.getAppRelatedMetaData(view.getContext()).getDeviceId());
compositeDisposables.add(
this.gateway.sendDataForForexCalculation(auth,
sendCountryDefault,
gateway.getUserPreferredCurrency(),selectedCountryPaymentService.getCurrency(),
Utils.removeCommaFromAmount(sendAmount),Utils.removeCommaFromAmount(recipientAmount),selectedPaymentMode.getId(),calculateFlag,selectedCountryPaymentService.getCountry(),
selectedCountryPaymentService.getCountryId())
.doOnSubscribe(disposable -> this.view.showProgressBar(true, getStringfromStringId(R.string.processing_request_text)))
.doOnError((err) -> this.view.showProgressBar(false, ""))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.doFinally(()->this.view.showProgressBar(false, ""))
.subscribeWith(new ExchangeRateCalcObserver())
);
}
@Override
public void getDefaultReceivingAmountForSelectedCurrency(CountryPaymentService countryPaymentService) {
String nativeCountryCode = countryPaymentService.getCountryCode();
String preferredCurrency= countryPaymentService.getCurrency();
compositeDisposables.add(
this.gateway.getAllSeedVAlues().flatMap(seedValueList -> {
for (CountryPaymentServiceSeedValueModel seedValueModel : seedValueList) {
if (seedValueModel.getCountryCode().equalsIgnoreCase(nativeCountryCode)&&seedValueModel.getCurrency().equalsIgnoreCase(preferredCurrency))
return Observable.just(seedValueModel);
}
return Observable.just(new CountryPaymentServiceSeedValueModel(null, null, null));
}).subscribeWith(new DefaultRecievingAmountObserver()));
}
@Override
public void onViewDestroyed() {
super.onViewDestroyed();
if (compositeDisposables != null && !compositeDisposables.isDisposed())
compositeDisposables.dispose();
}
private boolean validateAmount(String amount) {
return true;
}
private Observable<CountryPaymentServiceSeedValueModel> getDefaultValue() {
return this.gateway.getAllSeedVAlues().flatMap(seedValueList -> {
String nativeCountryCode = this.gateway.getUserNativeCountryCode();
for (CountryPaymentServiceSeedValueModel seedValueModel : seedValueList) {
if (seedValueModel.getCountryCode().equalsIgnoreCase(nativeCountryCode))
return Observable.just(seedValueModel);
}
return Observable.just(new CountryPaymentServiceSeedValueModel(null, null, null));
});
}
private Observable<PaymentServiceApiResponse> getPaymentServiceInfo() {
String auth = "Basic " + Utils.toBase64("172017F9EC11222E8107142733:QRK2UM0Q:" + GmeApplication.getAppRelatedMetaData(view.getContext()).getDeviceId());
return this.gateway.getPaymentServiceInfoFromServer(auth).subscribeOn(Schedulers.io());
}
public class PaymentServiceDataObserver extends GenericApiObserverResponse<PaymentServiceData> {
@Override
protected void onSuccess(PaymentServiceData paymentServiceApiResponse) {
if(paymentServiceApiResponse.paymentServiceApiResponse.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) {
CountryPaymentServiceSeedValueModel seedValueModel = paymentServiceApiResponse.getCountryPaymentServiceSeedValueModel();
CountryPaymentService defaultSelectedCountryService ;
try {
defaultSelectedCountryService = paymentServiceApiResponse.getPaymentServiceApiResponse().getCountryPaymentServiceFromCountryCodeAndCurrency(seedValueModel.getCountryCode(), seedValueModel.getCurrency());
}
catch(Exception e)
{
defaultSelectedCountryService=null;
}
if (defaultSelectedCountryService == null || defaultSelectedCountryService.getCountryCode() == null || defaultSelectedCountryService.getCountry() == null || defaultSelectedCountryService.getCurrency() == null) {
view.showCountryServiceDataForNonListedNativeCountry(paymentServiceApiResponse.getPaymentServiceApiResponse().getCountryPaymentServices(),Constants.DEFAULT_EXCHANGE_SEND_AMOUNT);
} else {
view.showCountryServiceDataForListedNativeCountry(paymentServiceApiResponse.getPaymentServiceApiResponse().getCountryPaymentServices(),defaultSelectedCountryService,seedValueModel.getRecipientSeedValue());
}
}
else
{
view.showPopUpMessage(paymentServiceApiResponse.paymentServiceApiResponse.getMessage(), CustomAlertDialog.AlertType.FAILED,null);
view.clearCurrencyData();
}
}
@Override
public void onFailed(String message) {
view.clearCurrencyData();
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, alertType -> view.exitView());
}
@Override
protected void onConnectionNotEstablished(String message) {
view.clearCurrencyData();
view.showPopUpMessage(message, CustomAlertDialog.AlertType.NO_INTERNET, alertType -> view.exitView());
}
@Override
protected void unauthorizedAccess(String message) {
gateway.clearAllUserData();
view.showPopUpMessage(message, CustomAlertDialog.AlertType.ALERT,alertType -> view.logout());
}
}
public class PaymentServiceData {
private PaymentServiceApiResponse paymentServiceApiResponse;
private CountryPaymentServiceSeedValueModel countryPaymentServiceSeedValueModel;
public PaymentServiceData(PaymentServiceApiResponse paymentServiceApiResponse, CountryPaymentServiceSeedValueModel countryPaymentServiceSeedValueModel) {
this.paymentServiceApiResponse = paymentServiceApiResponse;
this.countryPaymentServiceSeedValueModel = countryPaymentServiceSeedValueModel;
}
public PaymentServiceApiResponse getPaymentServiceApiResponse() {
return paymentServiceApiResponse;
}
public void setPaymentServiceApiResponse(PaymentServiceApiResponse paymentServiceApiResponse) {
this.paymentServiceApiResponse = paymentServiceApiResponse;
}
public CountryPaymentServiceSeedValueModel getCountryPaymentServiceSeedValueModel() {
return countryPaymentServiceSeedValueModel;
}
public void setCountryPaymentServiceSeedValueModel(CountryPaymentServiceSeedValueModel countryPaymentServiceSeedValueModel) {
this.countryPaymentServiceSeedValueModel = countryPaymentServiceSeedValueModel;
}
}
public class ExchangeRateCalcObserver extends GenericApiObserverResponse<ExchangeCalculationApiResponse>
{
@Override
protected void onSuccess(ExchangeCalculationApiResponse exchangeCalculationApiResponse) {
if(exchangeCalculationApiResponse.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) {
ExchangeCalculationModel data = exchangeCalculationApiResponse.getData();
String transferAmount = Utils.formatCurrency(data.getScCharge());
String exRate = data.getExRateDisplay();
String recipientAmount = data.getpAmt();
String sendAmount = data.getCollAmt();
String sendingCurrency = data.getCollCurr();
String transferDisplay = " - " + transferAmount +" "+ sendingCurrency + " ("+getStringfromStringId(R.string.transfer_fee_included_text)+")";
String exRateDisplay = " " + exRate + " ("+getStringfromStringId(R.string.current_exchange_rate_text)+")";
view.updateExchangeRates(recipientAmount, sendAmount, transferDisplay, exRateDisplay);
}
else {
view.clearExrateAndServiceCharge();
view.showPopUpMessage(exchangeCalculationApiResponse.getMsg(), CustomAlertDialog.AlertType.FAILED, null);
}
}
@Override
public void onFailed(String message) {
view.clearExrateAndServiceCharge();
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, alertType -> view.exitView());
}
@Override
protected void onConnectionNotEstablished(String message) {
view.clearExrateAndServiceCharge();
view.showPopUpMessage(message, CustomAlertDialog.AlertType.NO_INTERNET, alertType -> view.exitView());
}
@Override
protected void unauthorizedAccess(String message) {
gateway.clearAllUserData();
view.showPopUpMessage(message, CustomAlertDialog.AlertType.ALERT,alertType -> view.logout());
}
}
public class DefaultRecievingAmountObserver extends DisposableObserver<CountryPaymentServiceSeedValueModel>
{
@Override
public void onNext(CountryPaymentServiceSeedValueModel countryPaymentServiceSeedValueModel) {
String receivingAmount=countryPaymentServiceSeedValueModel.getRecipientSeedValue();
if(receivingAmount!=null)
view.updateReceivingAmountAndFetchExchangeRate(Utils.formatCurrency(receivingAmount));
else
view.fallbackToSendingAmountAndFetchExchangeRate(Utils.formatCurrency(Constants.DEFAULT_EXCHANGE_SEND_AMOUNT));
}
@Override
public void onError(Throwable e) {
}
@Override
public void onComplete() {
}
}
}

36
app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/presenter/ExchangeRateV2PresenterInterface.java

@ -1,36 +0,0 @@
package com.gmeremit.online.gmeremittance_native.exchange_rate.presenter;
import com.gmeremit.online.gmeremittance_native.base.BaseContractInterface;
import com.gmeremit.online.gmeremittance_native.base.BasePresenterInterface;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentService;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.PaymentMode;
import java.util.List;
public interface ExchangeRateV2PresenterInterface extends BasePresenterInterface {
void getAllData();
void getForex(CountryPaymentService selectedCountryPaymentService, PaymentMode selectedPaymentMode, String recieveAmount, String sendMoneyEditTextText, boolean shouldCaulatedByRecipient);
void getDefaultReceivingAmountForSelectedCurrency(CountryPaymentService countryPaymentService);
interface ExchangeRateV2ContractInterface extends BaseContractInterface
{
@Deprecated
void showCountryServiceData(List<CountryPaymentService> countryPaymentServiceList, CountryPaymentService defaultCountryService,String recepientSeedValue);
void showCountryServiceDataForListedNativeCountry(List<CountryPaymentService> countryPaymentServiceList, CountryPaymentService defaultCountryService, String recepientSeedValue);
void showCountryServiceDataForNonListedNativeCountry(List<CountryPaymentService> countryPaymentServiceList, String recepientSeedValue);
void updateExchangeRates(String recipientAmount, String sendAmount, String transferDisplay, String exRateDisplay);
void clearCurrencyData();
void updateReceivingAmountAndFetchExchangeRate(String amount);
void fallbackToSendingAmountAndFetchExchangeRate(String amount);
void clearExrateAndServiceCharge();
}
}

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

@ -1,623 +0,0 @@
package com.gmeremit.online.gmeremittance_native.exchange_rate.view;
import android.graphics.Rect;
import android.os.Bundle;
import android.support.v4.view.GestureDetectorCompat;
import android.support.v4.view.ViewCompat;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.RecyclerView;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.GestureDetector;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Interpolator;
import android.view.inputmethod.EditorInfo;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.ScrollView;
import android.widget.TextView;
import com.gmeremit.online.gmeremittance_native.R;
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.exchangecountrylistingdialog.CountryFlagMapper;
import com.gmeremit.online.gmeremittance_native.customwidgets.exchangecountrylistingdialog.ExchangeRateCurrencyListingDialog;
import com.gmeremit.online.gmeremittance_native.exchange_rate.adapter.PaymentModeRvAdapter;
import com.gmeremit.online.gmeremittance_native.exchange_rate.gateway.ExchangeRateV2Gateway;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentService;
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.ExchangeRateV2PresenterInterface;
import com.gmeremit.online.gmeremittance_native.utils.Utils;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
public class ExchangeMethodV2Activity extends BaseActivity implements PaymentModeRvAdapter.OnPaymentModeSelectionListener, ExchangeRateCurrencyListingDialog.CountrySelectionListener, View.OnClickListener, ExchangeRateV2PresenterInterface.ExchangeRateV2ContractInterface, TextView.OnEditorActionListener {
@BindView(R.id.sendAmountEdTxt)
EditText sendMoneyEditText;
@BindView(R.id.receiveAmountEdTxt)
EditText recieveMoneyEditText;
@BindView(R.id.paymentModeRV)
RecyclerView paymentModeRv;
@BindView(R.id.toolbar_title)
GmeTextView toolbarTitle;
@BindView(R.id.countrySelectionSpinner)
View countrySelectionSpinner;
@BindView(R.id.recepientFlagImageView)
ImageView recepientFlagImageView;
@BindView(R.id.recepientCurrencyTextView)
TextView recepientCurrencyTextView;
@BindView(R.id.transferFeeTxtView)
TextView transferFeeTxtView;
@BindView(R.id.exchangeRateTxtView)
TextView exchangeRateTxtView;
@BindView(R.id.paymentModeViewContainer)
ViewGroup paymentModeViewContainer;
@BindView(R.id.iv_back)
View iv_back;
@BindView(R.id.iv_cancel)
View iv_cancel;
@BindView(R.id.rootView)
ScrollView rootView;
@BindView(R.id.receiveMoneyViewContainer)
View receiveMoneyViewContainer;
@BindView(R.id.sendMoneyViewContainer)
View sendMoneyViewContainer;
@BindView(R.id.generic_toolbar)
View toolbar;
@BindView(R.id.exRateCalculateButton)
Button exRateCalculateButton;
private PaymentModeRvAdapter paymentModeRvAdapter;
private PaymentMode selectedPaymentMode;
private List<CountryPaymentService> paymentServiceList;
private ExchangeRateCurrencyListingDialog countryListingDialog;
private CountryPaymentService selectedCountryPaymentService;
private ExchangeRateV2PresenterInterface presenter;
private boolean shouldCaulatedByRecipient;
private SendAmountTextWatcher sendAmountTextWatcher;
private RecipientAmountTextWatcher recepientAmountTextWatcher;
private CurrencyFormatterTextWatcher sendCurrencyFormatterTextWatcher;
private CurrencyFormatterTextWatcher recepientCurrencyFormatterTextWatcher;
private Interpolator interpolator;
private AmountChangeAndFocusOutDetector myViewGestureDetector;
private GestureDetectorCompat gestureDetector;
private SendMoneyFocusChangeListener sendMoneyFocusChangeListener;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.sendAmountTextWatcher = new SendAmountTextWatcher();
this.recepientAmountTextWatcher = new RecipientAmountTextWatcher();
setContentView(R.layout.activity_exchange_method_v2);
ButterKnife.bind(this);
init();
performDefaultAction(savedInstanceState);
}
private void init() {
setupRv();
iv_cancel.setVisibility(View.INVISIBLE);
this.interpolator = new AccelerateDecelerateInterpolator();
this.presenter = new ExchangeRateV2Presenter(this,new ExchangeRateV2Gateway());
registerTextWatchers(true);
myViewGestureDetector = new AmountChangeAndFocusOutDetector();
gestureDetector = new GestureDetectorCompat(this, myViewGestureDetector);
sendMoneyFocusChangeListener=new SendMoneyFocusChangeListener();
}
private void performDefaultAction(Bundle savedInstanceState) {
toolbarTitle.setText(getString(R.string.todays_rate_title_text));
this.presenter.getAllData();
}
private void showPaymentService(boolean action, List<PaymentMode> paymentModeList) {
if (paymentModeRvAdapter != null && action && paymentModeList.size() > 0) {
if (paymentModeViewContainer.getVisibility() != View.VISIBLE)
paymentModeViewContainer.setVisibility(View.VISIBLE);
paymentModeRvAdapter.setData(paymentModeList);
paymentModeRvAdapter.setSelectedItem(0);
}
}
private void setupRv() {
paymentModeRvAdapter = new PaymentModeRvAdapter(this);
paymentModeRv.setAdapter(paymentModeRvAdapter);
paymentModeRv.addItemDecoration(new SelectedRedBorderDecoration(this));
paymentModeRv.setItemAnimator(new DefaultItemAnimator());
}
private void showCountryListinDialog() {
if (countryListingDialog == null)
countryListingDialog = new ExchangeRateCurrencyListingDialog();
countryListingDialog.setCountryPaymentData(paymentServiceList);
countryListingDialog.setListener(this);
if (!countryListingDialog.isAdded())
countryListingDialog.show(getSupportFragmentManager(), "GenericTextListingDialog");
}
@Override
protected void onStart() {
super.onStart();
countrySelectionSpinner.setOnClickListener(this);
exRateCalculateButton.setOnClickListener(this);
iv_back.setOnClickListener(this);
recieveMoneyEditText.setOnEditorActionListener(this);
sendMoneyEditText.setOnEditorActionListener(this);
sendMoneyEditText.setOnFocusChangeListener(sendMoneyFocusChangeListener);
}
@Override
protected void onStop() {
super.onStop();
countrySelectionSpinner.setOnClickListener(null);
exRateCalculateButton.setOnClickListener(null);
iv_back.setOnClickListener(null);
recieveMoneyEditText.setOnEditorActionListener(null);
sendMoneyEditText.setOnEditorActionListener(null);
sendMoneyEditText.setOnFocusChangeListener(null);
}
@Override
public void onPaymentModeSelected(PaymentMode selectedData) {
this.selectedPaymentMode = selectedData;
prepareToGetForex();
}
@Override
public void onCountrySelected(CountryPaymentService countryPaymentService) {
if (this.countryListingDialog != null) {
this.countryListingDialog.hideKeyboard();
this.countryListingDialog.dismiss();
}
if(this.selectedCountryPaymentService!=null&&(this.selectedCountryPaymentService.getCurrency().equalsIgnoreCase(countryPaymentService.getCurrency()))&&(this.selectedCountryPaymentService.getCountryCode().equalsIgnoreCase(countryPaymentService.getCountryCode())))
return;
this.selectedCountryPaymentService = countryPaymentService;
showSelectedRecipient(countryPaymentService.getCountryCode(), countryPaymentService.getCurrency());
this.presenter.getDefaultReceivingAmountForSelectedCurrency(countryPaymentService);
}
@Override
public void updateReceivingAmountAndFetchExchangeRate(String amount) {
registerAvailableTextWatchersForEditText(recieveMoneyEditText, true);
recieveMoneyEditText.setText(amount);
shouldCaulatedByRecipient = true;
registerAvailableTextWatchersForEditText(recieveMoneyEditText, false);
showPaymentService(true, this.selectedCountryPaymentService.getServiceAvailable());
}
@Override
public void fallbackToSendingAmountAndFetchExchangeRate(String s) {
registerAvailableTextWatchersForEditText(recieveMoneyEditText, false);
registerAvailableTextWatchersForEditText(sendMoneyEditText, false);
recieveMoneyEditText.setText("");
sendMoneyEditText.setText(s);
shouldCaulatedByRecipient = false;
registerAvailableTextWatchersForEditText(recieveMoneyEditText, true);
registerAvailableTextWatchersForEditText(sendMoneyEditText, true);
showPaymentService(true, this.selectedCountryPaymentService.getServiceAvailable());
}
@Override
public void clearExrateAndServiceCharge() {
transferFeeTxtView.setText("");
exchangeRateTxtView.setText("");
}
private void showSelectedRecipient(String selectedCountryCode, String selectedCountryCurrency) {
int flagResId = CountryFlagMapper.getFlagFromCountryCode(selectedCountryCode);
if (flagResId != -1)
this.recepientFlagImageView.setBackgroundResource(CountryFlagMapper.getFlagFromCountryCode(selectedCountryCode));
if (selectedCountryCurrency != null)
this.recepientCurrencyTextView.setText(selectedCountryCurrency);
}
@Override
public void clearCurrencyData() {
this.recepientFlagImageView.setBackgroundResource(0);
this.recepientCurrencyTextView.setText("---");
}
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
gestureDetector.onTouchEvent(ev);
return super.dispatchTouchEvent(ev);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.countrySelectionSpinner:
showCountryListinDialog();
break;
case R.id.exRateCalculateButton:
prepareToGetForex();
break;
case R.id.iv_back:
onBackPressed();
break;
}
}
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
switch (v.getId()) {
case R.id.sendAmountEdTxt:
if (actionId == EditorInfo.IME_ACTION_DONE) {
shouldCaulatedByRecipient = false;
if (sendMoneyEditText.getText().toString().length() > 0)
prepareToGetForex();
else
showToastMessage(getString(R.string.sending_amount_error));
}
return true;
case R.id.receiveAmountEdTxt:
if (actionId == EditorInfo.IME_ACTION_DONE) {
shouldCaulatedByRecipient = true;
if (recieveMoneyEditText.getText().toString().length() > 0)
prepareToGetForex();
else
showToastMessage(getString(R.string.receiving_amount_error));
}
return true;
}
return false;
}
@Override
protected void onDestroy() {
super.onDestroy();
presenter.onViewDestroyed();
registerTextWatchers(false);
}
@Override
public void showCountryServiceData(List<CountryPaymentService> countryPaymentServiceList, CountryPaymentService defaultCountryPaymentService, String seedValue) {
if (defaultCountryPaymentService != null) {
if (seedValue != null) {
registerAvailableTextWatchersForEditText(this.sendMoneyEditText, false);
registerAvailableTextWatchersForEditText(this.recieveMoneyEditText, false);
this.recieveMoneyEditText.setText(Utils.formatCurrency(seedValue));
shouldCaulatedByRecipient = true;
registerAvailableTextWatchersForEditText(this.sendMoneyEditText, true);
registerAvailableTextWatchersForEditText(this.recieveMoneyEditText, true);
}
this.selectedCountryPaymentService = defaultCountryPaymentService;
this.selectedPaymentMode = defaultCountryPaymentService.getServiceAvailable().get(0);
showSelectedRecipient(defaultCountryPaymentService.getCountryCode(), defaultCountryPaymentService.getCurrency());
showPaymentService(true, defaultCountryPaymentService.getServiceAvailable());
} else {
if (seedValue != null) {
registerAvailableTextWatchersForEditText(this.sendMoneyEditText, false);
registerAvailableTextWatchersForEditText(this.recieveMoneyEditText, false);
this.sendMoneyEditText.setText(Utils.formatCurrency(seedValue));
shouldCaulatedByRecipient = false;
recieveMoneyEditText.setText("");
registerAvailableTextWatchersForEditText(this.sendMoneyEditText, true);
registerAvailableTextWatchersForEditText(this.recieveMoneyEditText, true);
}
//We are taking first item as default as we don't have any default item enlisted
CountryPaymentService firstSelectedItem = countryPaymentServiceList.get(0);
for (CountryPaymentService item : countryPaymentServiceList) {
if (item.getCountryCode().equalsIgnoreCase("NP")) {
firstSelectedItem = item;
break;
}
}
this.selectedCountryPaymentService = firstSelectedItem;
this.selectedPaymentMode = firstSelectedItem.getServiceAvailable().get(0);
showSelectedRecipient(firstSelectedItem.getCountryCode(), firstSelectedItem.getCurrency());
showPaymentService(true, firstSelectedItem.getServiceAvailable());
}
this.paymentServiceList = countryPaymentServiceList;
}
@Override
public void showCountryServiceDataForListedNativeCountry(List<CountryPaymentService> countryPaymentServiceList, CountryPaymentService defaultCountryService, String recepientSeedValue) {
if (recepientSeedValue != null) {
registerAvailableTextWatchersForEditText(this.sendMoneyEditText, false);
registerAvailableTextWatchersForEditText(this.recieveMoneyEditText, false);
this.recieveMoneyEditText.setText(Utils.formatCurrency(recepientSeedValue));
shouldCaulatedByRecipient = true;
registerAvailableTextWatchersForEditText(this.sendMoneyEditText, true);
registerAvailableTextWatchersForEditText(this.recieveMoneyEditText, true);
}
this.selectedCountryPaymentService = defaultCountryService;
this.selectedPaymentMode = defaultCountryService.getServiceAvailable().get(0);
this.paymentServiceList = countryPaymentServiceList;
showSelectedRecipient(defaultCountryService.getCountryCode(), defaultCountryService.getCurrency());
showPaymentService(true, defaultCountryService.getServiceAvailable());
}
@Override
public void showCountryServiceDataForNonListedNativeCountry(List<CountryPaymentService> countryPaymentServiceList, String recepientSeedValue) {
if (recepientSeedValue != null) {
registerAvailableTextWatchersForEditText(this.sendMoneyEditText, false);
registerAvailableTextWatchersForEditText(this.recieveMoneyEditText, false);
this.sendMoneyEditText.setText(Utils.formatCurrency(recepientSeedValue));
shouldCaulatedByRecipient = false;
recieveMoneyEditText.setText("");
registerAvailableTextWatchersForEditText(this.sendMoneyEditText, true);
registerAvailableTextWatchersForEditText(this.recieveMoneyEditText, true);
}
CountryPaymentService firstSelectedItem = countryPaymentServiceList.get(0);
for (CountryPaymentService item : countryPaymentServiceList) {
if (item.getCountryCode().equalsIgnoreCase("NP")) {
firstSelectedItem = item;
break;
}
}
this.selectedCountryPaymentService = firstSelectedItem;
this.selectedPaymentMode = firstSelectedItem.getServiceAvailable().get(0);
this.paymentServiceList = countryPaymentServiceList;
showSelectedRecipient(firstSelectedItem.getCountryCode(), firstSelectedItem.getCurrency());
showPaymentService(true, firstSelectedItem.getServiceAvailable());
}
private void registerTextWatchers(boolean action) {
if (action) {
if (sendAmountTextWatcher == null)
sendAmountTextWatcher = new SendAmountTextWatcher();
if (recepientAmountTextWatcher == null)
recepientAmountTextWatcher = new RecipientAmountTextWatcher();
if (recepientCurrencyFormatterTextWatcher == null)
recepientCurrencyFormatterTextWatcher = new CurrencyFormatterTextWatcher(recieveMoneyEditText);
if (sendCurrencyFormatterTextWatcher == null)
sendCurrencyFormatterTextWatcher = new CurrencyFormatterTextWatcher(sendMoneyEditText);
sendMoneyEditText.addTextChangedListener(sendAmountTextWatcher);
recieveMoneyEditText.addTextChangedListener(recepientAmountTextWatcher);
sendMoneyEditText.addTextChangedListener(sendCurrencyFormatterTextWatcher);
recieveMoneyEditText.addTextChangedListener(recepientCurrencyFormatterTextWatcher);
} else {
sendMoneyEditText.removeTextChangedListener(sendAmountTextWatcher);
recieveMoneyEditText.addTextChangedListener(recepientCurrencyFormatterTextWatcher);
sendMoneyEditText.addTextChangedListener(sendCurrencyFormatterTextWatcher);
recieveMoneyEditText.addTextChangedListener(recepientCurrencyFormatterTextWatcher);
}
}
private void registerAvailableTextWatchersForEditText(EditText editText, boolean action) {
switch (editText.getId()) {
case R.id.sendAmountEdTxt:
if (action)
sendMoneyEditText.addTextChangedListener(sendAmountTextWatcher);
else
sendMoneyEditText.removeTextChangedListener(sendAmountTextWatcher);
break;
case R.id.receiveAmountEdTxt:
if (action)
recieveMoneyEditText.addTextChangedListener(recepientAmountTextWatcher);
else
recieveMoneyEditText.removeTextChangedListener(recepientAmountTextWatcher);
break;
}
}
private void clearFocus()
{
recieveMoneyEditText.clearFocus();
sendMoneyEditText.clearFocus();
}
private void prepareToGetForex() {
if (sendMoneyEditText.getText().length() > 0 || recieveMoneyEditText.getText().length() > 0) {
this.presenter.getForex(this.selectedCountryPaymentService, this.selectedPaymentMode, recieveMoneyEditText.getText().toString(), sendMoneyEditText.getText().toString(), shouldCaulatedByRecipient);
hideKeyBoard();
}
else
showToastMessage("Please specify either of the amount.");
}
@Override
public void updateExchangeRates(String recipientAmount, String sendAmount, String transferDisplay, String exRateDisplay) {
registerAvailableTextWatchersForEditText(recieveMoneyEditText, false);
registerAvailableTextWatchersForEditText(sendMoneyEditText, false);
clearFocus();
this.recieveMoneyEditText.setText(Utils.formatCurrency(recipientAmount));
this.sendMoneyEditText.setText(Utils.formatCurrency(sendAmount));
this.exchangeRateTxtView.setVisibility(View.INVISIBLE);
this.exchangeRateTxtView.setText(exRateDisplay);
this.exchangeRateTxtView.setTranslationY(this.exchangeRateTxtView.getHeight());
this.exchangeRateTxtView.setVisibility(View.VISIBLE);
ViewCompat.animate(this.exchangeRateTxtView).translationY(0).setDuration(550).setInterpolator(this.interpolator).start();
this.transferFeeTxtView.setVisibility(View.INVISIBLE);
this.transferFeeTxtView.setText(transferDisplay);
this.transferFeeTxtView.setTranslationY(this.transferFeeTxtView.getHeight());
this.transferFeeTxtView.setVisibility(View.VISIBLE);
ViewCompat.animate(this.transferFeeTxtView).translationY(0).setDuration(550).setInterpolator(this.interpolator).start();
registerAvailableTextWatchersForEditText(recieveMoneyEditText, true);
registerAvailableTextWatchersForEditText(sendMoneyEditText, true);
}
private class SendAmountTextWatcher implements TextWatcher {
@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 s) {
shouldCaulatedByRecipient = false;
registerAvailableTextWatchersForEditText(recieveMoneyEditText, false);
recieveMoneyEditText.setText("");
registerAvailableTextWatchersForEditText(recieveMoneyEditText, true);
}
}
private class RecipientAmountTextWatcher implements TextWatcher {
@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 s) {
shouldCaulatedByRecipient = true;
registerAvailableTextWatchersForEditText(sendMoneyEditText, false);
sendMoneyEditText.setText("");
registerAvailableTextWatchersForEditText(sendMoneyEditText, true);
}
}
private class AmountChangeAndFocusOutDetector extends GestureDetector.SimpleOnGestureListener {
@Override
public boolean onSingleTapUp(MotionEvent e) {
if (e.getAction() == MotionEvent.ACTION_UP) {
if (hasValidOutsideAmountWidgetTouch(e.getX(), e.getY())) {
prepareToGetForex();
return true;
}
}
return super.onSingleTapUp(e);
}
private boolean hasValidOutsideAmountWidgetTouch(float x, float y) {
int posX=(int)x;
int posY=(int)y;
int[] sendMoneyLeftAndTopCoordinates = new int[2];
int[] receiveMoneyLeftAndTopCoordinates = new int[2];
int[] backButtonLeftAndTopCoordinates = new int[2];
int[] calculateButtonLeftAndTopCoordinates = new int[2];
sendMoneyViewContainer.getLocationOnScreen(sendMoneyLeftAndTopCoordinates);
receiveMoneyViewContainer.getLocationOnScreen(receiveMoneyLeftAndTopCoordinates);
iv_back.getLocationOnScreen(backButtonLeftAndTopCoordinates);
exRateCalculateButton.getLocationOnScreen(calculateButtonLeftAndTopCoordinates);
Rect sendMoneyBoundRect = new Rect(sendMoneyLeftAndTopCoordinates[0], sendMoneyLeftAndTopCoordinates[1],
sendMoneyLeftAndTopCoordinates[0] + sendMoneyViewContainer.getMeasuredWidth(),
sendMoneyLeftAndTopCoordinates[1] + sendMoneyViewContainer.getMeasuredHeight());
Rect receiveMoneyBoundRect = new Rect(receiveMoneyLeftAndTopCoordinates[0], receiveMoneyLeftAndTopCoordinates[1],
receiveMoneyLeftAndTopCoordinates[0] + receiveMoneyViewContainer.getMeasuredWidth(),
receiveMoneyLeftAndTopCoordinates[1] + receiveMoneyViewContainer.getMeasuredHeight());
Rect backButtonBoundRect = new Rect(backButtonLeftAndTopCoordinates[0], backButtonLeftAndTopCoordinates[1],
backButtonLeftAndTopCoordinates[0] + iv_back.getMeasuredWidth(),
backButtonLeftAndTopCoordinates[1] + iv_back.getMeasuredHeight());
Rect calcButtonBoundRect = new Rect(calculateButtonLeftAndTopCoordinates[0], calculateButtonLeftAndTopCoordinates[1],
calculateButtonLeftAndTopCoordinates[0] + exRateCalculateButton.getMeasuredWidth(),
calculateButtonLeftAndTopCoordinates[1] + exRateCalculateButton.getMeasuredHeight());
return (recieveMoneyEditText.hasFocus()||sendMoneyEditText.hasFocus())
&&!sendMoneyBoundRect.contains(posX, posY)
&& !receiveMoneyBoundRect.contains(posX, posY)
&&!backButtonBoundRect.contains(posX, posY)
&&!calcButtonBoundRect.contains(posX,posY);
}
}
private class SendMoneyFocusChangeListener implements View.OnFocusChangeListener {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if(hasFocus)
{
rootView.postDelayed(()->{
rootView.smoothScrollTo(0, rootView.getBottom());
},250);
}
}
}
}

10
app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/adapter/PaymentModeRvAdapter.java → app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/adapter/PaymentModeRvAdapter.java

@ -1,4 +1,4 @@
package com.gmeremit.online.gmeremittance_native.exchange_rate.adapter;
package com.gmeremit.online.gmeremittance_native.exrate.adapter;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
@ -6,10 +6,10 @@ import android.view.View;
import android.view.ViewGroup;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.PaymentModeMapper;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.PaymentMode;
import com.gmeremit.online.gmeremittance_native.exchange_rate.view.PaymentModeViewHolder;
import com.gmeremit.online.gmeremittance_native.exchange_rate.view.SelectedRedBorderDecoration;
import com.gmeremit.online.gmeremittance_native.exrate.model.PaymentModeMapper;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.PaymentMode;
import com.gmeremit.online.gmeremittance_native.exrate.view.PaymentModeViewHolder;
import com.gmeremit.online.gmeremittance_native.exrate.view.SelectedRedBorderDecoration;
import java.util.ArrayList;
import java.util.List;

55
app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/gateway/ExchangeRateGateway.java → app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/gateway/ExchangeRateGateway.java

@ -1,15 +1,11 @@
package com.gmeremit.online.gmeremittance_native.exchange_rate.gateway;
import android.content.SharedPreferences;
package com.gmeremit.online.gmeremittance_native.exrate.gateway;
import com.gmeremit.online.gmeremittance_native.GmeApplication;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.base.PrivilegedGateway;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentServiceSeedValueModel;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.PaymentServiceApiResponse;
import com.gmeremit.online.gmeremittance_native.exchange_rate.presenter.ExchangeRateInteractorInterface;
import com.gmeremit.online.gmeremittance_native.splash_screen.model.LanguageModel;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.CountryPaymentServiceSeedValueModel;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.PaymentServiceApiResponse;
import com.gmeremit.online.gmeremittance_native.exrate.presenter.ExchangeRateInteractorInterface;
import com.gmeremit.online.gmeremittance_native.utils.https.HttpClientV2;
import com.google.gson.JsonObject;
@ -18,10 +14,7 @@ import java.util.List;
import io.reactivex.Observable;
import static com.gmeremit.online.gmeremittance_native.base.PrefKeys.USER_LOGGED_IN_STATUS;
import static com.gmeremit.online.gmeremittance_native.base.PrefKeys.USER_PREFERRED_COUNTRY_CODE;
import static com.gmeremit.online.gmeremittance_native.base.PrefKeys.USER_PREFERRED_LANGUAGE;
import static com.gmeremit.online.gmeremittance_native.base.PrefKeys.USER_PREFERRED_LOCALE;
public class ExchangeRateGateway extends PrivilegedGateway implements ExchangeRateInteractorInterface.ExchangeRateGatewayInterface {
@ -53,43 +46,7 @@ public class ExchangeRateGateway extends PrivilegedGateway implements ExchangeRa
}
@Override
public Observable<List<CountryPaymentServiceSeedValueModel>> getAllSeedVAlues() {
/**
* azerbaijan 1,000 AZ USD
Bangladesh 100,000 BD USD
Belarus 1,000 BY USD
Cambodia 500 KH USD
Georgia 1,000 GE USD
India 100,000 IN INR
Indonesia 15,000,000 ID IDR
Kazakhstan 1,000 KZ USD
Kyrgyzstan 1,000 KG USD
Malaysia 10,000 MY MYR
Moldova 1,000 MD USD
Mongolia(USD) 1,000 MN USD
Mongolia(MNT) 2,000,000 MN MNT
Myanmar 1,500,000 MM MMK
Nepal 100,000 NP NPR
Pakistan 100,000 PK PKR
Philippines 500 PH PHP
Russian Federation 1,000 RU USD
Singapore 2,000 SG SGD
Sri Lanka(LKR) 100,000 LK LKR
Sri Lanka(USD) 1,000 LK USD
Tajikistan 1,000 TJ USD
Thailand(THB) 30,000 TH THB
Uzbekistan 1,000 UZ USD
Vietnam(VND) 50,000,000 VN VND
Vietnam(USD) 2,000 VN USD
*/
return Observable.just(getAllSeedVAluesV2());
}
@Override
public List<CountryPaymentServiceSeedValueModel> getAllSeedVAluesV2() {
List<CountryPaymentServiceSeedValueModel> seedData=new ArrayList<>();

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/model/PaymentModeMapper.java → app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/model/PaymentModeMapper.java

@ -1,4 +1,4 @@
package com.gmeremit.online.gmeremittance_native.exchange_rate.model;
package com.gmeremit.online.gmeremittance_native.exrate.model;
import com.gmeremit.online.gmeremittance_native.R;

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/model/datav2/CountryPaymentService.java → app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/model/datav2/CountryPaymentService.java

@ -1,4 +1,4 @@
package com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2;
package com.gmeremit.online.gmeremittance_native.exrate.model.datav2;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/model/datav2/CountryPaymentServiceSeedValueApiResponse.java → app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/model/datav2/CountryPaymentServiceSeedValueApiResponse.java

@ -1,4 +1,4 @@
package com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2;
package com.gmeremit.online.gmeremittance_native.exrate.model.datav2;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/model/datav2/CountryPaymentServiceSeedValueModel.java → app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/model/datav2/CountryPaymentServiceSeedValueModel.java

@ -1,4 +1,4 @@
package com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2;
package com.gmeremit.online.gmeremittance_native.exrate.model.datav2;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/model/datav2/ExchangeCalculationApiResponse.java → app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/model/datav2/ExchangeCalculationApiResponse.java

@ -1,4 +1,4 @@
package com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2;
package com.gmeremit.online.gmeremittance_native.exrate.model.datav2;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/model/datav2/ExchangeCalculationModel.java → app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/model/datav2/ExchangeCalculationModel.java

@ -1,4 +1,4 @@
package com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2;
package com.gmeremit.online.gmeremittance_native.exrate.model.datav2;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/model/datav2/GenericApiResponseModel.java → app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/model/datav2/GenericApiResponseModel.java

@ -1,4 +1,4 @@
package com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2;
package com.gmeremit.online.gmeremittance_native.exrate.model.datav2;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/model/datav2/PaymentMode.java → app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/model/datav2/PaymentMode.java

@ -1,4 +1,4 @@
package com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2;
package com.gmeremit.online.gmeremittance_native.exrate.model.datav2;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/model/datav2/PaymentServiceApiResponse.java → app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/model/datav2/PaymentServiceApiResponse.java

@ -1,4 +1,4 @@
package com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2;
package com.gmeremit.online.gmeremittance_native.exrate.model.datav2;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

9
app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/presenter/ExchangeRateInteractorInterface.java → app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/presenter/ExchangeRateInteractorInterface.java

@ -1,10 +1,10 @@
package com.gmeremit.online.gmeremittance_native.exchange_rate.presenter;
package com.gmeremit.online.gmeremittance_native.exrate.presenter;
import com.gmeremit.online.gmeremittance_native.base.BaseInteractorInterface;
import com.gmeremit.online.gmeremittance_native.base.PrivilegedGatewayInterface;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentServiceSeedValueModel;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.PaymentServiceApiResponse;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.CountryPaymentServiceSeedValueModel;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.PaymentServiceApiResponse;
import java.util.List;
@ -16,7 +16,6 @@ public interface ExchangeRateInteractorInterface extends BaseInteractorInterface
interface ExchangeRateGatewayInterface extends PrivilegedGatewayInterface
{
Observable<PaymentServiceApiResponse> getPaymentServiceInfoFromServer(String auth);
Observable<List<CountryPaymentServiceSeedValueModel>> getAllSeedVAlues();
List<CountryPaymentServiceSeedValueModel> getAllSeedVAluesV2();
Observable<ExchangeCalculationApiResponse> sendDataForForexCalculation(String auth, String senderCountryId, String senderCurrency, String recieverCurrency,

15
app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/presenter/ExchangeRatePresenter.java → app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/presenter/ExchangeRatePresenter.java

@ -1,4 +1,4 @@
package com.gmeremit.online.gmeremittance_native.exchange_rate.presenter;
package com.gmeremit.online.gmeremittance_native.exrate.presenter;
import android.os.Handler;
@ -6,13 +6,12 @@ import com.gmeremit.online.gmeremittance_native.GmeApplication;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.base.BasePresenter;
import com.gmeremit.online.gmeremittance_native.customwidgets.CustomAlertDialog;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentService;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentServiceSeedValueModel;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationModel;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.PaymentMode;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.PaymentServiceApiResponse;
import com.gmeremit.online.gmeremittance_native.splash_screen.presenter.SplashScreenPresenter;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.CountryPaymentService;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.CountryPaymentServiceSeedValueModel;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.ExchangeCalculationModel;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.PaymentMode;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.PaymentServiceApiResponse;
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;

7
app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/presenter/ExchangeRatePresenterInterface.java → app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/presenter/ExchangeRatePresenterInterface.java

@ -1,10 +1,9 @@
package com.gmeremit.online.gmeremittance_native.exchange_rate.presenter;
package com.gmeremit.online.gmeremittance_native.exrate.presenter;
import com.gmeremit.online.gmeremittance_native.base.BaseContractInterface;
import com.gmeremit.online.gmeremittance_native.base.BasePresenterInterface;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentService;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.PaymentMode;
import com.zoyi.channel.plugin.android.contract.BasePresenter;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.CountryPaymentService;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.PaymentMode;
import java.util.List;

17
app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/view/ExchangeRateActivity.java → app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/view/ExchangeRateActivity.java

@ -1,4 +1,4 @@
package com.gmeremit.online.gmeremittance_native.exchange_rate.view;
package com.gmeremit.online.gmeremittance_native.exrate.view;
import android.graphics.Rect;
import android.support.v4.view.GestureDetectorCompat;
@ -27,12 +27,12 @@ import com.gmeremit.online.gmeremittance_native.customwidgets.CurrencyFormatterT
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.ExchangeRateCurrencyListingDialog;
import com.gmeremit.online.gmeremittance_native.exchange_rate.adapter.PaymentModeRvAdapter;
import com.gmeremit.online.gmeremittance_native.exchange_rate.gateway.ExchangeRateGateway;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentService;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.PaymentMode;
import com.gmeremit.online.gmeremittance_native.exchange_rate.presenter.ExchangeRatePresenter;
import com.gmeremit.online.gmeremittance_native.exchange_rate.presenter.ExchangeRatePresenterInterface;
import com.gmeremit.online.gmeremittance_native.exrate.adapter.PaymentModeRvAdapter;
import com.gmeremit.online.gmeremittance_native.exrate.gateway.ExchangeRateGateway;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.CountryPaymentService;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.PaymentMode;
import com.gmeremit.online.gmeremittance_native.exrate.presenter.ExchangeRatePresenter;
import com.gmeremit.online.gmeremittance_native.exrate.presenter.ExchangeRatePresenterInterface;
import java.util.List;
@ -205,9 +205,6 @@ public class ExchangeRateActivity extends BaseActivity implements ExchangeRatePr
recepientCurrencyTextView.setText(selectedPayoutCountryCurrency.getCurrency());
recepientFlagImageView.setBackgroundResource(CountryFlagMapper.getFlagFromCountryCode(selectedPayoutCountryCurrency.getCountryCode()));
// Glide.with(receivingCountryFlagImageView.getContext())
// .load(CountryFlagMapper.getFlagFromCountryCode(selectedPayoutCountryCurrency.getCountryCode()))
// .into(receivingCountryFlagImageView);
}

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/view/PaymentModeViewHolder.java → app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/view/PaymentModeViewHolder.java

@ -1,4 +1,4 @@
package com.gmeremit.online.gmeremittance_native.exchange_rate.view;
package com.gmeremit.online.gmeremittance_native.exrate.view;
import android.support.v7.widget.RecyclerView;
import android.view.View;

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/view/SelectedRedBorderDecoration.java → app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/view/SelectedRedBorderDecoration.java

@ -1,4 +1,4 @@
package com.gmeremit.online.gmeremittance_native.exchange_rate.view;
package com.gmeremit.online.gmeremittance_native.exrate.view;
import android.content.Context;
import android.graphics.Canvas;

3
app/src/main/java/com/gmeremit/online/gmeremittance_native/homeV2/view/HomeActivityV2.java

@ -33,8 +33,7 @@ import com.gmeremit.online.gmeremittance_native.base.BaseActivity;
import com.gmeremit.online.gmeremittance_native.customer_support.view.CustomerSupportFragment;
import com.gmeremit.online.gmeremittance_native.customwidgets.CustomAlertDialog;
import com.gmeremit.online.gmeremittance_native.domesticremit.send.view.DomesticRemitActivity;
import com.gmeremit.online.gmeremittance_native.exchange_rate.view.ExchangeMethodV2Activity;
import com.gmeremit.online.gmeremittance_native.exchange_rate.view.ExchangeRateActivity;
import com.gmeremit.online.gmeremittance_native.exrate.view.ExchangeRateActivity;
import com.gmeremit.online.gmeremittance_native.homeV2.HomeParentViewContractV2;
import com.gmeremit.online.gmeremittance_native.homeV2.gateway.HomeV2Gateway;
import com.gmeremit.online.gmeremittance_native.homeV2.presenter.HomeV2Presenter;

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/model/recipientaddeditV3/countryservice/ServiceTypeModel.java

@ -1,7 +1,7 @@
package com.gmeremit.online.gmeremittance_native.recipientV3.model.recipientaddeditV3.countryservice;
import com.gmeremit.online.gmeremittance_native.customwidgets.common.GenericImageWithTextListingDialog;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.PaymentModeMapper;
import com.gmeremit.online.gmeremittance_native.exrate.model.PaymentModeMapper;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/resendV2/gateway/resend/ReSendMoneyV2Gateway.java

@ -1,7 +1,7 @@
package com.gmeremit.online.gmeremittance_native.resendV2.gateway.resend;
import com.gmeremit.online.gmeremittance_native.base.PrivilegedGateway;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.ExRateAPIRequestBody;
import com.gmeremit.online.gmeremittance_native.resendV2.presenter.resend.ReSendMoneyV2InteractorInterface;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.SendMoneyAPIRequestBody;

3
app/src/main/java/com/gmeremit/online/gmeremittance_native/resendV2/presenter/resend/ReSendMoneyV2InteractorInterface.java

@ -1,9 +1,8 @@
package com.gmeremit.online.gmeremittance_native.resendV2.presenter.resend;
import com.gmeremit.online.gmeremittance_native.agentsV2.model.AgentsListApiResponse;
import com.gmeremit.online.gmeremittance_native.base.BaseInteractorInterface;
import com.gmeremit.online.gmeremittance_native.base.PrivilegedGatewayInterface;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.ExRateAPIRequestBody;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.SendMoneyAPIRequestBody;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.SendMoneyTransactionResponseBody;

5
app/src/main/java/com/gmeremit/online/gmeremittance_native/resendV2/presenter/resend/ReSendMoneyV2Presenter.java

@ -1,14 +1,11 @@
package com.gmeremit.online.gmeremittance_native.resendV2.presenter.resend;
import android.util.Log;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.autodebitV2.model.autodebitaccountlisting.WebRequestModel;
import com.gmeremit.online.gmeremittance_native.base.BasePresenter;
import com.gmeremit.online.gmeremittance_native.customwidgets.CustomAlertDialog;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.homeV2.model.UserInfoModelV2;
import com.gmeremit.online.gmeremittance_native.resendV2.gateway.resend.ReSendMoneyV2Gateway;
import com.gmeremit.online.gmeremittance_native.resendV2.model.resend.ResendRelatedDataModel;
import com.gmeremit.online.gmeremittance_native.resendV2.model.transactionlisting.PreviousTransactionRelatedData;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.SendMoneyTransactionResponseBody;

9
app/src/main/java/com/gmeremit/online/gmeremittance_native/resendV2/presenter/resend/ReSendMoneyV2PresenterInterface.java

@ -5,14 +5,7 @@ import android.content.Context;
import com.gmeremit.online.gmeremittance_native.autodebitV2.model.autodebitaccountlisting.WebRequestModel;
import com.gmeremit.online.gmeremittance_native.base.BaseContractInterface;
import com.gmeremit.online.gmeremittance_native.base.BasePresenterInterface;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.amountdetail.AmountDetailRelatedDataModel;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.amountdetail.BranchListApiResponse;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.payoutmode.AccountValidationApiResponse;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.payoutmode.BankList;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.payoutmode.BranchList;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.payoutmode.PayoutMode;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.payoutmode.PayoutModeApiResponse;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.verification.VerificationViewModel;
import com.gmeremit.online.gmeremittance_native.transactionpasspromt.PasswordPromptListener;
import com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionBiometricPromptDialog;

9
app/src/main/java/com/gmeremit/online/gmeremittance_native/resendV2/view/amountdetail/ResendMoneyAmountDetailFragment.java

@ -3,13 +3,9 @@ package com.gmeremit.online.gmeremittance_native.resendV2.view.amountdetail;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.constraint.Group;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.ViewCompat;
import android.text.Editable;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.TextWatcher;
import android.text.style.ForegroundColorSpan;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
@ -28,10 +24,9 @@ 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.exchangecountrylistingdialog.CountryFlagMapper;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationModel;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.ExchangeCalculationModel;
import com.gmeremit.online.gmeremittance_native.resendV2.ReSendMoneyActionListener;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.amountdetail.AmountDetailRelatedDataModel;
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;

4
app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/adapter/SendMoneyPayoutModeRvAdapter.java

@ -6,8 +6,8 @@ import android.view.View;
import android.view.ViewGroup;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.PaymentModeMapper;
import com.gmeremit.online.gmeremittance_native.exchange_rate.view.SelectedRedBorderDecoration;
import com.gmeremit.online.gmeremittance_native.exrate.model.PaymentModeMapper;
import com.gmeremit.online.gmeremittance_native.exrate.view.SelectedRedBorderDecoration;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.payoutmode.PayoutMode;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.view.payoutmode.SendMoneyPayoutModeRVViewHolder;

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/gateway/SendMoneyV2Gateway.java

@ -1,7 +1,7 @@
package com.gmeremit.online.gmeremittance_native.sendmoneyV2.gateway;
import com.gmeremit.online.gmeremittance_native.base.PrivilegedGateway;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.ExRateAPIRequestBody;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.SendMoneyAPIRequestBody;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.SendMoneyTransactionResponseBody;

6
app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/presenter/SendMoneyTransactionCompleteV2InteractorInterface.java

@ -2,13 +2,7 @@ package com.gmeremit.online.gmeremittance_native.sendmoneyV2.presenter;
import com.gmeremit.online.gmeremittance_native.base.BaseInteractorInterface;
import com.gmeremit.online.gmeremittance_native.base.PrivilegedGatewayInterface;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.SendMoneyAPIRequestBody;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.SendMoneyTransactionCompleteV2ResponseBody;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.SendMoneyTransactionResponseBody;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.amountdetail.BranchListApiResponse;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.payoutmode.AccountValidationApiResponse;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.payoutmode.PayoutModeApiResponse;
import io.reactivex.Observable;

12
app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/presenter/SendMoneyTransactionCompleteV2PresenterInterface.java

@ -2,19 +2,7 @@ package com.gmeremit.online.gmeremittance_native.sendmoneyV2.presenter;
import com.gmeremit.online.gmeremittance_native.base.BaseContractInterface;
import com.gmeremit.online.gmeremittance_native.base.BasePresenterInterface;
import com.gmeremit.online.gmeremittance_native.customwidgets.passwordpromptdialog.PasswordPromptDialog;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.SendMoneyTransactionCompleteModel;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.amountdetail.AmountDetailRelatedDataModel;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.amountdetail.BranchListApiResponse;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.payoutmode.AccountValidationApiResponse;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.payoutmode.BankList;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.payoutmode.BranchList;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.payoutmode.PayoutMode;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.payoutmode.PayoutModeApiResponse;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.verification.VerificationViewModel;
import io.reactivex.Observable;
public interface SendMoneyTransactionCompleteV2PresenterInterface extends BasePresenterInterface {

3
app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/presenter/SendMoneyV2InteractorInterface.java

@ -1,9 +1,8 @@
package com.gmeremit.online.gmeremittance_native.sendmoneyV2.presenter;
import com.gmeremit.online.gmeremittance_native.agentsV2.model.AgentsListApiResponse;
import com.gmeremit.online.gmeremittance_native.base.BaseInteractorInterface;
import com.gmeremit.online.gmeremittance_native.base.PrivilegedGatewayInterface;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.SendMoneyAPIRequestBody;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.SendMoneyTransactionResponseBody;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.amountdetail.BranchListApiResponse;

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

@ -1,16 +1,13 @@
package com.gmeremit.online.gmeremittance_native.sendmoneyV2.presenter;
import android.util.Log;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.autodebitV2.model.autodebitaccountlisting.AutoDebitAccount;
import com.gmeremit.online.gmeremittance_native.autodebitV2.model.autodebitaccountlisting.WebRequestModel;
import com.gmeremit.online.gmeremittance_native.base.BasePresenter;
import com.gmeremit.online.gmeremittance_native.customwidgets.CustomAlertDialog;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.homeV2.model.UserInfoModelV2;
import com.gmeremit.online.gmeremittance_native.recipientV3.model.recipientlistingV3.ReceiverInfoV3Model;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.gateway.SendMoneyV2Gateway;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.SendMoneyAPIRequestBody;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.SendMoneyRequiredDataV3;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.SendMoneyTransactionResponseBody;

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/presenter/SendMoneyV2PresenterInterface.java

@ -5,7 +5,7 @@ import android.content.Context;
import com.gmeremit.online.gmeremittance_native.autodebitV2.model.autodebitaccountlisting.WebRequestModel;
import com.gmeremit.online.gmeremittance_native.base.BaseContractInterface;
import com.gmeremit.online.gmeremittance_native.base.BasePresenterInterface;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.amountdetail.AmountDetailRelatedDataModel;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.amountdetail.BranchListApiResponse;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.payoutmode.AccountValidationApiResponse;

3
app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/view/amountdetail/AmountDetailExRateCountryListingDialog.java

@ -1,7 +1,6 @@
package com.gmeremit.online.gmeremittance_native.sendmoneyV2.view.amountdetail;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
@ -13,14 +12,12 @@ import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.TextView;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.customwidgets.LineDividerItemDecoration;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentService;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.adapter.ExRateCurrencyListingAmountDetailRvAdapter;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.amountdetail.RecipientCurrencyModel;

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

@ -6,13 +6,9 @@ import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.constraint.Group;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.ViewCompat;
import android.text.Editable;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.TextWatcher;
import android.text.style.ForegroundColorSpan;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
@ -31,8 +27,8 @@ 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.exchangecountrylistingdialog.CountryFlagMapper;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationModel;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.ExchangeCalculationModel;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.amountdetail.AmountDetailRelatedDataModel;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.amountdetail.RecipientCurrencyModel;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.view.SendMoneyActionListener;
@ -44,8 +40,6 @@ import butterknife.BindView;
import butterknife.ButterKnife;
import io.reactivex.disposables.CompositeDisposable;
import static android.view.View.GONE;
public class AmountDetailSendMoneyFragment extends BaseFragment implements View.OnClickListener, AmountDetailExRateCountryListingDialog.ExRateCurrencySelectionListener, TextView.OnEditorActionListener {
@BindView(R.id.amountDetailContinueButton)

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/view/payoutmode/PayoutModeSendMoneyFragment.java

@ -21,7 +21,7 @@ import com.gmeremit.online.gmeremittance_native.GmeApplication;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.base.BaseFragment;
import com.gmeremit.online.gmeremittance_native.customwidgets.CustomAlertDialog;
import com.gmeremit.online.gmeremittance_native.exchange_rate.view.SelectedRedBorderDecoration;
import com.gmeremit.online.gmeremittance_native.exrate.view.SelectedRedBorderDecoration;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.adapter.SendMoneyPayoutModeRvAdapter;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.payoutmode.AccountValidationApiResponse;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.payoutmode.BankList;

3
app/src/main/java/com/gmeremit/online/gmeremittance_native/settings/view/LanguageSelectionListingDialog.java

@ -15,12 +15,9 @@ import android.view.Window;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.TextView;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.customwidgets.LineDividerItemDecoration;
import com.gmeremit.online.gmeremittance_native.customwidgets.exchangecountrylistingdialog.CountryListingRvAdapter;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentService;
import com.gmeremit.online.gmeremittance_native.settings.adapter.LanguageSelectionDialogRVAdapter;
import com.gmeremit.online.gmeremittance_native.splash_screen.model.LanguageModel;

4
app/src/main/java/com/gmeremit/online/gmeremittance_native/socials/view/SocialPrivateWallActivity.java

@ -9,7 +9,6 @@ import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;
@ -23,8 +22,6 @@ import android.widget.Toast;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.customwidgets.CustomAlertDialog;
import com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView;
import com.gmeremit.online.gmeremittance_native.exchange_rate.view.ExchangeMethodV2Activity;
import com.gmeremit.online.gmeremittance_native.recipientV2.view.recipientlisting.RecipientListingV2Activity;
import com.gmeremit.online.gmeremittance_native.socials.SocialContract;
import com.gmeremit.online.gmeremittance_native.socials.adapter.PrivateSocialAdapter;
import com.gmeremit.online.gmeremittance_native.socials.model.SocialModel;
@ -36,7 +33,6 @@ import com.gmeremit.online.gmeremittance_native.utils.Constants;
import com.gmeremit.online.gmeremittance_native.utils.Utils;
import com.gmeremit.online.gmeremittance_native.utils.other.PersistenceStorageManager;
import com.gmeremit.online.gmeremittance_native.utils.other.Utility;
import com.google.gson.Gson;
import java.util.ArrayList;
import java.util.List;

6
app/src/main/java/com/gmeremit/online/gmeremittance_native/splash_screen/adapter/PayoutModeSelectionRVAdapter.java

@ -7,10 +7,8 @@ import android.view.View;
import android.view.ViewGroup;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.PaymentModeMapper;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.PaymentMode;
import com.gmeremit.online.gmeremittance_native.exchange_rate.view.PaymentModeViewHolder;
import com.gmeremit.online.gmeremittance_native.exchange_rate.view.SelectedRedBorderDecoration;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.PaymentMode;
import com.gmeremit.online.gmeremittance_native.exrate.view.SelectedRedBorderDecoration;
import com.gmeremit.online.gmeremittance_native.splash_screen.view.PayoutModeSelectionItemViewHolder;
import java.util.ArrayList;

6
app/src/main/java/com/gmeremit/online/gmeremittance_native/splash_screen/gateway/SplashScreenGateway.java

@ -5,9 +5,9 @@ import android.content.SharedPreferences;
import com.gmeremit.online.gmeremittance_native.GmeApplication;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.base.PrivilegedGateway;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentServiceSeedValueModel;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.PaymentServiceApiResponse;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.CountryPaymentServiceSeedValueModel;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.PaymentServiceApiResponse;
import com.gmeremit.online.gmeremittance_native.splash_screen.model.LanguageModel;
import com.gmeremit.online.gmeremittance_native.splash_screen.presenter.SplashScreenInteractorInterface;
import com.gmeremit.online.gmeremittance_native.utils.https.HttpClientV2;

6
app/src/main/java/com/gmeremit/online/gmeremittance_native/splash_screen/presenter/SplashScreenInteractorInterface.java

@ -2,9 +2,9 @@ package com.gmeremit.online.gmeremittance_native.splash_screen.presenter;
import com.gmeremit.online.gmeremittance_native.base.BaseInteractorInterface;
import com.gmeremit.online.gmeremittance_native.base.PrivilegedGatewayInterface;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentServiceSeedValueModel;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.PaymentServiceApiResponse;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.CountryPaymentServiceSeedValueModel;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.PaymentServiceApiResponse;
import com.gmeremit.online.gmeremittance_native.splash_screen.model.LanguageModel;
import java.util.List;

295
app/src/main/java/com/gmeremit/online/gmeremittance_native/splash_screen/presenter/SplashScreenPresenter.java

@ -3,31 +3,17 @@ package com.gmeremit.online.gmeremittance_native.splash_screen.presenter;
import android.os.Handler;
import com.gmeremit.online.gmeremittance_native.BuildConfig;
import com.gmeremit.online.gmeremittance_native.GmeApplication;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.base.BasePresenter;
import com.gmeremit.online.gmeremittance_native.customwidgets.CustomAlertDialog;
import com.gmeremit.online.gmeremittance_native.customwidgets.exchangecountrylistingdialog.CountryFlagMapper;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentService;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentServiceSeedValueModel;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationModel;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.PaymentMode;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.PaymentServiceApiResponse;
import com.gmeremit.online.gmeremittance_native.splash_screen.model.LanguageModel;
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.security.SignatureCheck;
import com.scottyab.rootbeer.RootBeer;
import java.util.List;
import java.util.concurrent.TimeUnit;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.schedulers.Schedulers;
public class SplashScreenPresenter extends BasePresenter implements SplashScreenPresenterInterface {
@ -36,23 +22,12 @@ public class SplashScreenPresenter extends BasePresenter implements SplashScreen
private SplashScreenContractInterfacee view;
private List<LanguageModel> languageModels;
private final CompositeDisposable compositeDisposables;
private final String sendCountryDefault = "118";
private List<CountryPaymentService> countryRelatedCurrencyList;
private CountryPaymentService selectedCountryPaymentService;
private PaymentMode selectedPaymentMode;
private boolean calcByPayoutAmount;
private String cAmount;
private String pAmount;
public SplashScreenPresenter(SplashScreenContractInterfacee view, SplashScreenInteractorInterface.SplashScreenGatewayInterface gateway) {
this.view = view;
this.gateway = gateway;
rootBeer = new RootBeer(view.getContext());
this.compositeDisposables = new CompositeDisposable();
cAmount = "";
pAmount = "";
}
@ -120,274 +95,4 @@ public class SplashScreenPresenter extends BasePresenter implements SplashScreen
return true;
}
@Override
public void getExrateRelatedData() {
compositeDisposables.add(
getPaymentServiceInfo()
.observeOn(AndroidSchedulers.mainThread())
.subscribeWith(new PaymentServiceDataObserver())
);
}
@Override
public void setPaymentMode(PaymentMode paymentMode) {
this.selectedPaymentMode = paymentMode;
calcExrate();
}
@Override
public void setPAmount(String amount) {
this.pAmount = Utils.removeCommaFromAmount(amount);
this.cAmount = "";
view.showCollectionAmount("");
}
@Override
public void setCAmount(String amount) {
this.cAmount = Utils.removeCommaFromAmount(amount);
this.pAmount = "";
view.showPayoutAmount("");
}
@Override
public void setCalcByPayoutAmount(boolean action) {
calcByPayoutAmount = action;
}
@Override
public List<CountryPaymentService> getAvailableCountryRelatedCurrency() {
return this.countryRelatedCurrencyList;
}
@Override
public void setCountryRelatedCurrencyData(CountryPaymentService countryPaymentService) {
this.selectedCountryPaymentService = countryPaymentService;
selectedPaymentMode = selectedCountryPaymentService.getServiceAvailable().get(0);
view.showSelectedPayoutMode(selectedCountryPaymentService.getServiceAvailable(), 0);
view.showSelectedPayoutCurrency(selectedCountryPaymentService);
pAmount = "";
cAmount = "";
CountryPaymentServiceSeedValueModel countryPaymentServiceSeedValueModel = getDefaultValueByCountryPaymentService(countryPaymentService);
if (countryPaymentServiceSeedValueModel.getRecipientSeedValue() != null &&
countryPaymentServiceSeedValueModel.getCountryCode().equalsIgnoreCase(countryPaymentService.getCountryCode())
&& countryPaymentServiceSeedValueModel.getCurrency().equalsIgnoreCase(countryPaymentService.getCurrency())) {
calcByPayoutAmount = true;
pAmount = countryPaymentServiceSeedValueModel.getRecipientSeedValue();
} else {
calcByPayoutAmount = false;
cAmount = Constants.DEFAULT_EXCHANGE_SEND_AMOUNT;
}
view.showCollectionAmount(Utils.formatCurrency(cAmount));
view.showPayoutAmount(Utils.formatCurrencyWithoutTruncatingDecimal(pAmount));
calcExrate();
}
@Override
public void calcExrate() {
view.hideKeyBoard();
if (selectedCountryPaymentService == null)
return;
if (!validateAmount())
return;
String calculateFlag = calcByPayoutAmount ? Constants.CALC_BY_RECIPEINT : Constants.CALC_BY_SENDER;
String auth = "Basic " + Utils.toBase64("172017F9EC11222E8107142733:QRK2UM0Q:" + GmeApplication.getAppRelatedMetaData(view.getContext()).getDeviceId());
compositeDisposables.add(
this.gateway.sendDataForForexCalculation(auth,
sendCountryDefault,
gateway.getUserPreferredCurrency(), selectedCountryPaymentService.getCurrency(),
Utils.removeCommaFromAmount(cAmount), Utils.removeCommaFromAmount(pAmount), selectedPaymentMode.getId(), calculateFlag, selectedCountryPaymentService.getCountry(),
selectedCountryPaymentService.getCountryId()
).doOnSubscribe(disposable -> {
this.view.showProgressBar(true, getStringfromStringId(R.string.processing_request_text));
})
.doOnError((err) -> this.view.showProgressBar(false, ""))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.doFinally(() -> this.view.showProgressBar(false, ""))
.subscribeWith(new ExchangeRateCalcObserver())
);
}
@Override
public void onExRateViewLoadedSuccessfully() {
updateViewWithDefaulValues();
calcExrate();
}
private boolean validateAmount() {
if (calcByPayoutAmount && pAmount.length() < 1) {
view.showToastMessage(getStringfromStringId(R.string.receiving_amount_error));
return false;
} else if (!calcByPayoutAmount && cAmount.length() < 1) {
view.showToastMessage(getStringfromStringId(R.string.sending_amount_error));
return false;
}
return true;
}
private CountryPaymentServiceSeedValueModel getDefaultValueByCountryPaymentService(CountryPaymentService countryPaymentService) {
//Default preferredLanguage = "NP"
String preferredLanguage = "NP";
String preferredCurrency;
if (countryPaymentService != null) {
preferredLanguage = countryPaymentService.getCountryCode();
preferredCurrency = countryPaymentService.getCurrency();
List<CountryPaymentServiceSeedValueModel> seedValueList = this.gateway.getAllSeedVAluesV2();
for (CountryPaymentServiceSeedValueModel seedValueModel : seedValueList) {
if (seedValueModel.getCountryCode().equalsIgnoreCase(preferredLanguage) && seedValueModel.getCurrency().equalsIgnoreCase(preferredCurrency))
return seedValueModel;
}
}
return new CountryPaymentServiceSeedValueModel(preferredLanguage, null, null);
}
/**
* Delay is added intentionally to work in conjunction with {@link android.support.transition.TransitionManager} API.
* ChangeBound Transition is used for switch between different UI State. This transition works by calculating bound difference between two frames.
* So if network is extremely responsive TransitionManager.beginDelayedTransition sees no difference in change bounds and as a result no corresponding callbacks are invoked.
*/
private Observable<PaymentServiceApiResponse> getPaymentServiceInfo() {
String auth = "Basic " + Utils.toBase64("172017F9EC11222E8107142733:QRK2UM0Q:" + GmeApplication.getAppRelatedMetaData(view.getContext()).getDeviceId());
return this.gateway.getPaymentServiceInfoFromServer(auth).subscribeOn(Schedulers.io()).delay(500, TimeUnit.MILLISECONDS);
}
public class PaymentServiceDataObserver extends GenericApiObserverResponse<PaymentServiceApiResponse> {
@Override
protected void onSuccess(PaymentServiceApiResponse paymentServiceApiResponse) {
if (paymentServiceApiResponse.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2) && paymentServiceApiResponse.getCountryPaymentServices().size() > 0) {
selectedCountryPaymentService = paymentServiceApiResponse.getCountryPaymentServicesByCountryCode(gateway.getPreferredCountryCode());
CountryPaymentServiceSeedValueModel seedValueModel = getDefaultValueByCountryPaymentService(selectedCountryPaymentService);
countryRelatedCurrencyList = paymentServiceApiResponse.getCountryPaymentServices();
try {
selectedCountryPaymentService = paymentServiceApiResponse.getCountryPaymentServiceFromCountryCodeAndCurrency(seedValueModel.getCountryCode(), seedValueModel.getCurrency());
} catch (Exception e) {
selectedCountryPaymentService = null;
}
if (selectedCountryPaymentService == null || selectedCountryPaymentService.getCountryCode() == null || selectedCountryPaymentService.getCountry() == null || selectedCountryPaymentService.getCurrency() == null) {
//No Default PAmount available for the selected country
//Update UI with PAmount,CAmount,SelectedPayoutMode,SelectedCurrency
//TODO Select a default payoutModeData for this case
selectedCountryPaymentService = paymentServiceApiResponse.getDefaultPayoutMode(seedValueModel.getCountryCode());
selectedPaymentMode = selectedCountryPaymentService.getServiceAvailable().get(0);
calcByPayoutAmount = false;
cAmount = Constants.DEFAULT_EXCHANGE_SEND_AMOUNT;
view.showExrateView(null);
} else {
//No Default PAmount available for the selected country
//Update UI with PAmount,CAmount,SelectedPayoutMode,SelectedCurrency
selectedPaymentMode = selectedCountryPaymentService.getServiceAvailable().get(0);
calcByPayoutAmount = true;
pAmount = seedValueModel.getRecipientSeedValue();
view.showExrateView(null);
}
} else {
view.showPopUpMessage(paymentServiceApiResponse.getMessage(), CustomAlertDialog.AlertType.ALERT_RETRY, alertType -> {
new Handler().postDelayed(SplashScreenPresenter.this::getExrateRelatedData, 200);
});
}
}
@Override
public void onFailed(String message) {
view.showPopUpMessage(message, CustomAlertDialog.AlertType.ALERT_RETRY, alertType -> {
new Handler().postDelayed(SplashScreenPresenter.this::getExrateRelatedData, 200);
});
}
@Override
protected void onConnectionNotEstablished(String message) {
view.showPopUpMessage(message, CustomAlertDialog.AlertType.ALERT_RETRY, alertType -> {
new Handler().postDelayed(SplashScreenPresenter.this::getExrateRelatedData, 200);
});
}
@Override
protected void unauthorizedAccess(String message) {
gateway.clearAllUserData();
view.showPopUpMessage(message, CustomAlertDialog.AlertType.ALERT, alertType -> view.exitView());
}
}
private void updateViewWithDefaulValues() {
if (calcByPayoutAmount)
view.showPayoutAmount(Utils.formatCurrencyWithoutTruncatingDecimal(pAmount));
else
view.showCollectionAmount(Utils.formatCurrency(cAmount));
view.showSelectedPayoutMode(selectedCountryPaymentService.getServiceAvailable(), 0);
view.showSelectedPayoutCurrency(selectedCountryPaymentService);
}
private void clearExistingRateOnFailure() {
if (calcByPayoutAmount)
view.showCollectionAmount("");
else
view.showPayoutAmount("");
view.showTransferChargeAndExrate("", "", false);
}
public class ExchangeRateCalcObserver extends GenericApiObserverResponse<ExchangeCalculationApiResponse> {
@Override
protected void onSuccess(ExchangeCalculationApiResponse exchangeCalculationApiResponse) {
if (exchangeCalculationApiResponse.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) {
ExchangeCalculationModel data = exchangeCalculationApiResponse.getData();
String transferAmount = Utils.formatCurrency(data.getScCharge());
String exRate = data.getExRateDisplay();
pAmount = data.getpAmt();
cAmount = data.getCollAmt();
String sendingCurrency = data.getCollCurr();
String transferDisplay = " - " + transferAmount + " " + sendingCurrency + " (" + getStringfromStringId(R.string.transfer_fee_included_text) + ")";
String exRateDisplay = " " + exRate + " (" + getStringfromStringId(R.string.current_exchange_rate_text) + ")";
view.showTransferChargeAndExrate(transferDisplay, exRateDisplay, true);
view.showPayoutAmount(Utils.formatCurrencyWithoutTruncatingDecimal(pAmount));
view.showCollectionAmount(Utils.formatCurrency(cAmount));
} else {
clearExistingRateOnFailure();
view.showPopUpMessage(exchangeCalculationApiResponse.getMsg(), CustomAlertDialog.AlertType.FAILED, null);
}
}
@Override
public void onFailed(String message) {
clearExistingRateOnFailure();
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, null);
}
@Override
protected void onConnectionNotEstablished(String message) {
clearExistingRateOnFailure();
view.showPopUpMessage(message, CustomAlertDialog.AlertType.NO_INTERNET, null);
}
@Override
protected void unauthorizedAccess(String message) {
clearExistingRateOnFailure();
gateway.clearAllUserData();
view.showPopUpMessage(message, CustomAlertDialog.AlertType.ALERT, alertType -> view.logout());
}
}
}

33
app/src/main/java/com/gmeremit/online/gmeremittance_native/splash_screen/presenter/SplashScreenPresenterInterface.java

@ -1,12 +1,9 @@
package com.gmeremit.online.gmeremittance_native.splash_screen.presenter;
import android.content.Context;
import android.support.annotation.DrawableRes;
import com.gmeremit.online.gmeremittance_native.base.BaseContractInterface;
import com.gmeremit.online.gmeremittance_native.base.BasePresenterInterface;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentService;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.PaymentMode;
import com.gmeremit.online.gmeremittance_native.splash_screen.model.LanguageModel;
import java.util.List;
@ -21,23 +18,7 @@ public interface SplashScreenPresenterInterface extends BasePresenterInterface {
boolean checkSafety();
void getExrateRelatedData();
void setPaymentMode(PaymentMode paymentMode);
void setPAmount(String amount);
void setCAmount(String amount);
void setCalcByPayoutAmount(boolean action);
List<CountryPaymentService> getAvailableCountryRelatedCurrency();
void setCountryRelatedCurrencyData(CountryPaymentService countryPaymentService);
void calcExrate();
void onExRateViewLoadedSuccessfully();
interface SplashScreenContractInterfacee extends BaseContractInterface
@ -52,19 +33,5 @@ public interface SplashScreenPresenterInterface extends BasePresenterInterface {
void showAppVersion(String appVersion);
void showPayoutAmount(String pAmount);
void showCollectionAmount(String pAmount);
void showSelectedPayoutMode(List<PaymentMode> serviceAvailable, int selectedIndex);
void showSelectedPayoutCurrency(CountryPaymentService selectedPayoutCountryCurrency);
void showTransferChargeAndExrate(String chargeAmount,String exRate,boolean playAnimation);
void showExrateView(Runnable task);
}
}

45
app/src/main/java/com/gmeremit/online/gmeremittance_native/splash_screen/view/SplashScreen.java

@ -44,9 +44,12 @@ import com.gmeremit.online.gmeremittance_native.customwidgets.CurrencyFormatterT
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.ExchangeRateCurrencyListingDialog;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentService;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.PaymentMode;
import com.gmeremit.online.gmeremittance_native.exchange_rate.view.SelectedRedBorderDecoration;
import com.gmeremit.online.gmeremittance_native.exrate.gateway.ExchangeRateGateway;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.CountryPaymentService;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.PaymentMode;
import com.gmeremit.online.gmeremittance_native.exrate.presenter.ExchangeRatePresenter;
import com.gmeremit.online.gmeremittance_native.exrate.presenter.ExchangeRatePresenterInterface;
import com.gmeremit.online.gmeremittance_native.exrate.view.SelectedRedBorderDecoration;
import com.gmeremit.online.gmeremittance_native.homeV2.view.HomeActivityV2;
import com.gmeremit.online.gmeremittance_native.loginV2.view.LoginV2Activity;
import com.gmeremit.online.gmeremittance_native.registerV2.view.RegisterV2Activity;
@ -67,7 +70,7 @@ import butterknife.BindView;
import butterknife.ButterKnife;
public class SplashScreen extends BaseActivity implements View.OnClickListener, LanguageSelectionRVAdapter.LanguageSelectionListener, SplashScreenPresenterInterface.SplashScreenContractInterfacee, PayoutModeSelectionRVAdapter.OnPaymentModeSelectionListener, TextView.OnEditorActionListener {
public class SplashScreen extends BaseActivity implements View.OnClickListener, LanguageSelectionRVAdapter.LanguageSelectionListener, SplashScreenPresenterInterface.SplashScreenContractInterfacee, PayoutModeSelectionRVAdapter.OnPaymentModeSelectionListener, TextView.OnEditorActionListener, ExchangeRatePresenterInterface.ExchangeRateContractInterfacee {
static {
System.loadLibrary("antidebugger");
@ -157,6 +160,7 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener,
private SplashScreenPresenterInterface presenter;
private ExchangeRatePresenterInterface exRatePresenter;
// public static final String TAG = "SplashScreenTAG";
@ -182,13 +186,13 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener,
languageViewTransitionManager.underlineTitleText(true);
presenter.checkCurrentSelectedLanguage();
presenter.getExrateRelatedData();
exRatePresenter.getExrateRelatedData();
}
private void init() {
progressBar.getIndeterminateDrawable().setColorFilter(ContextCompat.getColor(this, android.R.color.white), android.graphics.PorterDuff.Mode.MULTIPLY);
presenter = new SplashScreenPresenter(this,new SplashScreenGateway());
exRatePresenter=new ExchangeRatePresenter(this,new ExchangeRateGateway());
initAntiDebugger();
languageViewTransitionManager = new LanguageViewTransitionManager(this);
initLanguageRV();
@ -394,11 +398,11 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener,
private void showCountryListinDialog() {
if (countryListingDialog == null)
countryListingDialog = new ExchangeRateCurrencyListingDialog();
countryListingDialog.setCountryPaymentData(presenter.getAvailableCountryRelatedCurrency());
countryListingDialog.setCountryPaymentData(exRatePresenter.getAvailableCountryRelatedCurrency());
countryListingDialog.setListener(new ExchangeRateCurrencyListingDialog.CountrySelectionListener() {
@Override
public void onCountrySelected(CountryPaymentService countryPaymentService) {
presenter.setCountryRelatedCurrencyData(countryPaymentService);
exRatePresenter.setCountryRelatedCurrencyData(countryPaymentService);
countryListingDialog.dismiss();
}
});
@ -448,9 +452,6 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener,
receivingCurrencyCodeTxtView.setText(selectedPayoutCountryCurrency.getCurrency());
receivingCountryFlagImageView.setBackgroundResource(CountryFlagMapper.getFlagFromCountryCode(selectedPayoutCountryCurrency.getCountryCode()));
// Glide.with(receivingCountryFlagImageView.getContext())
// .load(CountryFlagMapper.getFlagFromCountryCode(selectedPayoutCountryCurrency.getCountryCode()))
// .into(receivingCountryFlagImageView);
}
@ -490,7 +491,7 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener,
@Override
public void onPaymentModeSelected(PaymentMode selectedData) {
presenter.setPaymentMode(selectedData);
exRatePresenter.setPaymentMode(selectedData);
}
@Override
@ -498,15 +499,15 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener,
switch (v.getId()) {
case R.id.sendAmountEdTxt:
if (actionId == EditorInfo.IME_ACTION_DONE) {
presenter.setCalcByPayoutAmount(false);
presenter.calcExrate();
exRatePresenter.setCalcByPayoutAmount(false);
exRatePresenter.calcExrate();
return true;
}
case R.id.receiveAmountEdTxt:
if (actionId == EditorInfo.IME_ACTION_DONE) {
presenter.setCalcByPayoutAmount(true);
presenter.calcExrate();
exRatePresenter.setCalcByPayoutAmount(true);
exRatePresenter.calcExrate();
return true;
}
}
@ -670,7 +671,7 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener,
userNavigatedToLanguageView = false;
// if (onAnimationCompleteCallback != null)
// onAnimationCompleteCallback.run();
presenter.onExRateViewLoadedSuccessfully();
exRatePresenter.onExRateViewLoadedSuccessfully();
}
});
@ -712,8 +713,8 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener,
@Override
public void afterTextChanged(Editable s) {
super.afterTextChanged(s);
presenter.setCalcByPayoutAmount(false);
presenter.setCAmount(s.toString());
exRatePresenter.setCalcByPayoutAmount(false);
exRatePresenter.setCAmount(s.toString());
}
}
@ -736,8 +737,8 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener,
@Override
public void afterTextChanged(Editable s) {
super.afterTextChanged(s);
presenter.setCalcByPayoutAmount(true);
presenter.setPAmount(s.toString());
exRatePresenter.setCalcByPayoutAmount(true);
exRatePresenter.setPAmount(s.toString());
}
}
@ -749,7 +750,7 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener,
return super.onSingleTapUp(e);
if (e.getAction() == MotionEvent.ACTION_UP) {
if (hasTouchOutsideTheAmountInputWidget(e.getX(), e.getY())) {
presenter.calcExrate();
exRatePresenter.calcExrate();
return true;
}

4
app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/https/ApiEndpoints.java

@ -3,8 +3,8 @@ package com.gmeremit.online.gmeremittance_native.utils.https;
import com.gmeremit.online.gmeremittance_native.autodebitV2.model.autodebitaccountlisting.AutoDebitAddSeriveAuthenticationServiceModel;
import com.gmeremit.online.gmeremittance_native.changepasswordV2.model.ChangePasswordActivityV2APIResponse;
import com.gmeremit.online.gmeremittance_native.domesticremit.send.model.DomesticRemitTxnRequestBody;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.PaymentServiceApiResponse;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.PaymentServiceApiResponse;
import com.gmeremit.online.gmeremittance_native.homeV2.model.UserInfoV2DataApiResponse;
import com.gmeremit.online.gmeremittance_native.kycV2.model.kyc.KYCRegistrationDataResponse;
import com.gmeremit.online.gmeremittance_native.kycV2.model.kyc.KYCRelatedDataResponse;

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

@ -15,7 +15,7 @@
android:clickable="true"
android:scrollbars="none"
android:background="@color/background_gray"
tools:context="com.gmeremit.online.gmeremittance_native.exchange_rate.view.ExchangeMethodV2Activity"
tools:context="com.gmeremit.online.gmeremittance_native.exrate.view.ExchangeMethodV2Activity"
android:layout_width="match_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

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

@ -5,7 +5,7 @@
android:layout_height="match_parent"
android:clickable="true"
android:id="@+id/rootView"
tools:context="com.gmeremit.online.gmeremittance_native.exchange_rate.view.ExchangeMethodV2Activity"
tools:context="com.gmeremit.online.gmeremittance_native.exrate.view.ExchangeMethodV2Activity"
android:layout_width="match_parent"
android:focusable="true">

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

@ -15,7 +15,7 @@
android:clickable="true"
android:scrollbars="none"
android:background="@color/background_gray"
tools:context="com.gmeremit.online.gmeremittance_native.exchange_rate.view.ExchangeMethodV2Activity"
tools:context="com.gmeremit.online.gmeremittance_native.exrate.view.ExchangeMethodV2Activity"
android:layout_width="match_parent">
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"

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

@ -8,7 +8,7 @@
android:background="@color/background_gray"
android:clickable="true"
android:scrollbars="none"
tools:context="com.gmeremit.online.gmeremittance_native.exchange_rate.view.ExchangeMethodV2Activity">
tools:context="com.gmeremit.online.gmeremittance_native.exrate.view.ExchangeMethodV2Activity">
<LinearLayout
android:id="@+id/rootView"

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

@ -8,7 +8,7 @@
android:background="@color/background_gray"
android:clickable="true"
android:scrollbars="none"
tools:context="com.gmeremit.online.gmeremittance_native.exchange_rate.view.ExchangeMethodV2Activity">
tools:context="com.gmeremit.online.gmeremittance_native.exrate.view.ExchangeMethodV2Activity">
<LinearLayout
android:id="@+id/rootView"

Loading…
Cancel
Save