Browse Source

Rebranding done

master
Preyea Regmi 4 years ago
parent
commit
331414c984
  1. 18
      app/src/main/java/com/swifttech/remit/android/base/BaseActivity.java
  2. 2
      app/src/main/java/com/swifttech/remit/android/common/customwidgets/RemitLoaderDialog.java
  3. 190
      app/src/main/java/com/swifttech/remit/android/features/customersupport/view/CustomerSupportFragment.java
  4. 2
      app/src/main/java/com/swifttech/remit/android/features/home/view/HomeActivityV2.java
  5. 2
      app/src/main/java/com/swifttech/remit/android/features/kyc/view/KYCV3Activity.java
  6. 14
      app/src/main/java/com/swifttech/remit/android/features/login/presenter/LoginV2Presenter.java
  7. 128
      app/src/main/java/com/swifttech/remit/android/features/security/RemitAuthManager.java
  8. 10
      app/src/main/java/com/swifttech/remit/android/features/security/auth/RemitTxnOTPRequestBottomSheetDialog.java
  9. 317
      app/src/main/java/com/swifttech/remit/android/features/security/auth/profilescreen/RemitUserProfileChangeOTPRequestBottomSheetDialog.java
  10. 42
      app/src/main/java/com/swifttech/remit/android/features/security/model/GMEScreenBasedParam.java
  11. 6
      app/src/main/java/com/swifttech/remit/android/features/security/model/RemitAuthFailedResult.java
  12. 6
      app/src/main/java/com/swifttech/remit/android/features/security/model/RemitAuthSuccessResult.java
  13. 4
      app/src/main/java/com/swifttech/remit/android/features/security/model/RemitBiometricEncryptionDTO.java
  14. 24
      app/src/main/java/com/swifttech/remit/android/features/security/model/RemitTxnParam.java
  15. 36
      app/src/main/java/com/swifttech/remit/android/features/sendmoney/presenter/SendMoneyV2Presenter.java
  16. 12
      app/src/main/java/com/swifttech/remit/android/features/settings/view/FingerprintEnablePromptActivity.java
  17. 16
      app/src/main/java/com/swifttech/remit/android/features/settings/view/SettingsView.java
  18. 32
      app/src/main/java/com/swifttech/remit/android/features/splashscreen/gateway/SplashScreenGateway.java
  19. 2
      app/src/main/java/com/swifttech/remit/android/features/termsandcondition/view/TermsAndConditionAcitivity.java
  20. 8
      app/src/main/java/com/swifttech/remit/android/features/webbrowser/WebBrowserFragmentV2.java
  21. 8
      app/src/main/java/com/swifttech/remit/android/features/webbrowser/WebBrowserV2Activity.java
  22. 81
      app/src/main/res/layout/fragment_customer_support.xml

18
app/src/main/java/com/swifttech/remit/android/base/BaseActivity.java

@ -25,7 +25,7 @@ import android.widget.Toast;
import com.swifttech.remit.android.RemitApplication;
import com.swifttech.remit.android.common.customwidgets.CustomAlertDialog;
import com.swifttech.remit.android.common.customwidgets.CustomProgressDialog;
import com.swifttech.remit.android.common.customwidgets.GMELoaderDialog;
import com.swifttech.remit.android.common.customwidgets.RemitLoaderDialog;
import com.swifttech.remit.android.features.splashscreen.view.SplashScreen;
import java.util.Locale;
@ -38,7 +38,7 @@ public class BaseActivity extends AppCompatActivity implements BaseContractInter
private boolean isProgressBarShowing;
private CustomAlertDialog customAlertDialog;
private GMELoaderDialog gmeLoaderDialog;
private RemitLoaderDialog remitLoaderDialog;
private boolean shouldEnableAppScreenShot = true;
private boolean shouldallowDefaultActivityTransition = false;
@ -109,19 +109,19 @@ public class BaseActivity extends AppCompatActivity implements BaseContractInter
private void showGMELoader(boolean action) {
try {
if (action) {
if (gmeLoaderDialog != null && isProgressBarShowing) {
if (remitLoaderDialog != null && isProgressBarShowing) {
return;
}
gmeLoaderDialog = new GMELoaderDialog();
remitLoaderDialog = new RemitLoaderDialog();
FragmentManager fragmentManager = this.getSupportFragmentManager();
if (!gmeLoaderDialog.isAdded())
gmeLoaderDialog.show(fragmentManager, "GMELoaderDialog");
if (!remitLoaderDialog.isAdded())
remitLoaderDialog.show(fragmentManager, "RemitLoaderDialog");
isProgressBarShowing = true;
} else {
if (gmeLoaderDialog != null) {
gmeLoaderDialog.dismiss();
if (remitLoaderDialog != null) {
remitLoaderDialog.dismiss();
isProgressBarShowing = false;
gmeLoaderDialog = null;
remitLoaderDialog = null;
}
}
} catch (IllegalStateException e) {

2
app/src/main/java/com/swifttech/remit/android/common/customwidgets/GMELoaderDialog.java → app/src/main/java/com/swifttech/remit/android/common/customwidgets/RemitLoaderDialog.java

@ -15,7 +15,7 @@ import com.swifttech.remit.android.R;
import butterknife.BindView;
import butterknife.ButterKnife;
public class GMELoaderDialog extends DialogFragment {
public class RemitLoaderDialog extends DialogFragment {
@BindView(R.id.imageView)
AppCompatImageView gmeLoaderImageView;

190
app/src/main/java/com/swifttech/remit/android/features/customersupport/view/CustomerSupportFragment.java

@ -1,251 +1,87 @@
package com.swifttech.remit.android.features.customersupport.view;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.FragmentManager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.swifttech.remit.android.RemitApplication;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import com.swifttech.remit.android.R;
import com.swifttech.remit.android.features.customersupport.CustomerSupportContract;
import com.swifttech.remit.android.features.customersupport.presenter.CustomerSupportPresenter;
import com.swifttech.remit.android.common.customwidgets.CustomAlertDialog;
import com.swifttech.remit.android.common.customwidgets.CustomProgressDialog;
import com.swifttech.remit.android.features.support.view.SupportActivityV2;
import com.swifttech.remit.android.utils.Utils;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import static com.swifttech.remit.android.base.PrefKeys.USER_COOUNTRY_CODE;
/**
* Created by FMI-LT-17 on 2/6/2018.
*/
public class CustomerSupportFragment extends DialogFragment implements CustomerSupportContract.IView {
private static final String CUSTOMER_SUPPORT_IS_GUEST_USER = "GUEST_USER_BUNDLE_KEY";
public class CustomerSupportFragment extends BottomSheetDialogFragment {
@BindView(R.id.viewFaceBook)
View viewFaceBook;
@BindView(R.id.viewCall)
View viewCall;
@BindView(R.id.chatView)
View chatView;
@BindView(R.id.btnCancel)
TextView btnCancel;
@BindView(R.id.callTxtView)
TextView callTxtView;
@BindView(R.id.notificationCounterTxtView)
TextView notificationCounterTxtView;
private CustomerSupportPresenter presenter;
public static CustomerSupportFragment newInstance() {
private CustomProgressDialog dialog;
private boolean isProgressBarShowing;
private CustomAlertDialog customAlertDialog;
private static final String CUSTOMER_SUPPORT_FRAG_ARG_BUNDLE_KEY = "customerSupporBundleKeyArg";
private boolean shouldStartChatAsGuestUser;
public static CustomerSupportFragment newInstance(String badgeCount, boolean shouldStartChatAsGuestUser) {
Bundle bundle = new Bundle();
bundle.putString(CUSTOMER_SUPPORT_FRAG_ARG_BUNDLE_KEY, badgeCount);
bundle.putBoolean(CUSTOMER_SUPPORT_IS_GUEST_USER, shouldStartChatAsGuestUser);
CustomerSupportFragment customerSupportFragment = new CustomerSupportFragment();
customerSupportFragment.setArguments(bundle);
return customerSupportFragment;
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setStyle(DialogFragment.STYLE_NO_FRAME, android.R.style.Theme_Translucent_NoTitleBar);
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_customer_support, container, false);
init(view);
performDefaultAction();
return view;
}
private void performDefaultAction() {
chatView.setVisibility(View.GONE);
callTxtView.setText(getCustomerSupportContact());
String badgeCount = getArguments().getString(CUSTOMER_SUPPORT_FRAG_ARG_BUNDLE_KEY, "");
shouldStartChatAsGuestUser = getArguments().getBoolean(CUSTOMER_SUPPORT_IS_GUEST_USER, false);
if (badgeCount != null && badgeCount.length() > 0) {
notificationCounterTxtView.setText(badgeCount);
notificationCounterTxtView.setVisibility(View.VISIBLE);
}
}
public void showProgressBar(boolean action, String message) {
try {
if (action) {
if (dialog != null && isProgressBarShowing) {
dialog.updateMessage(message);
return;
}
dialog = new CustomProgressDialog();
dialog.setMessage(message);
FragmentManager fragmentManager = getActivity().getSupportFragmentManager();
if (fragmentManager != null)
dialog.show(fragmentManager, "CustomProgressBar");
isProgressBarShowing = true;
} else {
if (dialog != null) {
dialog.dismiss();
isProgressBarShowing = false;
dialog = null;
}
callTxtView.setText("1233-012-312");
}
} catch (Exception e) {
}
}
private String getCustomerSupportContact() {
String localeCode = RemitApplication.getStorage().getString(USER_COOUNTRY_CODE, "NP");
Log.d("CurrentUserNativeCode", localeCode);
switch (localeCode.toUpperCase()) {
case "KH":
return "02-2138-6427";
case "TH":
return "010-9928-6864";
case "LK":
return "1811-2935";
case "MN":
return "010-2973-6864";
case "MM":
return "1811-2938";
case "NP":
return "1811-2934";
case "ID":
return "1811-2945";
case "BD":
return "1811-2943";
case "UZ":
return "010-3015-6864";
case "VN":
return "1811-2937";
case "PH":
return "1811-2936";
case "IN":
return "010-2760-6864";
case "PK":
return "010-2760-6864";
case "KZ":
return "010-2960-6864";
case "RU":
return "010-2960-6864";
case "TJ":
return "010-2960-6864";
case "KG":
return "010-2968-6864";
case "UA":
return "010-2960-6864";
default:
return "1811-2934";
}
}
private void init(View view) {
ButterKnife.bind(this, view);
presenter = new CustomerSupportPresenter(this);
}
@OnClick({R.id.viewFaceBook, R.id.viewCall, R.id.chatView, R.id.btnCancel})
@OnClick({R.id.viewFaceBook, R.id.viewCall, R.id.btnCancel})
public void onClick(View view) {
switch (view.getId()) {
case R.id.viewCall:
presenter.onSupportCallClicked();
Intent call = new Intent(Intent.ACTION_DIAL);
call.setData(Uri.parse("tel: " + callTxtView.getText().toString()));
startActivity(call);
break;
case R.id.btnCancel:
presenter.onCancelClicked();
this.dismiss();
break;
}
}
@Override
public void dismissDialog() {
dismiss();
}
@Override
public void showWriteFeedbackDialog() {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
LayoutInflater inflater = this.getLayoutInflater();
View dialogView = inflater.inflate(R.layout.cs_message_dialog, null);
builder.setView(dialogView);
final EditText etMessage = dialogView.findViewById(R.id.etCustomerMessage);
builder.setCancelable(true);
builder.setPositiveButton("Send", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
}
});
AlertDialog dialog = builder.create();
dialog.show();
}
@Override
public void handleCall() {
Intent call = new Intent(Intent.ACTION_DIAL);
call.setData(Uri.parse("tel: " + callTxtView.getText().toString()));
startActivity(call);
}
@Override
public void handleLiveChat() {
Toast.makeText(getActivity(), "Coming Soon", Toast.LENGTH_SHORT).show();
}
@Override
public void handleSendEmail() {
Intent intent = new Intent(getActivity(), SupportActivityV2.class);
startActivity(intent);
}

2
app/src/main/java/com/swifttech/remit/android/features/home/view/HomeActivityV2.java

@ -194,7 +194,7 @@ public class HomeActivityV2 extends BaseActivity implements HomeParentViewContra
switch (view.getId()) {
case R.id.iv_help:
CustomerSupportFragment newFragment = CustomerSupportFragment.newInstance(presenter.getPersistedRecentNotification(),false);
CustomerSupportFragment newFragment = CustomerSupportFragment.newInstance();
newFragment.show(getSupportFragmentManager(), "dialog");
showDrawer(false);
break;

2
app/src/main/java/com/swifttech/remit/android/features/kyc/view/KYCV3Activity.java

@ -171,7 +171,7 @@ public class KYCV3Activity extends BaseActivity implements KYCV3PresenterInterfa
@OnClick(R.id.iv_support)
public void onCsSupportPressed() {
CustomerSupportFragment newFragment = CustomerSupportFragment.newInstance("", true);
CustomerSupportFragment newFragment = CustomerSupportFragment.newInstance();
newFragment.show(getSupportFragmentManager(), "dialog");
}

14
app/src/main/java/com/swifttech/remit/android/features/login/presenter/LoginV2Presenter.java

@ -9,8 +9,8 @@ import com.swifttech.remit.android.common.customwidgets.CustomAlertDialog;
import com.swifttech.remit.android.features.login.gateway.LoginV2Gateway;
import com.swifttech.remit.android.features.login.model.LoginModelV2;
import com.swifttech.remit.android.features.security.RemitAuthManager;
import com.swifttech.remit.android.features.security.model.GMEAuthFailedResult;
import com.swifttech.remit.android.features.security.model.GMEAuthSuccessResult;
import com.swifttech.remit.android.features.security.model.RemitAuthFailedResult;
import com.swifttech.remit.android.features.security.model.RemitAuthSuccessResult;
import com.swifttech.remit.android.utils.Constants;
import com.swifttech.remit.android.utils.https.GenericApiObserverResponse;
@ -73,7 +73,7 @@ public class LoginV2Presenter extends BaseViewModel implements LoginV2PresenterI
bindView(viewBindings);
getLastLoginIfAvailable();
//TODO mock valid user
// mockValidUserLogin();
mockValidUserLogin();
return loginViewLiveData;
}
@ -142,21 +142,21 @@ public class LoginV2Presenter extends BaseViewModel implements LoginV2PresenterI
@Override
public void promptForBiometricAuth() {
remitAuthManager.requestBiometricAuth()
.setListener(new RemitAuthManager.GMEAuthListener() {
.setListener(new RemitAuthManager.RemitAuthListener() {
@Override
public void onGMEAuthSuccess(GMEAuthSuccessResult result) {
public void onRemitAuthSuccess(RemitAuthSuccessResult result) {
loginValidator.password=result.getResult();
loginUser();
}
@Override
public void onGMEAuthFailed(GMEAuthFailedResult failedResult) {
public void onRemitAuthFailed(RemitAuthFailedResult failedResult) {
view.showFingerPrintScanner(failedResult.isRecoverable());
view.showToastMessage(failedResult.getFailedReason());
}
@Override
public void onGMEAuthCancelled() {
public void onRemitAuthCancelled() {
}
}).prompt();

128
app/src/main/java/com/swifttech/remit/android/features/security/RemitAuthManager.java

@ -6,21 +6,19 @@ import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.swifttech.remit.android.RemitApplication;
import com.mtramin.rxfingerprint.RxFingerprint;
import com.mtramin.rxfingerprint.data.BiometricExceptions;
import com.mtramin.rxfingerprint.data.FingerprintDecryptionResult;
import com.swifttech.remit.android.R;
import com.swifttech.remit.android.RemitApplication;
import com.swifttech.remit.android.base.PrefKeys;
import com.swifttech.remit.android.features.security.auth.RemitTxnOTPRequestBottomSheetDialog;
import com.swifttech.remit.android.features.security.auth.RemitUserPasswordPromptBottomSheetDialog;
import com.swifttech.remit.android.features.security.auth.profilescreen.RemitUserProfileChangeOTPRequestBottomSheetDialog;
import com.swifttech.remit.android.features.security.model.GMEAuthFailedResult;
import com.swifttech.remit.android.features.security.model.GMEAuthSuccessResult;
import com.swifttech.remit.android.features.security.model.GMEBiometricEncryptionDTO;
import com.swifttech.remit.android.features.security.model.GMEScreenBasedParam;
import com.swifttech.remit.android.features.security.model.GMETxnParam;
import com.swifttech.remit.android.features.security.model.RemitAuthFailedResult;
import com.swifttech.remit.android.features.security.model.RemitAuthSuccessResult;
import com.swifttech.remit.android.features.security.model.RemitBiometricEncryptionDTO;
import com.swifttech.remit.android.features.security.model.RemitTxnParam;
import com.swifttech.remit.android.features.security.utils.SecurityUtils;
import com.mtramin.rxfingerprint.RxFingerprint;
import com.mtramin.rxfingerprint.data.BiometricExceptions;
import com.mtramin.rxfingerprint.data.FingerprintDecryptionResult;
import io.reactivex.Completable;
import io.reactivex.Observable;
@ -42,10 +40,9 @@ public class RemitAuthManager {
private AppCompatActivity context;
private GMEAuthListener listener;
private RemitAuthListener listener;
private RemitAuthManagerGateway remitAuthManagerGateway;
private GMETxnParam gmeTxnParam;
private GMEScreenBasedParam gmeScreenBasedParam;
private RemitTxnParam remitTxnParam;
private RxFingerprint.BiometricPromptDialogParam biometricDialogParam;
private RemitAuthManager(AppCompatActivity context) {
@ -65,8 +62,7 @@ public class RemitAuthManager {
private void resetParamToDefault() {
listener = null;
gmeTxnParam = null;
gmeScreenBasedParam = null;
remitTxnParam = null;
}
public static RemitAuthManager getGmeAuthManager(AppCompatActivity context) {
@ -74,59 +70,41 @@ public class RemitAuthManager {
}
public RemitAuthManager setListener(GMEAuthListener listener) {
public RemitAuthManager setListener(RemitAuthListener listener) {
this.listener = listener;
return this;
}
public RemitAuthManager fromPaymentSource(GMETxnParam gmeTxnParam) {
this.gmeTxnParam = gmeTxnParam;
if (gmeTxnParam == null)
public RemitAuthManager fromPaymentSource(RemitTxnParam remitTxnParam) {
this.remitTxnParam = remitTxnParam;
if (remitTxnParam == null)
throw new IllegalArgumentException("Txn Param cannot be null");
if (checkIfUserHasEnabledBiometric())
gmeTxnParam.setGmeTxnAuthType(GMETxnParam.GMETxnAuthType.BIOMETRIC);
remitTxnParam.setGmeTxnAuthType(RemitTxnParam.GMETxnAuthType.BIOMETRIC);
else
gmeTxnParam.setGmeTxnAuthType(GMETxnParam.GMETxnAuthType.PASSWORD);
// if ("wallet".equalsIgnoreCase(gmeTxnParam.getPaymentSource()))
// if (checkIfUserHasEnabledBiometric())
// gmeTxnParam.setGmeTxnAuthType(GMETxnParam.GMETxnAuthType.BIOMETRIC);
// else
// gmeTxnParam.setGmeTxnAuthType(GMETxnParam.GMETxnAuthType.PASSWORD);
// else if ("autodebit".equalsIgnoreCase(gmeTxnParam.getPaymentSource()))
// gmeTxnParam.setGmeTxnAuthType(GMETxnParam.GMETxnAuthType.OTP);
remitTxnParam.setGmeTxnAuthType(RemitTxnParam.GMETxnAuthType.PASSWORD);
return this;
}
public RemitAuthManager requestAuthPerScreenExplicitly(GMEScreenBasedParam gmeScreenBasedParam) {
this.gmeScreenBasedParam = gmeScreenBasedParam;
this.gmeTxnParam = null;
return this;
}
public RemitAuthManager requestBiometricAuth() {
this.gmeTxnParam = GMETxnParam.forBiometricAuth();
this.gmeScreenBasedParam = null;
this.remitTxnParam = RemitTxnParam.forBiometricAuth();
return this;
}
public RemitAuthManager requestPasswordAuth() {
this.gmeTxnParam = GMETxnParam.forPasswordAuth();
this.gmeScreenBasedParam = null;
this.remitTxnParam = RemitTxnParam.forPasswordAuth();
return this;
}
public void prompt() {
if (gmeScreenBasedParam != null) {
startPerScreenBasedAuth();
} else if (gmeTxnParam != null) {
if (remitTxnParam != null) {
startTXNRelatedAuth();
} else
returnInvalidRequest();
@ -152,12 +130,12 @@ public class RemitAuthManager {
private void returnInvalidRequest() {
if (listener != null)
listener.onGMEAuthFailed(new GMEAuthFailedResult("Unknown auth requested.\n" + INVALID_REQUEST));
listener.onRemitAuthFailed(new RemitAuthFailedResult("Unknown auth requested.\n" + INVALID_REQUEST));
}
private void returnSecretOnly(String secret) {
if (listener != null)
listener.onGMEAuthSuccess(new GMEAuthSuccessResult(secret));
listener.onRemitAuthSuccess(new RemitAuthSuccessResult(secret));
}
private void showUserPasswordPrompt() {
@ -177,7 +155,7 @@ public class RemitAuthManager {
@Override
public void onNext(String userSecret) {
if (listener != null)
listener.onGMEAuthSuccess(new GMEAuthSuccessResult(userSecret, true));
listener.onRemitAuthSuccess(new RemitAuthSuccessResult(userSecret, true));
}
@Override
@ -185,17 +163,17 @@ public class RemitAuthManager {
if (listener != null) {
if (e instanceof BiometricExceptions.BiometricAuthUserCancelledException)
listener.onGMEAuthCancelled();
listener.onRemitAuthCancelled();
else if (e instanceof BiometricExceptions.BiometricAuthNonRecoverableException) {
if (gmeTxnParam != null && gmeTxnParam.isFallbackAuthEnabled()) {
if (remitTxnParam != null && remitTxnParam.isFallbackAuthEnabled()) {
Toast.makeText(context, "Fingerprint authentication is not available at the moment. Please use the password instead", Toast.LENGTH_LONG).show();
new Handler().postDelayed(() -> showUserPasswordPrompt(), 500);
} else
listener.onGMEAuthFailed(new GMEAuthFailedResult(e.getMessage()));
listener.onRemitAuthFailed(new RemitAuthFailedResult(e.getMessage()));
} else if (e instanceof BiometricExceptions.BiometricAuthRecoverableException)
listener.onGMEAuthFailed(new GMEAuthFailedResult(e.getMessage(), true));
listener.onRemitAuthFailed(new RemitAuthFailedResult(e.getMessage(), true));
else
listener.onGMEAuthFailed(new GMEAuthFailedResult(e.getMessage()));
listener.onRemitAuthFailed(new RemitAuthFailedResult(e.getMessage()));
}
}
@ -228,7 +206,7 @@ public class RemitAuthManager {
.flatMap(key -> Observable.zip(Observable.just(userId),
SecurityUtils.encryptUsingAES(pwd, key).subscribeOn(Schedulers.io()),
encryptByKeyStore(key).subscribeOn(Schedulers.io()),
GMEBiometricEncryptionDTO::new)
RemitBiometricEncryptionDTO::new)
).map(data -> {
remitAuthManagerGateway.persistSecretKeyForBiometric(data.getEncKey());
remitAuthManagerGateway.persistUserPwdForBiometric(data.getEncPwd());
@ -246,7 +224,7 @@ public class RemitAuthManager {
}
private void showOTPTxnPrompt() {
RemitTxnOTPRequestBottomSheetDialog.showPromptView(this.gmeTxnParam, new RemitTxnOTPRequestBottomSheetDialog.GMETxnOTPUserSubmitListener() {
RemitTxnOTPRequestBottomSheetDialog.showPromptView(this.remitTxnParam, new RemitTxnOTPRequestBottomSheetDialog.GMETxnOTPUserSubmitListener() {
@Override
public void onOTPSubmittedSucessfully(String secretOTP) {
returnSecretOnly(secretOTP);
@ -255,26 +233,12 @@ public class RemitAuthManager {
@Override
public void onCancelled() {
if (listener != null)
listener.onGMEAuthCancelled();
listener.onRemitAuthCancelled();
}
}).show(context.getSupportFragmentManager(), RemitTxnOTPRequestBottomSheetDialog.class.getSimpleName());
}
private void showOTPProfilePrompt() {
RemitUserProfileChangeOTPRequestBottomSheetDialog.showPromptView(gmeScreenBasedParam.getParam(), new RemitUserProfileChangeOTPRequestBottomSheetDialog.GMEUserProfileChangeOTPRequestListener() {
@Override
public void onOTPSubmittedSucessfully(String secret) {
returnSecretOnly(secret);
}
@Override
public void onOTPRequestFailed() {
}
}).show(context.getSupportFragmentManager(), RemitUserPasswordPromptBottomSheetDialog.class.getSimpleName());
}
private boolean checkIfUserHasEnabledBiometric() {
@ -286,27 +250,9 @@ public class RemitAuthManager {
}
private void startPerScreenBasedAuth() {
if (gmeScreenBasedParam != null) {
switch (gmeScreenBasedParam.getGmeScreenBasedAuthType()) {
case OTP_REQUEST_PROFILE:
case OTP_SUBMIT_PROFILE:
showOTPProfilePrompt();
break;
case PASSWORD_USER_PROFILE:
showUserPasswordPrompt();
break;
default:
returnInvalidRequest();
}
}
}
private void startTXNRelatedAuth() {
switch (gmeTxnParam.getGmeTxnAuthType()) {
switch (remitTxnParam.getGmeTxnAuthType()) {
case OTP:
showOTPTxnPrompt();
break;
@ -322,12 +268,12 @@ public class RemitAuthManager {
}
public interface GMEAuthListener {
void onGMEAuthSuccess(GMEAuthSuccessResult successResult);
public interface RemitAuthListener {
void onRemitAuthSuccess(RemitAuthSuccessResult successResult);
void onGMEAuthFailed(GMEAuthFailedResult failedResult);
void onRemitAuthFailed(RemitAuthFailedResult failedResult);
void onGMEAuthCancelled();
void onRemitAuthCancelled();
}
}

10
app/src/main/java/com/swifttech/remit/android/features/security/auth/RemitTxnOTPRequestBottomSheetDialog.java

@ -24,7 +24,7 @@ import com.swifttech.remit.android.R;
import com.swifttech.remit.android.base.BaseActivity;
import com.swifttech.remit.android.base.PrefKeys;
import com.swifttech.remit.android.common.customwidgets.CustomAlertDialog;
import com.swifttech.remit.android.features.security.model.GMETxnParam;
import com.swifttech.remit.android.features.security.model.RemitTxnParam;
import com.swifttech.remit.android.utils.Constants;
import com.swifttech.remit.android.utils.https.GenericApiObserverResponseV2;
import com.swifttech.remit.android.utils.https.GenericResponseDataModel;
@ -69,12 +69,12 @@ public class RemitTxnOTPRequestBottomSheetDialog extends BottomSheetDialogFragme
private String selectedAmount;
public static RemitTxnOTPRequestBottomSheetDialog showPromptView(GMETxnParam gmeTxnParam, GMETxnOTPUserSubmitListener listener) {
public static RemitTxnOTPRequestBottomSheetDialog showPromptView(RemitTxnParam remitTxnParam, GMETxnOTPUserSubmitListener listener) {
RemitTxnOTPRequestBottomSheetDialog gmeUserPasswordPromptBottomSheetDialog = new RemitTxnOTPRequestBottomSheetDialog();
gmeUserPasswordPromptBottomSheetDialog.setSelectedAmount(gmeTxnParam.getSelectedAmount());
gmeUserPasswordPromptBottomSheetDialog.setKftcId(gmeTxnParam.getKftcId());
gmeUserPasswordPromptBottomSheetDialog.setSelectedAmount(remitTxnParam.getSelectedAmount());
gmeUserPasswordPromptBottomSheetDialog.setKftcId(remitTxnParam.getKftcId());
gmeUserPasswordPromptBottomSheetDialog.setListener(listener);
gmeUserPasswordPromptBottomSheetDialog.setCurrentCountDownValue(gmeTxnParam.getCountDownValue());
gmeUserPasswordPromptBottomSheetDialog.setCurrentCountDownValue(remitTxnParam.getCountDownValue());
return gmeUserPasswordPromptBottomSheetDialog;
}

317
app/src/main/java/com/swifttech/remit/android/features/security/auth/profilescreen/RemitUserProfileChangeOTPRequestBottomSheetDialog.java

@ -1,317 +0,0 @@
package com.swifttech.remit.android.features.security.auth.profilescreen;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.style.ForegroundColorSpan;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import com.swifttech.remit.android.RemitApplication;
import com.swifttech.remit.android.R;
import com.swifttech.remit.android.base.BaseActivity;
import com.swifttech.remit.android.base.PrefKeys;
import com.swifttech.remit.android.common.customwidgets.CustomAlertDialog;
import com.swifttech.remit.android.features.security.RemitAuthManager;
import com.swifttech.remit.android.utils.Constants;
import com.swifttech.remit.android.utils.https.GenericApiObserverResponseV2;
import com.swifttech.remit.android.utils.https.GenericResponseDataModel;
import com.swifttech.remit.android.utils.https.HttpClientV2;
import com.swifttech.remit.android.utils.https.MessageResponseDataModel;
import com.google.android.material.bottomsheet.BottomSheetBehavior;
import com.google.android.material.bottomsheet.BottomSheetDialog;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import com.google.gson.JsonObject;
import java.util.Locale;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
public class RemitUserProfileChangeOTPRequestBottomSheetDialog extends BottomSheetDialogFragment implements View.OnClickListener {
private static final String BUNDLE_TARGET_VALUE = "bundleKeyTargetValue";
private static final String BUNDLE_INITIAL_REQUEST = "bundleKeyInitiallyRequestOTP";
private static final String BUNDLE_COUNTDOWN_VAL = "bundleKeyCurrentCountDownVal";
private GMEUserProfileChangeOTPRequestListener listener;
@BindView(R.id.keypadContainer)
FrameLayout keypadContainer;
@BindView(R.id.keypadBallon)
RelativeLayout ballonView;
@BindView(R.id.title)
TextView title;
@BindView(R.id.resend_request)
TextView resendRequest;
private boolean initiallyRequestOTP;
private CountDownTimer countDownTimer;
private long currentCountDownVal;
private String targetValue;
public static Bundle constructParam(String targetValue,boolean initiallyRequestOTP,long currentCountDownVal) {
Bundle bundle = new Bundle();
bundle.putString(BUNDLE_TARGET_VALUE, targetValue);
bundle.putBoolean(BUNDLE_INITIAL_REQUEST, initiallyRequestOTP);
bundle.putLong(BUNDLE_COUNTDOWN_VAL, currentCountDownVal);
return bundle;
}
public static RemitUserProfileChangeOTPRequestBottomSheetDialog showPromptView(Bundle param, GMEUserProfileChangeOTPRequestListener listener) {
RemitUserProfileChangeOTPRequestBottomSheetDialog gmeUserPasswordPromptBottomSheetDialog = new RemitUserProfileChangeOTPRequestBottomSheetDialog();
gmeUserPasswordPromptBottomSheetDialog.setListener(listener);
gmeUserPasswordPromptBottomSheetDialog.setParam(param);
return gmeUserPasswordPromptBottomSheetDialog;
}
private void setParam(Bundle param) {
if (param != null) {
this.targetValue = param.getString(BUNDLE_TARGET_VALUE, "");
setCurrentCountDownValue(param.getLong(BUNDLE_COUNTDOWN_VAL));
setRequestOTPInitially(param.getBoolean(BUNDLE_INITIAL_REQUEST,false));
}
else
throw new IllegalArgumentException("Provide 'targetValue' as param for requesting this authentication");
}
private void setCurrentCountDownValue(long currentCountDownVal) {
if (currentCountDownVal > 0)
this.currentCountDownVal = currentCountDownVal;
else
this.currentCountDownVal = 120000;
}
private void setRequestOTPInitially(boolean intiallyRequestOTP) {
this.initiallyRequestOTP = intiallyRequestOTP;
}
private void setListener(GMEUserProfileChangeOTPRequestListener listener) {
this.listener = listener;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setStyle(STYLE_NORMAL, R.style.AppBottomSheetDialogThemeWithInset);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.gme_user_pwd_prompt_modal, container, false);
ButterKnife.bind(this, v);
init();
return v;
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
BottomSheetDialog bottomSheetDialog = (BottomSheetDialog) super.onCreateDialog(savedInstanceState);
bottomSheetDialog.setOnShowListener(dialog -> {
BottomSheetDialog dialogc = (BottomSheetDialog) dialog;
FrameLayout bottomSheet = dialogc.findViewById(com.google.android.material.R.id.design_bottom_sheet);
BottomSheetBehavior bottomSheetBehavior = BottomSheetBehavior.from(bottomSheet);
int bottomSheetHeight = Resources.getSystem().getDisplayMetrics().heightPixels;
bottomSheetBehavior.setPeekHeight(bottomSheetHeight);
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
});
performDefaultAction();
return bottomSheetDialog;
}
private void performDefaultAction() {
Log.d(RemitAuthManager.TAG, "USER PROFILE OTP SCREEN: requestOTP Initially=>" + initiallyRequestOTP);
startCountdownView(currentCountDownVal);
}
@OnClick(R.id.img_close)
public void onClose()
{
dismiss();
}
public void startCountdownView(long durationMillisecond) {
resetCountDown();
countDownTimer = new CountDownTimer(durationMillisecond, 1000) {
int redColor = ContextCompat.getColor(getActivity(), R.color.colorPrimary);
int grayColor = ContextCompat.getColor(getActivity(), R.color.darkgray2);
@Override
public void onTick(long millisUntilFinished) {
currentCountDownVal = millisUntilFinished;
int seconds = (int) (millisUntilFinished / 1000);
int hours = seconds / (60 * 60);
int tempMint = (seconds - (hours * 60 * 60));
int minutes = tempMint / 60;
seconds = tempMint - (minutes * 60);
String timeRemaining = String.format(Locale.US, "%02d", minutes)
+ ":" + String.format(Locale.US, "%02d", seconds);
Spannable tryInText = new SpannableString(getString(R.string.resend_code_text));
tryInText.setSpan(new ForegroundColorSpan(grayColor), 0, tryInText.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
resendRequest.setText(tryInText);
Spannable timeText = new SpannableString(" " + timeRemaining);
timeText.setSpan(new ForegroundColorSpan(redColor), 0, timeText.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
resendRequest.append(timeText);
}
@Override
public void onFinish() {
showResendRequestView(true);
currentCountDownVal = -1;
}
};
countDownTimer.start();
}
private void resetCountDown() {
if (countDownTimer != null)
countDownTimer.cancel();
}
@Override
public void onDismiss(@NonNull DialogInterface dialog) {
if (countDownTimer != null)
countDownTimer.cancel();
super.onDismiss(dialog);
}
public void showResendRequestView(boolean action) {
if (resendRequest.getVisibility() != View.VISIBLE)
resendRequest.setVisibility(View.VISIBLE);
if (action) {
if (countDownTimer != null)
countDownTimer.cancel();
currentCountDownVal = -1;
resendRequest.setText(getString(R.string.resend_request_text));
resendRequest.setOnClickListener(this);
} else {
resendRequest.setText("");
resendRequest.setOnClickListener(null);
}
}
private void init() {
resendRequest.setVisibility(View.VISIBLE);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.resend_request:
resendOTPRequest();
break;
}
}
private void resendOTPRequest() {
SharedPreferences sharedPreferences = RemitApplication.getStorage();
String auth = "Bearer " + sharedPreferences.getString(PrefKeys.USER_ACCESS_CODE, "");
String senderId = sharedPreferences.getString(PrefKeys.USER_ID_NUMBER, "");
JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("userId", senderId);
jsonObject.addProperty("tempValue", targetValue);
HttpClientV2.getInstance().profileOTPResend(auth, jsonObject)
.doOnSubscribe(subs -> showProgressBar(true))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.doFinally(() -> showProgressBar(false))
.subscribe(new OTPResendObserver());
}
private void showPopUpMessage(String message, CustomAlertDialog.AlertType alertType, CustomAlertDialog.CustomDialogActionListener listener) {
((BaseActivity) getActivity()).showPopUpMessage(message, alertType, listener);
}
private void showProgressBar(boolean action) {
((BaseActivity) getActivity()).showProgressBar(action, "");
}
public class OTPResendObserver extends GenericApiObserverResponseV2<MessageResponseDataModel> {
@Override
protected void onSuccess(GenericResponseDataModel<MessageResponseDataModel> t) {
if (t.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) {
showPopUpMessage(getString(R.string.new_otp_number_has_sent_text), CustomAlertDialog.AlertType.SUCCESS, alertType -> {
});
} else {
showPopUpMessage(t.getMsg(), CustomAlertDialog.AlertType.FAILED, alertType -> {
});
}
}
@Override
public void onFailed(String message) {
showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, alertType -> {
});
}
@Override
protected void onConnectionNotEstablished(String message) {
showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, alertType -> {
});
}
@Override
protected void unauthorizedAccess(String message) {
showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, alertType -> {
dismiss();
});
}
}
public interface GMEUserProfileChangeOTPRequestListener {
void onOTPSubmittedSucessfully(String secret);
void onOTPRequestFailed();
}
}

42
app/src/main/java/com/swifttech/remit/android/features/security/model/GMEScreenBasedParam.java

@ -1,42 +0,0 @@
package com.swifttech.remit.android.features.security.model;
import android.os.Bundle;
import com.swifttech.remit.android.features.security.auth.profilescreen.RemitUserProfileChangeOTPRequestBottomSheetDialog;
public class GMEScreenBasedParam
{
private GMEScreenBasedAuthType gmeScreenBasedAuthType;
private Bundle param;
private GMEScreenBasedParam(GMEScreenBasedAuthType gmeScreenBasedAuthType, Bundle param) {
this.gmeScreenBasedAuthType = gmeScreenBasedAuthType;
this.param = param;
}
public GMEScreenBasedAuthType getGmeScreenBasedAuthType() {
return gmeScreenBasedAuthType;
}
public Bundle getParam() {
return param;
}
public static GMEScreenBasedParam forPasswordUserProfile()
{
return new GMEScreenBasedParam(GMEScreenBasedAuthType.PASSWORD_USER_PROFILE,null);
}
public static GMEScreenBasedParam forOTPRequestUserProfile(String targetValue, long countdownValue)
{
return new GMEScreenBasedParam(GMEScreenBasedAuthType.OTP_REQUEST_PROFILE, RemitUserProfileChangeOTPRequestBottomSheetDialog.constructParam(targetValue,true,countdownValue));
}
public static GMEScreenBasedParam forOTPSubmitUserProfile(String targetValue, long countdownValue)
{
return new GMEScreenBasedParam(GMEScreenBasedAuthType.OTP_REQUEST_PROFILE, RemitUserProfileChangeOTPRequestBottomSheetDialog.constructParam(targetValue,false,countdownValue));
}
public enum GMEScreenBasedAuthType {
PASSWORD_USER_PROFILE, OTP_REQUEST_PROFILE, OTP_SUBMIT_PROFILE
}
}

6
app/src/main/java/com/swifttech/remit/android/features/security/model/GMEAuthFailedResult.java → app/src/main/java/com/swifttech/remit/android/features/security/model/RemitAuthFailedResult.java

@ -1,16 +1,16 @@
package com.swifttech.remit.android.features.security.model;
public class GMEAuthFailedResult {
public class RemitAuthFailedResult {
private String failedReason;
private boolean isRecoverable;
public GMEAuthFailedResult(String failedReason) {
public RemitAuthFailedResult(String failedReason) {
this.failedReason = failedReason;
isRecoverable=false;
}
public GMEAuthFailedResult(String failedReason,boolean isRecoverable) {
public RemitAuthFailedResult(String failedReason, boolean isRecoverable) {
this.failedReason = failedReason;
this.isRecoverable=isRecoverable;
}

6
app/src/main/java/com/swifttech/remit/android/features/security/model/GMEAuthSuccessResult.java → app/src/main/java/com/swifttech/remit/android/features/security/model/RemitAuthSuccessResult.java

@ -1,17 +1,17 @@
package com.swifttech.remit.android.features.security.model;
public class GMEAuthSuccessResult {
public class RemitAuthSuccessResult {
private String result;
private boolean isBiometricUsed;
public GMEAuthSuccessResult(String result)
public RemitAuthSuccessResult(String result)
{
this.result=result;
this.isBiometricUsed=false;
}
public GMEAuthSuccessResult(String result, boolean isBiometricUsed)
public RemitAuthSuccessResult(String result, boolean isBiometricUsed)
{
this.result=result;
this.isBiometricUsed=isBiometricUsed;

4
app/src/main/java/com/swifttech/remit/android/features/security/model/GMEBiometricEncryptionDTO.java → app/src/main/java/com/swifttech/remit/android/features/security/model/RemitBiometricEncryptionDTO.java

@ -1,12 +1,12 @@
package com.swifttech.remit.android.features.security.model;
public class GMEBiometricEncryptionDTO {
public class RemitBiometricEncryptionDTO {
String userId;
String encPwd;
String encKey;
public GMEBiometricEncryptionDTO(String userId, String encPwd, String encKey) {
public RemitBiometricEncryptionDTO(String userId, String encPwd, String encKey) {
this.userId = userId;
this.encPwd = encPwd;
this.encKey = encKey;

24
app/src/main/java/com/swifttech/remit/android/features/security/model/GMETxnParam.java → app/src/main/java/com/swifttech/remit/android/features/security/model/RemitTxnParam.java

@ -1,6 +1,6 @@
package com.swifttech.remit.android.features.security.model;
public class GMETxnParam
public class RemitTxnParam
{
private String paymentSource;
private String selectedAmount;
@ -9,7 +9,7 @@ public class GMETxnParam
private GMETxnAuthType gmeTxnAuthType;
private boolean enableFallbackOption;
public GMETxnParam(String paymentSource, String selectedAmount, String kftcId) {
public RemitTxnParam(String paymentSource, String selectedAmount, String kftcId) {
this.paymentSource=paymentSource;
this.selectedAmount = selectedAmount;
this.kftcId = kftcId;
@ -17,13 +17,13 @@ public class GMETxnParam
this.enableFallbackOption=false;
}
public GMETxnParam withCountdownTimer(long countDownValue)
public RemitTxnParam withCountdownTimer(long countDownValue)
{
this.countDownValue=countDownValue;
return this;
}
public GMETxnParam enableFallbackAuth()
public RemitTxnParam enableFallbackAuth()
{
this.enableFallbackOption=true;
return this;
@ -34,18 +34,18 @@ public class GMETxnParam
return this.enableFallbackOption;
}
public static GMETxnParam forBiometricAuth()
public static RemitTxnParam forBiometricAuth()
{
GMETxnParam gmeTxnParam=new GMETxnParam(null,null,null);
gmeTxnParam.setGmeTxnAuthType(GMETxnAuthType.BIOMETRIC);
return gmeTxnParam;
RemitTxnParam remitTxnParam =new RemitTxnParam(null,null,null);
remitTxnParam.setGmeTxnAuthType(GMETxnAuthType.BIOMETRIC);
return remitTxnParam;
}
public static GMETxnParam forPasswordAuth()
public static RemitTxnParam forPasswordAuth()
{
GMETxnParam gmeTxnParam=new GMETxnParam(null,null,null);
gmeTxnParam.setGmeTxnAuthType(GMETxnAuthType.PASSWORD);
return gmeTxnParam;
RemitTxnParam remitTxnParam =new RemitTxnParam(null,null,null);
remitTxnParam.setGmeTxnAuthType(GMETxnAuthType.PASSWORD);
return remitTxnParam;
}
public String getSelectedAmount() {

36
app/src/main/java/com/swifttech/remit/android/features/sendmoney/presenter/SendMoneyV2Presenter.java

@ -4,6 +4,7 @@ import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import com.swifttech.remit.android.R;
import com.swifttech.remit.android.features.security.model.RemitTxnParam;
import com.swifttech.remit.android.features.webbrowser.model.WebRequestModel;
import com.swifttech.remit.android.base.BaseViewModel;
import com.swifttech.remit.android.common.customwidgets.CustomAlertDialog;
@ -12,9 +13,8 @@ import com.swifttech.remit.android.features.exrate.model.datav2.ExchangeCalculat
import com.swifttech.remit.android.features.home.model.UserInfoModelV2;
import com.swifttech.remit.android.features.recipientmanagement.model.recipientlistingV3.ReceiverInfoV3Model;
import com.swifttech.remit.android.features.security.RemitAuthManager;
import com.swifttech.remit.android.features.security.model.GMEAuthFailedResult;
import com.swifttech.remit.android.features.security.model.GMEAuthSuccessResult;
import com.swifttech.remit.android.features.security.model.GMETxnParam;
import com.swifttech.remit.android.features.security.model.RemitAuthFailedResult;
import com.swifttech.remit.android.features.security.model.RemitAuthSuccessResult;
import com.swifttech.remit.android.features.sendmoney.model.SendMoneyAPIRequestBody;
import com.swifttech.remit.android.features.sendmoney.model.SendMoneyRequiredDataV3;
import com.swifttech.remit.android.features.sendmoney.model.SendMoneyTransactionResponseBody;
@ -72,12 +72,6 @@ public class SendMoneyV2Presenter extends BaseViewModel implements SendMoneyV2Pr
}
@Override
public Observable<BranchListApiResponse> getBranchListFromNetwork(BankList selectedBank, String searchKeyword) {
String countryCode = "";
@ -138,27 +132,25 @@ public class SendMoneyV2Presenter extends BaseViewModel implements SendMoneyV2Pr
@Override
public void promptPinAndPerformTransaction() {
// performSendMoneyTransaction("7697882",false);
RemitAuthManager.getGmeAuthManager(view.getContext()).fromPaymentSource(
new GMETxnParam(
new RemitTxnParam(
getPaymentType(),
getTransactionAmount(),
getKftcId()
).enableFallbackAuth()
).setListener(new RemitAuthManager.GMEAuthListener() {
).setListener(new RemitAuthManager.RemitAuthListener() {
@Override
public void onGMEAuthSuccess(GMEAuthSuccessResult result) {
public void onRemitAuthSuccess(RemitAuthSuccessResult result) {
performSendMoneyTransaction(result.getResult(), result.isBiometricUsed());
}
@Override
public void onGMEAuthFailed(GMEAuthFailedResult failedResult) {
public void onRemitAuthFailed(RemitAuthFailedResult failedResult) {
view.showToastMessage(failedResult.getFailedReason());
}
@Override
public void onGMEAuthCancelled() {
public void onRemitAuthCancelled() {
}
}).prompt();
@ -179,12 +171,9 @@ public class SendMoneyV2Presenter extends BaseViewModel implements SendMoneyV2Pr
@Override
public String getPaymentType() {
return "wallet";
}
@Override
public String getKftcId() {
return "";
@ -196,17 +185,8 @@ public class SendMoneyV2Presenter extends BaseViewModel implements SendMoneyV2Pr
}
private String calculatedDiscountedServiceFee() {
return selectedTransferFee;
}

12
app/src/main/java/com/swifttech/remit/android/features/settings/view/FingerprintEnablePromptActivity.java

@ -16,8 +16,8 @@ import com.swifttech.remit.android.base.BaseActivity;
import com.swifttech.remit.android.base.PrefKeys;
import com.swifttech.remit.android.common.customwidgets.CustomAlertDialog;
import com.swifttech.remit.android.features.security.RemitAuthManager;
import com.swifttech.remit.android.features.security.model.GMEAuthFailedResult;
import com.swifttech.remit.android.features.security.model.GMEAuthSuccessResult;
import com.swifttech.remit.android.features.security.model.RemitAuthFailedResult;
import com.swifttech.remit.android.features.security.model.RemitAuthSuccessResult;
import butterknife.BindView;
import butterknife.ButterKnife;
@ -95,23 +95,23 @@ public class FingerprintEnablePromptActivity extends BaseActivity implements Vie
private void showFingerprintAuthDialog() {
if (remitAuthManager.isBiometricDataAvailable()) {
remitAuthManager.requestBiometricAuth().setListener(new RemitAuthManager.GMEAuthListener() {
remitAuthManager.requestBiometricAuth().setListener(new RemitAuthManager.RemitAuthListener() {
@Override
public void onGMEAuthSuccess(GMEAuthSuccessResult result) {
public void onRemitAuthSuccess(RemitAuthSuccessResult result) {
remitAuthManager.turnOfBiometric(false);
showToastMessage(getString(R.string.fingerprint_auth_enabled_text));
finish();
}
@Override
public void onGMEAuthFailed(GMEAuthFailedResult failedResult) {
public void onRemitAuthFailed(RemitAuthFailedResult failedResult) {
showToastMessage(failedResult.getFailedReason());
finish();
}
@Override
public void onGMEAuthCancelled() {
public void onRemitAuthCancelled() {
}
}).prompt();

16
app/src/main/java/com/swifttech/remit/android/features/settings/view/SettingsView.java

@ -14,8 +14,8 @@ import com.swifttech.remit.android.base.BaseActivity;
import com.swifttech.remit.android.features.changepassword.view.UserPasswordChangeV2Activity;
import com.swifttech.remit.android.common.customwidgets.CustomAlertDialog;
import com.swifttech.remit.android.features.security.RemitAuthManager;
import com.swifttech.remit.android.features.security.model.GMEAuthFailedResult;
import com.swifttech.remit.android.features.security.model.GMEAuthSuccessResult;
import com.swifttech.remit.android.features.security.model.RemitAuthFailedResult;
import com.swifttech.remit.android.features.security.model.RemitAuthSuccessResult;
import com.swifttech.remit.android.features.settings.adapter.LanguageSelectionDialogRVAdapter;
import com.swifttech.remit.android.features.settings.gateway.LanguageSelectionGateway;
import com.swifttech.remit.android.features.settings.gateway.LanguageSelectionGatewayInterface;
@ -26,9 +26,7 @@ import butterknife.ButterKnife;
import butterknife.OnClick;
import io.reactivex.disposables.Disposable;
//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;
/**
* Created by FMI-LT-17 on 2/20/2018.
@ -143,9 +141,9 @@ public class SettingsView extends BaseActivity implements CompoundButton.OnCheck
if (remitAuthManager.isBiometricDataAvailable()) {
remitAuthManager.requestBiometricAuth().setListener(new RemitAuthManager.GMEAuthListener() {
remitAuthManager.requestBiometricAuth().setListener(new RemitAuthManager.RemitAuthListener() {
@Override
public void onGMEAuthSuccess(GMEAuthSuccessResult result) {
public void onRemitAuthSuccess(RemitAuthSuccessResult result) {
remitAuthManager.turnOfBiometric(!isChecked);
view_fingerprint.setOnCheckedChangeListener(null);
view_fingerprint.setChecked(isChecked);
@ -153,13 +151,13 @@ public class SettingsView extends BaseActivity implements CompoundButton.OnCheck
}
@Override
public void onGMEAuthFailed(GMEAuthFailedResult failedResult) {
public void onRemitAuthFailed(RemitAuthFailedResult failedResult) {
showToastMessage(failedResult.getFailedReason());
}
@Override
public void onGMEAuthCancelled() {
public void onRemitAuthCancelled() {
}
}).prompt();

32
app/src/main/java/com/swifttech/remit/android/features/splashscreen/gateway/SplashScreenGateway.java

@ -56,37 +56,6 @@ public class SplashScreenGateway extends PrivilegedGateway implements SplashScre
@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());
}
@ -99,7 +68,6 @@ public class SplashScreenGateway extends PrivilegedGateway implements SplashScre
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"));

2
app/src/main/java/com/swifttech/remit/android/features/termsandcondition/view/TermsAndConditionAcitivity.java

@ -96,7 +96,7 @@ public class TermsAndConditionAcitivity extends BaseActivity implements WebBrow
@OnClick(R.id.iv_support)
public void onCsSupportPressed() {
CustomerSupportFragment newFragment = CustomerSupportFragment.newInstance("",true);
CustomerSupportFragment newFragment = CustomerSupportFragment.newInstance();
newFragment.show(getSupportFragmentManager(), "dialog");
}

8
app/src/main/java/com/swifttech/remit/android/features/webbrowser/WebBrowserFragmentV2.java

@ -47,7 +47,7 @@ public abstract class WebBrowserFragmentV2 extends BaseFragment {
private GMEWebViewClient gmeWebViewClient;
private GMEChromeClient gmeChromeClient;
private RemitChromeClient remitChromeClient;
private WebRequestModel webRequestModel;
private ValueCallback<Uri[]> mFilePathCallback;
@ -91,9 +91,9 @@ public abstract class WebBrowserFragmentV2 extends BaseFragment {
private void setupWebView() {
gmeWebViewClient = new GMEWebViewClient();
gmeChromeClient = new GMEChromeClient();
remitChromeClient = new RemitChromeClient();
webView.setWebViewClient(gmeWebViewClient);
webView.setWebChromeClient(gmeChromeClient);
webView.setWebChromeClient(remitChromeClient);
webView.getSettings().setSaveFormData(false);
webView.clearCache(true);
@ -269,7 +269,7 @@ public abstract class WebBrowserFragmentV2 extends BaseFragment {
}
private class GMEChromeClient extends WebChromeClient {
private class RemitChromeClient extends WebChromeClient {
@Override
public void onReceivedTitle(WebView view, String title) {

8
app/src/main/java/com/swifttech/remit/android/features/webbrowser/WebBrowserV2Activity.java

@ -51,7 +51,7 @@ public abstract class WebBrowserV2Activity extends BaseActivity implements View
@BindView(R.id.progressBar)
ProgressBar progressBar;
private GMEWebViewClient gmeWebViewClient;
private GMEChromeClient gmeChromeClient;
private RemitChromeClient remitChromeClient;
public static String WEB_BROWSWER_URL_BUNDLE_KEY="webBrowserBundleKey";
private WebRequestModel webRequestModel;
@ -192,9 +192,9 @@ public abstract class WebBrowserV2Activity extends BaseActivity implements View
// settings.setUserAgentString(sb.toString());
private void setupWebView() {
gmeWebViewClient = new GMEWebViewClient();
gmeChromeClient = new GMEChromeClient();
remitChromeClient = new RemitChromeClient();
webView.setWebViewClient(gmeWebViewClient);
webView.setWebChromeClient(gmeChromeClient);
webView.setWebChromeClient(remitChromeClient);
webView.getSettings().setSaveFormData(false);
webView.clearCache(true);
@ -392,7 +392,7 @@ public abstract class WebBrowserV2Activity extends BaseActivity implements View
}
}
private class GMEChromeClient extends WebChromeClient {
private class RemitChromeClient extends WebChromeClient {
@Override
public void onReceivedTitle(WebView view, String title) {
if (webView.getVisibility() == View.VISIBLE)

81
app/src/main/res/layout/fragment_customer_support.xml

@ -3,22 +3,18 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#CC000622"
android:layout_height="wrap_content"
android:background="@null"
android:orientation="vertical"
android:paddingBottom="8dp"
android:paddingLeft="10dp"
android:paddingRight="10dp">
>
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ic_rectangle_dim_white_corners"
android:background="#D9D9DE"
android:orientation="vertical"
android:paddingTop="18dp">
@ -30,7 +26,7 @@
android:gravity="center"
android:text="@string/help_you_text"
android:textColor="@color/dark_gray"
android:textSize="12sp"
android:textSize="@dimen/_11ssp"
app:fontFamily="@string/regular" />
<View
@ -62,7 +58,7 @@
android:text="Facebook"
android:textColor="@color/cs_red"
android:textSize="20sp" />
android:textSize="@dimen/_16ssp" />
</LinearLayout>
<View
@ -70,65 +66,6 @@
android:layout_height="1dp"
android:background="@color/divider" />
<LinearLayout
android:id="@+id/chatView"
android:layout_width="match_parent"
android:layout_height="56dp"
android:orientation="horizontal"
android:paddingLeft="30dp"
android:paddingRight="30dp"
android:visibility="visible">
<ImageView
android:layout_width="@dimen/_20sdp"
android:layout_height="@dimen/_20sdp"
android:layout_gravity="center"
app:srcCompat="@drawable/ic_chat" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.swifttech.remit.android.common.customwidgets.GmeTextView
android:id="@+id/notificationCounterTxtView"
android:layout_width="@dimen/_15sdp"
android:layout_height="@dimen/_15sdp"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_gravity="center"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:background="@drawable/circular_red_bg"
android:gravity="center"
android:textColor="@color/white"
android:textSize="@dimen/_7ssp"
android:visibility="invisible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.7"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="2" />
<com.swifttech.remit.android.common.customwidgets.GmeTextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:gravity="center"
android:text="@string/live_chat_text"
android:textColor="@color/cs_red"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
<View
android:visibility="visible"
android:layout_width="match_parent"
@ -155,7 +92,7 @@
android:layout_height="match_parent"
android:gravity="center"
android:textColor="@color/cs_red"
android:textSize="20sp" />
android:textSize="@dimen/_16ssp" />
</LinearLayout>
@ -172,6 +109,6 @@
android:paddingTop="16dp"
android:text="@string/cancel_text"
android:textColor="@color/cs_red"
android:textSize="20sp" />
android:textSize="@dimen/_16ssp" />
</LinearLayout>
Loading…
Cancel
Save