Browse Source

New auth integrated on all modules

master
Preyea Regmi 4 years ago
parent
commit
99f2744e3d
  1. BIN
      .idea/caches/build_file_checksums.ser
  2. 1
      app/build.gradle
  3. 138
      app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/passwordpromptdialog/PasswordPromptDialog.java
  4. 7
      app/src/main/java/com/gmeremit/online/gmeremittance_native/domesticremit/send/presenter/DomesticRemitPresenterImpl.java
  5. 6
      app/src/main/java/com/gmeremit/online/gmeremittance_native/domesticremit/send/presenter/DomesticRemitPresenterInterface.java
  6. 51
      app/src/main/java/com/gmeremit/online/gmeremittance_native/domesticremit/send/view/DomesticRemitActivity.java
  7. 41
      app/src/main/java/com/gmeremit/online/gmeremittance_native/loginV2/view/LoginV2Activity.java
  8. 39
      app/src/main/java/com/gmeremit/online/gmeremittance_native/resendV2/presenter/resend/ReSendMoneyV2Presenter.java
  9. 4
      app/src/main/java/com/gmeremit/online/gmeremittance_native/resendV2/presenter/resend/ReSendMoneyV2PresenterInterface.java
  10. 56
      app/src/main/java/com/gmeremit/online/gmeremittance_native/resendV2/view/ReSendMoneyV2Activity.java
  11. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/security/auth/GMEUserPasswordPromptBottomSheetDialog.java
  12. 9
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/presenter/SendMoneyV2PresenterInterface.java
  13. 63
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/view/SendMoneyV2Activity.java
  14. 73
      app/src/main/java/com/gmeremit/online/gmeremittance_native/topup/local/presenter/topup/LocalTopUpPresenter.java
  15. 7
      app/src/main/java/com/gmeremit/online/gmeremittance_native/topup/local/presenter/topup/LocalTopUpPresenterInterface.java
  16. 66
      app/src/main/java/com/gmeremit/online/gmeremittance_native/topup/local/view/topup/LocalTopUpActivity.java
  17. 6
      app/src/main/java/com/gmeremit/online/gmeremittance_native/transactionpasspromt/PasswordPromptListener.java
  18. 29
      app/src/main/java/com/gmeremit/online/gmeremittance_native/transactionpasspromt/gateway/TransactionPasswordPromptV2Gateway.java
  19. 16
      app/src/main/java/com/gmeremit/online/gmeremittance_native/transactionpasspromt/presenter/TransactionPasswordPromptV2InteractorInterface.java
  20. 273
      app/src/main/java/com/gmeremit/online/gmeremittance_native/transactionpasspromt/presenter/TransactionPasswordPromptV2Presenter.java
  21. 46
      app/src/main/java/com/gmeremit/online/gmeremittance_native/transactionpasspromt/presenter/TransactionPasswordPromptV2PresenterInterface.java
  22. 240
      app/src/main/java/com/gmeremit/online/gmeremittance_native/transactionpasspromt/view/TransactionBiometricPromptDialog.java
  23. 453
      app/src/main/java/com/gmeremit/online/gmeremittance_native/transactionpasspromt/view/TransactionPasswordPromptActivity.java
  24. 22
      app/src/main/res/layout/activity_domestic_remit.xml
  25. 19
      app/src/main/res/layout/activity_login_v2.xml
  26. 26
      app/src/main/res/values/styles.xml

BIN
.idea/caches/build_file_checksums.ser

1
app/build.gradle

@ -160,6 +160,7 @@ dependencies {
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.github.tbruyelle:rxpermissions:0.10.2'
implementation 'joda-time:joda-time:2.10.6'
implementation 'com.facebook.shimmer:shimmer:0.1.0@aar'
testImplementation 'junit:junit:4.12'

138
app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/passwordpromptdialog/PasswordPromptDialog.java

@ -1,138 +0,0 @@
package com.gmeremit.online.gmeremittance_native.customwidgets.passwordpromptdialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import androidx.appcompat.app.AlertDialog;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.TextView;
import androidx.fragment.app.DialogFragment;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.transactionpasspromt.PasswordPromptListener;
public class PasswordPromptDialog extends DialogFragment implements View.OnClickListener {
private EditText passwordEditText;
private TextView okButton,cancelButton;
private PasswordPromptListener listener;
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
View view = getActivity().getLayoutInflater().inflate(R.layout.dialog_password_prompt, null);
passwordEditText = view.findViewById(R.id.login_password);
cancelButton = view.findViewById(R.id.btn_cancel);
okButton=view.findViewById(R.id.btn_ok);
builder.setView(view);
initialize();
Dialog d= builder.create();
d.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
return d;
}
private void initialize() {
cancelButton.setOnClickListener(this);
setCancelable(false);
okButton.setOnClickListener(this);
}
public void setListener(PasswordPromptListener listener) {
this.listener = listener;
}
@Override
public void onStart() {
super.onStart();
Window window = getDialog().getWindow();
if (window != null) {
// window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
window.setBackgroundDrawableResource(R.drawable.ic_rounded_white_bg_with_inset);
}
}
@Override
public void onResume() {
super.onResume();
// showKeyBoard(passwordEditText);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn_cancel:
hideKeyboard();
dismiss();
if(listener!=null)
listener.onCancelled();
break;
case R.id.btn_ok:
hideKeyboard();
dismiss();
if(listener!=null)
listener.onPasswordSubmit(passwordEditText.getText().toString());
break;
}
}
@Override
public void onDismiss(DialogInterface dialog) {
super.onDismiss(dialog);
cancelButton.setOnClickListener(null);
}
public void hideKeyboard() {
// Check if no view has focus:
try {
View view = getActivity().getCurrentFocus();
InputMethodManager inputManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
inputManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
}
catch(Exception ex)
{
}
}
@SuppressWarnings("HardCodedStringLiteral")
public void showKeyBoard(View view) {
try {
InputMethodManager imm = (InputMethodManager) view.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
Log.d("GMEEXCEPTION", "Keyboard shown");
} catch (NullPointerException e) {
Log.d("GMEEXCEPTION", "Null pointer while showing keyboard");
}
}
}

7
app/src/main/java/com/gmeremit/online/gmeremittance_native/domesticremit/send/presenter/DomesticRemitPresenterImpl.java

@ -25,8 +25,7 @@ import com.gmeremit.online.gmeremittance_native.security.GMEAuthManager;
import com.gmeremit.online.gmeremittance_native.security.model.GMEAuthFailedResult;
import com.gmeremit.online.gmeremittance_native.security.model.GMEAuthSuccessResult;
import com.gmeremit.online.gmeremittance_native.security.model.GMETxnParam;
import com.gmeremit.online.gmeremittance_native.transactionpasspromt.PasswordPromptListener;
import com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionBiometricPromptDialog;
import com.gmeremit.online.gmeremittance_native.utils.Constants;
import com.gmeremit.online.gmeremittance_native.utils.Utils;
import com.gmeremit.online.gmeremittance_native.utils.https.GenericApiObserverResponseV2;
@ -187,9 +186,7 @@ public class DomesticRemitPresenterImpl extends BasePresenter implements Domesti
}
private boolean checkIfUserHasEnabledBiometricAuth() {
return SecurityUtils.checkFingerPrintUsablity(view.getContext()) && gateway.isFingerPrintAuthEnabled() && gateway.getPersistedUserId() != null && gateway.getPersistedUserPwd() != null;
}
@Override
public List<DomesticBankDTO> getAvailableRecipientBankList() {

6
app/src/main/java/com/gmeremit/online/gmeremittance_native/domesticremit/send/presenter/DomesticRemitPresenterInterface.java

@ -3,13 +3,10 @@ package com.gmeremit.online.gmeremittance_native.domesticremit.send.presenter;
import com.gmeremit.online.gmeremittance_native.accountmanage.model.paymentsources.PaymentSourceDTO;
import com.gmeremit.online.gmeremittance_native.base.BaseContractInterface;
import com.gmeremit.online.gmeremittance_native.base.BasePresenterInterface;
import com.gmeremit.online.gmeremittance_native.customwidgets.common.GenericPromptDialog;
import com.gmeremit.online.gmeremittance_native.domesticremit.recenthistory.model.DomesticReciepientHistoryDetailDTO;
import com.gmeremit.online.gmeremittance_native.domesticremit.send.model.DomesticAccountsDTO;
import com.gmeremit.online.gmeremittance_native.domesticremit.send.model.DomesticBankDTO;
import com.gmeremit.online.gmeremittance_native.domesticremit.send.view.RecipientConfirmDialog;
import com.gmeremit.online.gmeremittance_native.transactionpasspromt.PasswordPromptListener;
import com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionBiometricPromptDialog;
import java.util.List;
@ -53,9 +50,6 @@ public interface DomesticRemitPresenterInterface extends BasePresenterInterface
void updatePaymentSourceList(List<PaymentSourceDTO> paymentSourceDTOList);
void promptPassword(PasswordPromptListener listener, long countDownValue,String selectedAccountKFTCId,String sendingAmount,String type);
void promptBiometricAuthDialog(TransactionBiometricPromptDialog.BiometricPromptResultListener listener);
void showViewDependentOnSenderBankAndAmount(boolean action);

51
app/src/main/java/com/gmeremit/online/gmeremittance_native/domesticremit/send/view/DomesticRemitActivity.java

@ -3,10 +3,6 @@ package com.gmeremit.online.gmeremittance_native.domesticremit.send.view;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
import androidx.transition.ChangeTransform;
import androidx.transition.TransitionManager;
import android.text.Editable;
import android.text.InputFilter;
import android.text.InputType;
@ -19,6 +15,11 @@ import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
import androidx.transition.ChangeTransform;
import androidx.transition.TransitionManager;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.accountmanage.adapter.paymentsources.PaymentSourceListAdapter;
import com.gmeremit.online.gmeremittance_native.accountmanage.gateway.paymentsources.PaymentSourceSelectionGateway;
@ -37,9 +38,6 @@ import com.gmeremit.online.gmeremittance_native.domesticremit.send.model.Domesti
import com.gmeremit.online.gmeremittance_native.domesticremit.send.model.DomesticBankDTO;
import com.gmeremit.online.gmeremittance_native.domesticremit.send.presenter.DomesticRemitPresenterImpl;
import com.gmeremit.online.gmeremittance_native.domesticremit.send.presenter.DomesticRemitPresenterInterface;
import com.gmeremit.online.gmeremittance_native.transactionpasspromt.PasswordPromptListener;
import com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionBiometricPromptDialog;
import com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionPasswordPromptActivity;
import java.util.List;
@ -50,11 +48,6 @@ import static android.view.View.GONE;
import static com.gmeremit.online.gmeremittance_native.domesticremit.receipt.view.DomesticRemitReceiptActivity.DOMESTIC_TXN_ID_BUNDLE_KEY;
import static com.gmeremit.online.gmeremittance_native.domesticremit.receipt.view.DomesticRemitReceiptActivity.REQUEST_FROM_DOMESTIC_REMIT_PROCESS;
import static com.gmeremit.online.gmeremittance_native.domesticremit.recenthistory.view.DomesticRemitRecipientHistoryActivity.SELECT_DOMESTIC_TXN_FROM_HISTORY_REQUEST;
import static com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionPasswordPromptActivity.OTP_COUNTDOWN_VALUE;
import static com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionPasswordPromptActivity.PAYMENT_TYPE_BUNDLE_KEY;
import static com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionPasswordPromptActivity.SELECTED_AMT_FOR_OTP_BUNDLE_KEY;
import static com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionPasswordPromptActivity.SELECTED_KFTC_ID_FOR_OTP_BUNDLE_KEY;
import static com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionPasswordPromptActivity.TRANSACTION_PWD_ENC_DATA;
public class DomesticRemitActivity extends BaseActivity implements DomesticRemitPresenterInterface.DomesticRemitContractInterface, View.OnClickListener, PaymentSourceListAdapter.PaymentSourceSelectionListener {
@ -146,7 +139,6 @@ public class DomesticRemitActivity extends BaseActivity implements DomesticRemit
private DomesticRemitPresenterInterface presenter;
private BankWithIconListingDialog<DomesticBankDTO> recipientBankListingDialog;
private GenericTextListingDialog<DomesticAccountsDTO> senderAccountListingDialog;
private PasswordPromptListener passwordPromptListener;
@Override
@ -316,25 +308,8 @@ public class DomesticRemitActivity extends BaseActivity implements DomesticRemit
paymentSourceListAdapter.setCurrentSelectableItem(0);
}
@Override
public void promptPassword(PasswordPromptListener listener, long countDownValue,String selectedAccountKFTCId,String sendingAmount,String type) {
// this.passwordPromptListener = listener;
// Intent passwordRequestIntent = new Intent(this, TransactionPasswordPromptActivity.class);
// passwordRequestIntent.putExtra(PAYMENT_TYPE_BUNDLE_KEY, type);
// passwordRequestIntent.putExtra(SELECTED_AMT_FOR_OTP_BUNDLE_KEY, sendingAmount);
// passwordRequestIntent.putExtra(SELECTED_KFTC_ID_FOR_OTP_BUNDLE_KEY, selectedAccountKFTCId);
// passwordRequestIntent.putExtra(OTP_COUNTDOWN_VALUE, countDownValue);
// startActivityForResult(passwordRequestIntent, PASSWORD_PROMPT_REQUEST);
}
@Override
public void promptBiometricAuthDialog(TransactionBiometricPromptDialog.BiometricPromptResultListener listener) {
// TransactionBiometricPromptDialog promptDialog= new TransactionBiometricPromptDialog();
// promptDialog.setResultListener(listener);
// promptDialog.show(getSupportFragmentManager(),promptDialog.getClass().getSimpleName());
}
@Override
@ -343,21 +318,7 @@ public class DomesticRemitActivity extends BaseActivity implements DomesticRemit
if (requestCode == SELECT_DOMESTIC_TXN_FROM_HISTORY_REQUEST && resultCode == Activity.RESULT_OK && data != null) {
presenter.onRecipientSelectedFromHistory(data.getParcelableExtra(DomesticRemitRecipientHistoryActivity.SELECTED_DOMESTIC_TXN_BUNDLE_KEY));
}
else if (requestCode == PASSWORD_PROMPT_REQUEST) {
if (resultCode == Activity.RESULT_OK&&data!=null) {
String encData = data.getStringExtra(TRANSACTION_PWD_ENC_DATA);
presenter.updateRemainingCountDownValue(-1);
if (this.passwordPromptListener != null)
passwordPromptListener.onPasswordSubmit(encData);
this.passwordPromptListener = null;
} else if (resultCode == Activity.RESULT_CANCELED && data != null) {
presenter.updateRemainingCountDownValue(data.getLongExtra(OTP_COUNTDOWN_VALUE, -1));
}
else if(resultCode == Activity.RESULT_CANCELED)
{
presenter.updateRemainingCountDownValue(-1);
}
}
}
@Override

41
app/src/main/java/com/gmeremit/online/gmeremittance_native/loginV2/view/LoginV2Activity.java

@ -16,6 +16,7 @@ import androidx.vectordrawable.graphics.drawable.AnimatedVectorDrawableCompat;
import androidx.core.content.ContextCompat;
import androidx.core.view.ViewCompat;
import androidx.appcompat.app.AppCompatDelegate;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
@ -30,6 +31,7 @@ import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import com.facebook.shimmer.ShimmerFrameLayout;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.base.BaseActivity;
import com.gmeremit.online.gmeremittance_native.customwidgets.GmeErrorTextView;
@ -61,7 +63,7 @@ public class LoginV2Activity extends BaseActivity implements View.OnClickListene
public static final int KYC_REQUEST_FROM_LOGIN_SCREEN_CODE_LATER_PROCEED_TO_PENNY_TEST = 4282;
public static final int PENNY_TEST_REQUEST_FROM_PRE_LOGIN_SCREEN_CODE = 4283;
public static final String TAG="GMELoginScreen";
public static final String TAG = "GMELoginScreen";
@BindView(R.id.usernameId)
EditText usernameId;
@ -105,6 +107,9 @@ public class LoginV2Activity extends BaseActivity implements View.OnClickListene
@BindView(R.id.keypadBallon)
RelativeLayout ballonView;
@BindView(R.id.fingerprintScanner)
ShimmerFrameLayout fingerprintScannerView;
@BindView(R.id.fingerprintScannerTxtView)
TextView fingerprintScannerTxtView;
@ -136,7 +141,7 @@ public class LoginV2Activity extends BaseActivity implements View.OnClickListene
private void initialize() {
this.presenter = new LoginV2Presenter(this,new LoginV2Gateway());
this.presenter = new LoginV2Presenter(this, new LoginV2Gateway());
DEFAULT_CORNER_RADIUS = 35 * getResources().getDisplayMetrics().density;
loginButtonText = loginBtn.getText().toString();
progressbar_login.getIndeterminateDrawable().setColorFilter(ContextCompat.getColor(this, android.R.color.white), android.graphics.PorterDuff.Mode.MULTIPLY);
@ -167,6 +172,8 @@ public class LoginV2Activity extends BaseActivity implements View.OnClickListene
private void performDefaultAction(Bundle savedInstanceState) {
if (presenter.checkIfBiometricIsAvailable()) {
String fingerprintText=">> "+getString(R.string.use_fingerprint_text)+" <<";
fingerprintScannerTxtView.setText(fingerprintText);
showFingerPrintScanner(true);
}
@ -182,7 +189,7 @@ public class LoginV2Activity extends BaseActivity implements View.OnClickListene
forgetPwdTxt.setOnClickListener(this);
registerTxt.setOnClickListener(this);
loginBtn.setOnClickListener(this);
fingerprintScannerTxtView.setOnClickListener(this);
fingerprintScannerView.setOnClickListener(this);
// iv_back.setOnClickListener(this);
securityKeyboardView.setSecurityKeyboardFocusStateListener(this);
// presenter.promptForBiometricAuth(true);
@ -198,7 +205,7 @@ public class LoginV2Activity extends BaseActivity implements View.OnClickListene
registerTxt.setOnClickListener(null);
loginBtn.setOnClickListener(null);
// iv_back.setOnClickListener(null);
fingerprintScannerTxtView.setOnClickListener(null);
fingerprintScannerView.setOnClickListener(null);
securityKeyboardView.setSecurityKeyboardFocusStateListener(null);
// presenter.promptForBiometricAuth(false);
@ -222,7 +229,7 @@ public class LoginV2Activity extends BaseActivity implements View.OnClickListene
@SuppressLint("NewApi")
private void animateFingerPrintAppearAnimationIfRequired() {
if (fingerprintScannerTxtView.getVisibility() == View.VISIBLE) {
if (fingerprintScannerView.getVisibility() == View.VISIBLE) {
} else {
@ -251,7 +258,7 @@ public class LoginV2Activity extends BaseActivity implements View.OnClickListene
onBackPressed();
break;
case R.id.fingerprintScannerTxtView:
case R.id.fingerprintScanner:
presenter.promptForBiometricAuth();
break;
@ -274,10 +281,14 @@ public class LoginV2Activity extends BaseActivity implements View.OnClickListene
@Override
public void showFingerPrintScanner(boolean action) {
if (action)
fingerprintScannerTxtView.setVisibility(View.VISIBLE);
else
fingerprintScannerTxtView.setVisibility(View.GONE);
if (action) {
fingerprintScannerView.setVisibility(View.VISIBLE);
fingerprintScannerView.startShimmerAnimation();
}
else {
fingerprintScannerView.startShimmerAnimation();
fingerprintScannerView.setVisibility(View.GONE);
}
}
@Override
@ -288,7 +299,7 @@ public class LoginV2Activity extends BaseActivity implements View.OnClickListene
}
@Override
public void redirectToKYCScreen(String email,int requestCode) {
public void redirectToKYCScreen(String email, int requestCode) {
Intent startKycIntent = new Intent(this, KYCFormV2Activity.class);
startKycIntent.putExtra(KYCFormV2Activity.USER_EMAIL_ID_BUNDLE_KEY, email);
startActivityForResult(startKycIntent, requestCode);
@ -315,8 +326,7 @@ public class LoginV2Activity extends BaseActivity implements View.OnClickListene
}
}
}
else if (requestCode == PENNY_TEST_REQUEST_FROM_PRE_LOGIN_SCREEN_CODE) {
} else if (requestCode == PENNY_TEST_REQUEST_FROM_PRE_LOGIN_SCREEN_CODE) {
if (resultCode == Activity.RESULT_OK) {
boolean pennTestCompletedResult = data.getBooleanExtra(PennyTestActivity.PENNY_TEST_COMPLETED_PERFORMED_STATUS_BUNDLE_KEY, false);
if (pennTestCompletedResult) {
@ -324,8 +334,7 @@ public class LoginV2Activity extends BaseActivity implements View.OnClickListene
redirectToDashboard();
}
} else
{
} else {
//User navigated away from penny test
}
@ -464,7 +473,7 @@ public class LoginV2Activity extends BaseActivity implements View.OnClickListene
@Override
public boolean isFingerPrintIconShown() {
return fingerprintScannerTxtView.getVisibility() == View.VISIBLE;
return fingerprintScannerView.getVisibility() == View.VISIBLE;
}
@Override

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

@ -1,5 +1,7 @@
package com.gmeremit.online.gmeremittance_native.resendV2.presenter.resend;
import androidx.appcompat.app.AppCompatActivity;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.accountmanage.model.accountlisting.WebRequestModel;
import com.gmeremit.online.gmeremittance_native.base.BasePresenter;
@ -8,17 +10,19 @@ import com.gmeremit.online.gmeremittance_native.exrate.model.datav2.ExchangeCalc
import com.gmeremit.online.gmeremittance_native.homeV2.model.UserInfoModelV2;
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.security.GMEAuthManager;
import com.gmeremit.online.gmeremittance_native.security.model.GMEAuthFailedResult;
import com.gmeremit.online.gmeremittance_native.security.model.GMEAuthSuccessResult;
import com.gmeremit.online.gmeremittance_native.security.model.GMETxnParam;
import com.gmeremit.online.gmeremittance_native.security.utils.SecurityUtils;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.SendMoneyTransactionResponseBody;
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;
import com.gmeremit.online.gmeremittance_native.utils.Constants;
import com.gmeremit.online.gmeremittance_native.utils.Utils;
import com.gmeremit.online.gmeremittance_native.utils.https.GenericApiObserverResponse;
import com.gmeremit.online.gmeremittance_native.utils.https.GenericApiObserverResponseV2;
import com.gmeremit.online.gmeremittance_native.utils.https.GenericResponseDataModel;
import com.gmeremit.online.gmeremittance_native.utils.https.HTTPConstants;
import com.gmeremit.online.gmeremittance_native.security.utils.SecurityUtils;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
@ -123,29 +127,28 @@ public class ReSendMoneyV2Presenter extends BasePresenter implements ReSendMoney
@Override
public void promptPinAndPerformTransaction() {
if(checkIfUserHasEnabledBiometricAuth())
{
view.promptBiometricAuthDialog(new TransactionBiometricPromptDialog.BiometricPromptResultListener() {
GMEAuthManager.getGmeAuthManager((AppCompatActivity) view.getContext()).fromPaymentSource(
new GMETxnParam(
getPaymentType(),
getTransactionAmount(),
getKftcId()
).enableFallbackAuth().withCountdownTimer(countDownRemainingValue)
).setListener(new GMEAuthManager.GMEAuthListener() {
@Override
public void onBiometricAuthSuccess(String decResult) {
performSendMoneyTransaction(decResult,true);
public void onGMEAuthSuccess(GMEAuthSuccessResult result) {
performSendMoneyTransaction(result.getResult(), result.isBiometricUsed());
}
});
}
else {
view.promptPassword(new PasswordPromptListener() {
@Override
public void onPasswordSubmit(String password) {
performSendMoneyTransaction(password,false);
public void onGMEAuthFailed(GMEAuthFailedResult failedResult) {
view.showToastMessage(failedResult.getFailedReason());
}
@Override
public void onCancelled() {
public void onGMEAuthCancelled() {
}
}, countDownRemainingValue);
}
}).prompt();
}

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

@ -7,8 +7,6 @@ import com.gmeremit.online.gmeremittance_native.base.BaseContractInterface;
import com.gmeremit.online.gmeremittance_native.base.BasePresenterInterface;
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;
import io.reactivex.Observable;
@ -51,12 +49,10 @@ public interface ReSendMoneyV2PresenterInterface extends BasePresenterInterface
interface ReSendMoneyV2ContractInterface extends BaseContractInterface
{
void promptPassword(PasswordPromptListener listener,long countDownValue);
void showReceiptOnTransactionComplete(String transactionId);
Context getContext();
void promptBiometricAuthDialog(TransactionBiometricPromptDialog.BiometricPromptResultListener biometricPromptResultListener);
}
}

56
app/src/main/java/com/gmeremit/online/gmeremittance_native/resendV2/view/ReSendMoneyV2Activity.java

@ -1,16 +1,14 @@
package com.gmeremit.online.gmeremittance_native.resendV2.view;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.LayoutRes;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import android.view.View;
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.base.BaseFragment;
@ -20,20 +18,11 @@ import com.gmeremit.online.gmeremittance_native.resendV2.gateway.resend.ReSendMo
import com.gmeremit.online.gmeremittance_native.resendV2.model.transactionlisting.PreviousTransactionRelatedData;
import com.gmeremit.online.gmeremittance_native.resendV2.presenter.resend.ReSendMoneyV2Presenter;
import com.gmeremit.online.gmeremittance_native.resendV2.presenter.resend.ReSendMoneyV2PresenterInterface;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.view.SendMoneyV2TransactionCompleteActivity;
import com.gmeremit.online.gmeremittance_native.transactionpasspromt.PasswordPromptListener;
import com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionBiometricPromptDialog;
import com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionPasswordPromptActivity;
import butterknife.BindView;
import butterknife.ButterKnife;
import static com.gmeremit.online.gmeremittance_native.resendV2.view.TransactionListingV2Activity.PREV_TXN_RELATED_DATA_BUNDLE_KEY;
import static com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionPasswordPromptActivity.OTP_COUNTDOWN_VALUE;
import static com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionPasswordPromptActivity.PAYMENT_TYPE_BUNDLE_KEY;
import static com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionPasswordPromptActivity.SELECTED_AMT_FOR_OTP_BUNDLE_KEY;
import static com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionPasswordPromptActivity.SELECTED_KFTC_ID_FOR_OTP_BUNDLE_KEY;
import static com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionPasswordPromptActivity.TRANSACTION_PWD_ENC_DATA;
public class ReSendMoneyV2Activity extends BaseActivity implements ReSendMoneyV2PresenterInterface.ReSendMoneyV2ContractInterface, ReSendMoneyActionListener, View.OnClickListener {
@ -43,7 +32,6 @@ public class ReSendMoneyV2Activity extends BaseActivity implements ReSendMoneyV2
private PreviousTransactionRelatedData reSendMoneyRequiredData;
private FragmentManager fragmentManager;
private ReSendMoneyV2PresenterInterface presenter;
private PasswordPromptListener passwordPromptListener;
@BindView(R.id.toolbar_title)
TextView toolbar_title;
@ -171,40 +159,8 @@ public class ReSendMoneyV2Activity extends BaseActivity implements ReSendMoneyV2
}
@Override
public void promptPassword(PasswordPromptListener listener, long countDownValue) {
String paymentType = presenter.getPaymentType();
String kftcId=presenter.getKftcId();
String selectedAmount=presenter.getTransactionAmount();
this.passwordPromptListener = listener;
Intent passwordRequestIntent = new Intent(this, TransactionPasswordPromptActivity.class);
passwordRequestIntent.putExtra(PAYMENT_TYPE_BUNDLE_KEY, paymentType);
passwordRequestIntent.putExtra(SELECTED_AMT_FOR_OTP_BUNDLE_KEY, selectedAmount);
passwordRequestIntent.putExtra(SELECTED_KFTC_ID_FOR_OTP_BUNDLE_KEY, kftcId);
passwordRequestIntent.putExtra(OTP_COUNTDOWN_VALUE, countDownValue);
startActivityForResult(passwordRequestIntent, PASSWORD_PROMPT_REQUEST);
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == PASSWORD_PROMPT_REQUEST) {
if (resultCode == Activity.RESULT_OK) {
String encData = data.getStringExtra(TRANSACTION_PWD_ENC_DATA);
presenter.updateRemainingCountDownValue(-1);
if (this.passwordPromptListener != null)
passwordPromptListener.onPasswordSubmit(encData);
this.passwordPromptListener = null;
} else if (resultCode == Activity.RESULT_CANCELED&&data!=null) {
presenter.updateRemainingCountDownValue(data.getLongExtra(OTP_COUNTDOWN_VALUE, -1));
}
else if(resultCode==RESULT_CANCELED)
{
presenter.updateRemainingCountDownValue(-1);
}
}
}
@Override
public void showReceiptOnTransactionComplete(String transactionId) {
@ -221,12 +177,6 @@ public class ReSendMoneyV2Activity extends BaseActivity implements ReSendMoneyV2
return this;
}
@Override
public void promptBiometricAuthDialog(TransactionBiometricPromptDialog.BiometricPromptResultListener listener) {
// TransactionBiometricPromptDialog promptDialog= new TransactionBiometricPromptDialog();
// promptDialog.setResultListener(listener);
// promptDialog.show(getSupportFragmentManager(),promptDialog.getClass().getSimpleName());
}
}

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/security/auth/GMEUserPasswordPromptBottomSheetDialog.java

@ -72,7 +72,7 @@ public class GMEUserPasswordPromptBottomSheetDialog extends BottomSheetDialogFra
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setStyle(STYLE_NORMAL, R.style.AppBottomSheetDialogThemeWithInset);
setStyle(STYLE_NORMAL, R.style.RoundedBottomSheetDialog);
}
@Override

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

@ -1,7 +1,5 @@
package com.gmeremit.online.gmeremittance_native.sendmoneyV2.presenter;
import android.content.Context;
import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.LiveData;
@ -9,19 +7,16 @@ import com.gmeremit.online.gmeremittance_native.accountmanage.model.accountlisti
import com.gmeremit.online.gmeremittance_native.base.BaseContractInterface;
import com.gmeremit.online.gmeremittance_native.base.BasePresenterInterface;
import com.gmeremit.online.gmeremittance_native.couponV2.model.CouponDTO;
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.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.BankBranchDTO;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.payoutmode.BankList;
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 com.gmeremit.online.gmeremittance_native.sendmoneyV2.view.amountdetail.AmountDetailSendMoneyFragment;
import com.gmeremit.online.gmeremittance_native.transactionpasspromt.PasswordPromptListener;
import com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionBiometricPromptDialog;
import java.util.ArrayList;
@ -79,9 +74,7 @@ public interface SendMoneyV2PresenterInterface extends BasePresenterInterface {
interface SendMoneyV2ContractInterface extends BaseContractInterface
{
void promptPassword(PasswordPromptListener listener,long countDownValue);
void promptBiometricAuthDialog(TransactionBiometricPromptDialog.BiometricPromptResultListener listener);
void showReceiptOnTransactionComplete(String transactionId);

63
app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/view/SendMoneyV2Activity.java

@ -1,41 +1,29 @@
package com.gmeremit.online.gmeremittance_native.sendmoneyV2.view;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.LayoutRes;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.core.content.ContextCompat;
import androidx.lifecycle.ViewModelProviders;
import android.view.View;
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.base.BaseFragment;
import com.gmeremit.online.gmeremittance_native.couponV2.gateway.CouponV2Gateway;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.SendMoneyViewModelFactory;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.gateway.SendMoneyV2Gateway;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.model.SendMoneyRequiredDataV3;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.presenter.SendMoneyV2Presenter;
import com.gmeremit.online.gmeremittance_native.sendmoneyV2.presenter.SendMoneyV2PresenterInterface;
import com.gmeremit.online.gmeremittance_native.transactionpasspromt.PasswordPromptListener;
import com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionBiometricPromptDialog;
import com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionPasswordPromptActivity;
import butterknife.BindView;
import butterknife.ButterKnife;
import static com.gmeremit.online.gmeremittance_native.recipientV2.view.recipientadd.RecipientAddV2Activity.RECIPIENT_INFO_BUNDLE_KEY;
import static com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionPasswordPromptActivity.OTP_COUNTDOWN_VALUE;
import static com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionPasswordPromptActivity.PAYMENT_TYPE_BUNDLE_KEY;
import static com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionPasswordPromptActivity.SELECTED_AMT_FOR_OTP_BUNDLE_KEY;
import static com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionPasswordPromptActivity.SELECTED_KFTC_ID_FOR_OTP_BUNDLE_KEY;
import static com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionPasswordPromptActivity.TRANSACTION_PWD_ENC_DATA;
public class SendMoneyV2Activity extends BaseActivity implements SendMoneyActionListener, SendMoneyV2PresenterInterface.SendMoneyV2ContractInterface, View.OnClickListener {
@ -56,7 +44,6 @@ public class SendMoneyV2Activity extends BaseActivity implements SendMoneyAction
View iv_cancel;
public static String RECIPIENT_DATA = "recipientData";
private PasswordPromptListener passwordPromptListener;
private SendMoneyScreenManager sendMoneyScreenManager;
@Override
@ -252,48 +239,6 @@ public class SendMoneyV2Activity extends BaseActivity implements SendMoneyAction
@Override
public void promptPassword(PasswordPromptListener listener, long countDownValue) {
// String paymentType = presenter.getPaymentType();
// String kftcId=presenter.getKftcId();
// String selectedAmount=presenter.getTransactionAmount();
//
// this.passwordPromptListener = listener;
// Intent passwordRequestIntent = new Intent(this, TransactionPasswordPromptActivity.class);
// passwordRequestIntent.putExtra(PAYMENT_TYPE_BUNDLE_KEY, paymentType);
// passwordRequestIntent.putExtra(SELECTED_AMT_FOR_OTP_BUNDLE_KEY, selectedAmount);
// passwordRequestIntent.putExtra(SELECTED_KFTC_ID_FOR_OTP_BUNDLE_KEY, kftcId);
// passwordRequestIntent.putExtra(OTP_COUNTDOWN_VALUE, countDownValue);
// startActivityForResult(passwordRequestIntent, PASSWORD_PROMPT_REQUEST);
}
@Override
public void promptBiometricAuthDialog(TransactionBiometricPromptDialog.BiometricPromptResultListener listener) {
// TransactionBiometricPromptDialog promptDialog= new TransactionBiometricPromptDialog();
// promptDialog.setResultListener(listener);
// promptDialog.show(getSupportFragmentManager(),promptDialog.getClass().getSimpleName());
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == PASSWORD_PROMPT_REQUEST) {
if (resultCode == Activity.RESULT_OK) {
String encData = data.getStringExtra(TRANSACTION_PWD_ENC_DATA);
presenter.updateRemainingCountDownValue(-1);
if (this.passwordPromptListener != null)
passwordPromptListener.onPasswordSubmit(encData);
this.passwordPromptListener = null;
} else if (resultCode == Activity.RESULT_CANCELED && data != null) {
presenter.updateRemainingCountDownValue(data.getLongExtra(OTP_COUNTDOWN_VALUE, -1));
}
else if(resultCode == Activity.RESULT_CANCELED)
{
presenter.updateRemainingCountDownValue(-1);
}
}
}
@Override
public void showReceiptOnTransactionComplete(String transactionId) {
Intent startReceiptActivity = new Intent(this, SendMoneyV2TransactionCompleteActivity.class);

73
app/src/main/java/com/gmeremit/online/gmeremittance_native/topup/local/presenter/topup/LocalTopUpPresenter.java

@ -23,8 +23,6 @@ import com.gmeremit.online.gmeremittance_native.topup.local.model.topup.LocalTop
import com.gmeremit.online.gmeremittance_native.topup.local.model.topup.LocalTopUpTxnRequestBodyDTO;
import com.gmeremit.online.gmeremittance_native.topup.local.model.topup.SubInfo;
import com.gmeremit.online.gmeremittance_native.topup.local.view.topup.ConfirmRechargePaymentBottomSheetDialog;
import com.gmeremit.online.gmeremittance_native.transactionpasspromt.PasswordPromptListener;
import com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionBiometricPromptDialog;
import com.gmeremit.online.gmeremittance_native.utils.Constants;
import com.gmeremit.online.gmeremittance_native.utils.Utils;
import com.gmeremit.online.gmeremittance_native.utils.https.GenericApiObserverResponseV2;
@ -281,37 +279,29 @@ public class LocalTopUpPresenter extends BasePresenter implements LocalTopUpPres
productPrice = fixedTopUpValidator.selectedCarrierType.getFacePrice();
PaymentConfirmationDTO paymentConfirmationDTO = PaymentConfirmationDTO.create(this.userCurrentBalance, productPrice, selectedPaymentSource);
view.confirmPayment(
paymentConfirmationDTO,
new ConfirmRechargePaymentBottomSheetDialog.RechargeConfirmationListener() {
@Override
public void onPaymentConfirmed() {
if (checkIfUserHasEnabledBiometricAuth()) {
view.promptBiometricAuthDialog(new TransactionBiometricPromptDialog.BiometricPromptResultListener() {
@Override
public void onBiometricAuthSuccess(String password) {
prepareAndPerformFixedTopUpTxn(password, true);
GMEAuthManager.getGmeAuthManager((AppCompatActivity) view.getContext()).fromPaymentSource(
new GMETxnParam(
selectedPaymentSource.getType(),
productPrice,
selectedPaymentSource.getKftcAccountId()
).enableFallbackAuth().withCountdownTimer(countDownRemainingValue)
).setListener(new GMEAuthManager.GMEAuthListener() {
@Override
public void onGMEAuthSuccess(GMEAuthSuccessResult result) {
prepareAndPerformFixedTopUpTxn(result.getResult(), result.isBiometricUsed());
}
});
} else {
view.promptPassword(new PasswordPromptListener() {
@Override
public void onPasswordSubmit(String password) {
prepareAndPerformFixedTopUpTxn(password, false);
public void onGMEAuthFailed(GMEAuthFailedResult failedResult) {
view.showToastMessage(failedResult.getFailedReason());
}
@Override
public void onCancelled() {
public void onGMEAuthCancelled() {
}
}, countDownRemainingValue,
selectedPaymentSource.getKftcAccountId(),
productPrice,
selectedPaymentSource.getType());
}
}
});
}).prompt();
}
@ -323,30 +313,30 @@ public class LocalTopUpPresenter extends BasePresenter implements LocalTopUpPres
new ConfirmRechargePaymentBottomSheetDialog.RechargeConfirmationListener() {
@Override
public void onPaymentConfirmed() {
if (checkIfUserHasEnabledBiometricAuth()) {
view.promptBiometricAuthDialog(new TransactionBiometricPromptDialog.BiometricPromptResultListener() {
@Override
public void onBiometricAuthSuccess(String password) {
prepareAndPerformDataTopUpTxn(password, true);
GMEAuthManager.getGmeAuthManager((AppCompatActivity) view.getContext()).fromPaymentSource(
new GMETxnParam(
selectedPaymentSource.getType(),
dataTopUpValidator.selectedCarrierPlan.getFacePrice(),
selectedPaymentSource.getKftcAccountId()
).enableFallbackAuth().withCountdownTimer(countDownRemainingValue)
).setListener(new GMEAuthManager.GMEAuthListener() {
@Override
public void onGMEAuthSuccess(GMEAuthSuccessResult result) {
prepareAndPerformDataTopUpTxn(result.getResult(), result.isBiometricUsed());
}
});
} else {
view.promptPassword(new PasswordPromptListener() {
@Override
public void onPasswordSubmit(String password) {
prepareAndPerformDataTopUpTxn(password, false);
public void onGMEAuthFailed(GMEAuthFailedResult failedResult) {
view.showToastMessage(failedResult.getFailedReason());
}
@Override
public void onCancelled() {
public void onGMEAuthCancelled() {
}
}, countDownRemainingValue,
selectedPaymentSource.getKftcAccountId(),
dataTopUpValidator.selectedCarrierPlan.getFacePrice(),
selectedPaymentSource.getType());
}
}).prompt();
}
});
@ -601,7 +591,6 @@ public class LocalTopUpPresenter extends BasePresenter implements LocalTopUpPres
} else {
view.enableFixedTopUpButton(false, getStringfromStringId(R.string.not_enough_balance_text));
}
}
}

7
app/src/main/java/com/gmeremit/online/gmeremittance_native/topup/local/presenter/topup/LocalTopUpPresenterInterface.java

@ -5,20 +5,15 @@ import androidx.lifecycle.LiveData;
import com.gmeremit.online.gmeremittance_native.accountmanage.model.paymentsources.PaymentSourceDTO;
import com.gmeremit.online.gmeremittance_native.base.BaseContractInterface;
import com.gmeremit.online.gmeremittance_native.base.BasePresenterInterface;
import com.gmeremit.online.gmeremittance_native.domesticremit.send.model.DomesticAccountsDTO;
import com.gmeremit.online.gmeremittance_native.topup.local.model.topup.ButtonsGrid;
import com.gmeremit.online.gmeremittance_native.topup.local.model.topup.CardInfoDTO;
import com.gmeremit.online.gmeremittance_native.topup.local.model.topup.LocalTopUpDetailDTO;
import com.gmeremit.online.gmeremittance_native.topup.local.model.topup.LocalTopUpResponseDTO;
import com.gmeremit.online.gmeremittance_native.topup.local.model.topup.SubInfo;
import com.gmeremit.online.gmeremittance_native.topup.local.view.topup.ConfirmRechargePaymentBottomSheetDialog;
import com.gmeremit.online.gmeremittance_native.transactionpasspromt.PasswordPromptListener;
import com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionBiometricPromptDialog;
import java.util.List;
import io.reactivex.Observable;
public interface LocalTopUpPresenterInterface extends BasePresenterInterface {
void getAllRequiredData();
@ -71,9 +66,7 @@ public interface LocalTopUpPresenterInterface extends BasePresenterInterface {
void enableDataTopUpButton(boolean result, String stringfromStringId);
void promptPassword(PasswordPromptListener listener,long countDownValue,String selectedAccountKFTCId,String sendingAmount,String type);
void promptBiometricAuthDialog(TransactionBiometricPromptDialog.BiometricPromptResultListener listener);
void showPlanToFixedLocalTopUp(LocalTopUpDetailDTO localTopUpDetailDTO);

66
app/src/main/java/com/gmeremit/online/gmeremittance_native/topup/local/view/topup/LocalTopUpActivity.java

@ -1,50 +1,38 @@
package com.gmeremit.online.gmeremittance_native.topup.local.view.topup;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.provider.ContactsContract;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.Nullable;
import com.gmeremit.online.gmeremittance_native.accountmanage.adapter.paymentsources.PaymentSourceListAdapter;
import com.gmeremit.online.gmeremittance_native.accountmanage.gateway.paymentsources.PaymentSourceSelectionGateway;
import com.gmeremit.online.gmeremittance_native.accountmanage.model.paymentsources.PaymentSourceDTO;
import com.gmeremit.online.gmeremittance_native.customwidgets.GmeEditText;
import com.gmeremit.online.gmeremittance_native.customwidgets.SelectedRedBorderWithTickDecoration;
import com.gmeremit.online.gmeremittance_native.customwidgets.common.GenericTextListingDialog;
import com.gmeremit.online.gmeremittance_native.domesticremit.send.model.DomesticAccountsDTO;
import com.google.android.material.tabs.TabLayout;
import com.google.android.material.textfield.TextInputLayout;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager.widget.ViewPager;
import android.os.Bundle;
import android.text.InputFilter;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.accountmanage.adapter.paymentsources.PaymentSourceListAdapter;
import com.gmeremit.online.gmeremittance_native.accountmanage.gateway.paymentsources.PaymentSourceSelectionGateway;
import com.gmeremit.online.gmeremittance_native.accountmanage.model.paymentsources.PaymentSourceDTO;
import com.gmeremit.online.gmeremittance_native.base.BaseActivity;
import com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView;
import com.gmeremit.online.gmeremittance_native.customwidgets.SelectedRedBorderWithTickDecoration;
import com.gmeremit.online.gmeremittance_native.customwidgets.common.GenericTextListingDialog;
import com.gmeremit.online.gmeremittance_native.customwidgets.maskedittext.GmeMaskedEditText;
import com.gmeremit.online.gmeremittance_native.topup.local.adapter.topup.LocalTopUpServiceViewPagerAdapter;
import com.gmeremit.online.gmeremittance_native.topup.local.gateway.topup.LocalTopUpGateway;
import com.gmeremit.online.gmeremittance_native.topup.local.model.topup.LocalTopUpDetailDTO;
import com.gmeremit.online.gmeremittance_native.topup.local.presenter.topup.LocalTopUpPresenter;
import com.gmeremit.online.gmeremittance_native.topup.local.presenter.topup.LocalTopUpPresenterInterface;
import com.gmeremit.online.gmeremittance_native.topup.local.view.history.LocalTopUpHistoryActivity;
import com.gmeremit.online.gmeremittance_native.topup.local.view.topup.services.DataOnlyLocalTopUpFragment;
import com.gmeremit.online.gmeremittance_native.topup.local.view.topup.services.FixedChargeLocalTopupFragment;
import com.gmeremit.online.gmeremittance_native.topup.local.view.topup.services.regular.RegularLocalTopupFragment;
import com.gmeremit.online.gmeremittance_native.transactionpasspromt.PasswordPromptListener;
import com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionBiometricPromptDialog;
import com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionPasswordPromptActivity;
import com.google.android.material.tabs.TabLayout;
import com.google.android.material.textfield.TextInputLayout;
import java.util.ArrayList;
import java.util.List;
@ -53,12 +41,6 @@ import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import static com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionPasswordPromptActivity.OTP_COUNTDOWN_VALUE;
import static com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionPasswordPromptActivity.PAYMENT_TYPE_BUNDLE_KEY;
import static com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionPasswordPromptActivity.SELECTED_AMT_FOR_OTP_BUNDLE_KEY;
import static com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionPasswordPromptActivity.SELECTED_KFTC_ID_FOR_OTP_BUNDLE_KEY;
import static com.gmeremit.online.gmeremittance_native.transactionpasspromt.view.TransactionPasswordPromptActivity.TRANSACTION_PWD_ENC_DATA;
public class LocalTopUpActivity extends BaseActivity implements LocalTopUpPresenterInterface.LocalTopUpContractInterface, LocalTopUpActivityActionListener, GmeMaskedEditText.ValueListener, PaymentSourceListAdapter.PaymentSourceSelectionListener {
private static final int PICK_CONTACT = 34342;
@ -107,7 +89,6 @@ public class LocalTopUpActivity extends BaseActivity implements LocalTopUpPresen
private ArrayList<Fragment> fragments;
private LocalTopUpPresenterInterface presenter;
private PasswordPromptListener passwordPromptListener;
private PaymentSourceListAdapter paymentSourceListAdapter;
@ -207,14 +188,7 @@ public class LocalTopUpActivity extends BaseActivity implements LocalTopUpPresen
if (requestCode == PICK_CONTACT && resultCode == RESULT_OK) {
handleContact(resultData);
}
if (requestCode == PASSWORD_PROMPT_REQUEST) {
if (resultCode == Activity.RESULT_OK) {
String encData = resultData.getStringExtra(TRANSACTION_PWD_ENC_DATA);
if (this.passwordPromptListener != null)
passwordPromptListener.onPasswordSubmit(encData);
this.passwordPromptListener = null;
}
}
}
// @OnClick(R.id.senderPaymentSourceViewContainer)
@ -340,23 +314,7 @@ public class LocalTopUpActivity extends BaseActivity implements LocalTopUpPresen
presenter.onMobileNumberChanged(value);
}
@Override
public void promptPassword(PasswordPromptListener listener, long countDownValue, String selectedAccountKFTCId, String sendingAmount, String type) {
// this.passwordPromptListener = listener;
// Intent passwordRequestIntent = new Intent(this, TransactionPasswordPromptActivity.class);
// passwordRequestIntent.putExtra(PAYMENT_TYPE_BUNDLE_KEY, type);
// passwordRequestIntent.putExtra(SELECTED_AMT_FOR_OTP_BUNDLE_KEY, sendingAmount);
// passwordRequestIntent.putExtra(SELECTED_KFTC_ID_FOR_OTP_BUNDLE_KEY, selectedAccountKFTCId);
// passwordRequestIntent.putExtra(OTP_COUNTDOWN_VALUE, countDownValue);
// startActivityForResult(passwordRequestIntent, PASSWORD_PROMPT_REQUEST);
}
@Override
public void promptBiometricAuthDialog(TransactionBiometricPromptDialog.BiometricPromptResultListener listener) {
// TransactionBiometricPromptDialog promptDialog = new TransactionBiometricPromptDialog();
// promptDialog.setResultListener(listener);
// promptDialog.show(getSupportFragmentManager(), promptDialog.getClass().getSimpleName());
}
@Override
public void showPlanToFixedLocalTopUp(LocalTopUpDetailDTO localTopUpDetailDTO) {

6
app/src/main/java/com/gmeremit/online/gmeremittance_native/transactionpasspromt/PasswordPromptListener.java

@ -1,6 +0,0 @@
package com.gmeremit.online.gmeremittance_native.transactionpasspromt;
public interface PasswordPromptListener {
void onPasswordSubmit(String password);
void onCancelled();
}

29
app/src/main/java/com/gmeremit/online/gmeremittance_native/transactionpasspromt/gateway/TransactionPasswordPromptV2Gateway.java

@ -1,29 +0,0 @@
package com.gmeremit.online.gmeremittance_native.transactionpasspromt.gateway;
import com.gmeremit.online.gmeremittance_native.GmeApplication;
import com.gmeremit.online.gmeremittance_native.base.PrefKeys;
import com.gmeremit.online.gmeremittance_native.base.PrivilegedGateway;
import com.gmeremit.online.gmeremittance_native.transactionpasspromt.presenter.TransactionPasswordPromptV2InteractorInterface;
import com.gmeremit.online.gmeremittance_native.utils.https.HttpClientV2;
import com.google.gson.JsonObject;
import io.reactivex.Observable;
import okhttp3.ResponseBody;
import static com.gmeremit.online.gmeremittance_native.base.PrefKeys.APP_FINGER_PRINT_ENABLED;
import static com.gmeremit.online.gmeremittance_native.base.PrefKeys.APP_USER_SECRET_KEY;
public class TransactionPasswordPromptV2Gateway extends PrivilegedGateway implements TransactionPasswordPromptV2InteractorInterface.TransactionPasswordPromptV2GatewayInterface {
@Override
public Observable<ResponseBody> requestOtp(String auth, String Uid,String amount,String kftcId) {
JsonObject jsonObject=new JsonObject();
jsonObject.addProperty("kftcId",kftcId);
jsonObject.addProperty("amount",amount);
jsonObject.addProperty("userId",Uid);
return HttpClientV2.getInstance().requestOTPForSendMoney(auth,jsonObject);
}
}

16
app/src/main/java/com/gmeremit/online/gmeremittance_native/transactionpasspromt/presenter/TransactionPasswordPromptV2InteractorInterface.java

@ -1,16 +0,0 @@
package com.gmeremit.online.gmeremittance_native.transactionpasspromt.presenter;
import com.gmeremit.online.gmeremittance_native.base.BaseInteractorInterface;
import com.gmeremit.online.gmeremittance_native.base.PrivilegedGatewayInterface;
import io.reactivex.Observable;
import okhttp3.ResponseBody;
public interface TransactionPasswordPromptV2InteractorInterface extends BaseInteractorInterface {
interface TransactionPasswordPromptV2GatewayInterface extends PrivilegedGatewayInterface
{
Observable<ResponseBody> requestOtp(String auth, String Uid,String amount,String kftc);
}
}

273
app/src/main/java/com/gmeremit/online/gmeremittance_native/transactionpasspromt/presenter/TransactionPasswordPromptV2Presenter.java

@ -1,273 +0,0 @@
package com.gmeremit.online.gmeremittance_native.transactionpasspromt.presenter;
import android.os.Build;
import android.security.keystore.KeyPermanentlyInvalidatedException;
import android.util.Log;
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.utils.Constants;
import com.gmeremit.online.gmeremittance_native.utils.https.GenericApiObserverResponseV2;
import com.gmeremit.online.gmeremittance_native.utils.https.GenericResponseDataModel;
import com.gmeremit.online.gmeremittance_native.utils.https.MessageResponseDataModel;
import com.gmeremit.online.gmeremittance_native.security.utils.SecurityUtils;
import com.mtramin.rxfingerprint.data.BiometricExceptions;
import com.mtramin.rxfingerprint.data.FingerprintDecryptionResult;
import java.util.concurrent.TimeUnit;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.disposables.Disposable;
import io.reactivex.observers.DisposableObserver;
import io.reactivex.schedulers.Schedulers;
public class TransactionPasswordPromptV2Presenter extends BasePresenter implements TransactionPasswordPromptV2PresenterInterface, TransactionPasswordPromptV2InteractorInterface {
private final TransactionPasswordPromptV2PresenterInterface.TransactionPasswordPromptV2ContractInterface view;
private final TransactionPasswordPromptV2InteractorInterface.TransactionPasswordPromptV2GatewayInterface gateway;
private final CompositeDisposable compositeDisposable;
private final String selectedPaymentType;
private long updateCountdownValue;
private String selectedAmount;
private String selectedKftcId;
private Disposable fingerPrintScanningSubscription;
private boolean isKeyPermanentlyInvalidated = false;
public TransactionPasswordPromptV2Presenter(TransactionPasswordPromptV2PresenterInterface.TransactionPasswordPromptV2ContractInterface view,TransactionPasswordPromptV2InteractorInterface.TransactionPasswordPromptV2GatewayInterface gateway, String paymentType) {
this.view = view;
this.gateway = gateway;
this.compositeDisposable = new CompositeDisposable();
this.updateCountdownValue = -1;
this.selectedKftcId = "";
this.selectedAmount = "";
this.selectedPaymentType = paymentType;
}
@Override
public void getOtp() {
if (updateCountdownValue == -1) {
this.compositeDisposable.add(
this.gateway.requestOtp(this.gateway.getAuth(), this.gateway.getUserID(), selectedAmount, selectedKftcId)
.doOnSubscribe(disposable -> view.showProgressBar(true, getStringfromStringId(R.string.requesting_otp_text)))
.doFinally(() -> view.showProgressBar(false, ""))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribeWith(new ResendRequestObserver())
);
} else {
view.showResendRequestView(false);
view.startCountdownView(updateCountdownValue);
}
}
@Override
public void updateCountdown(long millisUntilFinished) {
this.updateCountdownValue = millisUntilFinished;
}
@Override
public long getLatestCountDownValue() {
return updateCountdownValue;
}
@Override
public void updateSelectedAmount(String selectedAmount) {
if (selectedAmount == null)
selectedAmount = "";
this.selectedAmount = selectedAmount;
}
@Override
public void updateSelectedKftcId(String selectedKftcId) {
if (selectedKftcId == null)
selectedKftcId = "";
this.selectedKftcId = selectedKftcId;
}
@Override
public boolean checkIfUserHasEnabledBiometricAuth() {
return false;
// return SecurityUtils.checkFingerPrintUsablity(view.getContext()) && gateway.isFingerPrintAuthEnabled() && gateway.getPersistedUserId() != null && gateway.getPersistedUserPwd() != null;
}
@Override
public void startObservingFingerPrintIfRequired(boolean action) {
if (!checkIfUserHasEnabledBiometricAuth()) {
view.addFingerprintIcon(false);
return;
}
if (!action) {
view.clearImageView();
if (fingerPrintScanningSubscription != null && !fingerPrintScanningSubscription.isDisposed())
fingerPrintScanningSubscription.dispose();
} else {
view.addFingerprintIcon(true);
fingerPrintScanningSubscription = authenticateFingerprint().subscribeWith(new FingerprintDecResultObserver());
compositeDisposable.add(fingerPrintScanningSubscription);
}
}
private Observable<FingerprintDecResult> authenticateFingerprint() {
return Observable.zip(Observable.fromCallable(gateway::getPersistedUserId),
Observable.fromCallable(gateway::getPersistedSecretKey)
.flatMap(storedKey -> decryptFromKeyStore(storedKey).flatMap(decAesKey -> SecurityUtils.decryptUsingAES(gateway.getPersistedUserPwd(), decAesKey)))
.subscribeOn(Schedulers.io()),
FingerprintDecResult::new)
.doOnSubscribe(subs -> {
view.animateFingerPrintAppearAnimationIfRequired(true);
})
.observeOn(AndroidSchedulers.mainThread());
}
private Observable<String> decryptFromKeyStore(String data) {
return SecurityUtils.decryptUsingKeyStore(view.getContext(),null, data)
.flatMap(authentication -> {
switch (authentication.getResult()) {
case FAILED:
return io.reactivex.Observable.error(new SecurityUtils.FailedFingerPrintException(getStringfromStringId(R.string.fingerprint_not_recognized)));
case HELP:
return io.reactivex.Observable.error(new SecurityUtils.SensorNotReadyException(authentication.getMessage()));
case AUTHENTICATED:
return Observable.just(authentication);
default:
return io.reactivex.Observable.error(new Throwable(authentication.getMessage()));
}
})
.observeOn(AndroidSchedulers.mainThread())
.retryWhen(errors -> errors.flatMap(
error -> {
if (error instanceof BiometricExceptions.BiometricAuthFailedException) {
view.addFingerprintIcon(false);
// view.addSecureIcon();
} else if (error instanceof SecurityUtils.FailedFingerPrintException || error instanceof SecurityUtils.SensorNotReadyException) {
view.animateFingerPrintAppearAnimationIfRequired(true);
view.showToastMessage(error.getMessage());
return Observable.timer(100, TimeUnit.MILLISECONDS);
}
return Observable.error(error);
}
))
.map(FingerprintDecryptionResult::getDecrypted);
}
@Override
public boolean checkIfRequiredOTPScreen() {
return "autodebit".equalsIgnoreCase(selectedPaymentType);
}
@Override
public void verifyTxnType() {
if (checkIfRequiredOTPScreen()) {
view.setupAutoDebitTxnPasswordPromptView();
view.addFingerprintIcon(false);
} else {
view.setupWalletTxnPasswordPromptView();
if (checkIfUserHasEnabledBiometricAuth())
view.addFingerprintIcon(true);
else view.addFingerprintIcon(false);
}
}
class ResendRequestObserver extends GenericApiObserverResponseV2<MessageResponseDataModel> {
@Override
protected void onSuccess(GenericResponseDataModel<MessageResponseDataModel> response) {
if (response.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) {
view.showPopUpMessage(response.getMsg(), CustomAlertDialog.AlertType.SUCCESS, alertType -> {
view.showResendRequestView(false);
view.startCountdownView(120000);
});
} else {
view.showPopUpMessage(response.getMsg(), CustomAlertDialog.AlertType.FAILED, alertType -> {
view.showResendRequestView(true);
});
}
}
@Override
public void onFailed(String message) {
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, alertType -> view.exitView());
}
@Override
protected void onConnectionNotEstablished(String message) {
view.showPopUpMessage(message, CustomAlertDialog.AlertType.NO_INTERNET, null);
view.showResendRequestView(true);
}
@Override
protected void unauthorizedAccess(String message) {
gateway.clearAllUserData();
view.showPopUpMessage(message, CustomAlertDialog.AlertType.ALERT, alertType -> view.logout());
}
}
public class FingerprintDecResult {
String userId;
String userPwd;
public FingerprintDecResult(String userId, String userPwd) {
this.userId = userId;
this.userPwd = userPwd;
}
public String getUserId() {
return userId;
}
public String getUserPwd() {
return userPwd;
}
@Override
public String toString() {
return "UserCredentialDecryptionResultDTO{" +
"userId='" + userId + '\'' +
", userPwd='" + userPwd + '\'' +
'}';
}
}
public class FingerprintDecResultObserver extends DisposableObserver<FingerprintDecResult> {
@Override
public void onNext(FingerprintDecResult fingerprintDecResult) {
Log.d(SecurityUtils.TAG, "Success : " + fingerprintDecResult.toString());
view.onBiometricAuthSuccess(fingerprintDecResult.getUserPwd());
}
@Override
public void onError(Throwable e) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && e instanceof KeyPermanentlyInvalidatedException)
{
view.addFingerprintIcon(false);
gateway.flushBiometricData();
view.showPopUpMessage(getStringfromStringId(R.string.fingerprint_changed_externally),CustomAlertDialog.AlertType.ALERT,null);
}
Log.d(SecurityUtils.TAG, "Failed : " + e.getMessage());
}
@Override
public void onComplete() {
}
}
}

46
app/src/main/java/com/gmeremit/online/gmeremittance_native/transactionpasspromt/presenter/TransactionPasswordPromptV2PresenterInterface.java

@ -1,46 +0,0 @@
package com.gmeremit.online.gmeremittance_native.transactionpasspromt.presenter;
import android.content.Context;
import com.gmeremit.online.gmeremittance_native.base.BaseContractInterface;
import com.gmeremit.online.gmeremittance_native.base.BasePresenterInterface;
public interface TransactionPasswordPromptV2PresenterInterface extends BasePresenterInterface {
void getOtp();
void updateCountdown(long millisUntilFinished);
long getLatestCountDownValue();
void updateSelectedAmount(String selectedAmount);
void updateSelectedKftcId(String selectedKftcId);
boolean checkIfUserHasEnabledBiometricAuth();
void startObservingFingerPrintIfRequired(boolean action);
boolean checkIfRequiredOTPScreen();
void verifyTxnType();
interface TransactionPasswordPromptV2ContractInterface extends BaseContractInterface {
void startCountdownView(long durationMillisecond);
void showResendRequestView(boolean action);
Context getContext();
void onBiometricAuthSuccess(String decPassword);
void animateFingerPrintAppearAnimationIfRequired(boolean action);
void setupAutoDebitTxnPasswordPromptView();
void setupWalletTxnPasswordPromptView();
void addFingerprintIcon(boolean action);
void clearImageView();
}
}

240
app/src/main/java/com/gmeremit/online/gmeremittance_native/transactionpasspromt/view/TransactionBiometricPromptDialog.java

@ -1,240 +0,0 @@
package com.gmeremit.online.gmeremittance_native.transactionpasspromt.view;
import android.app.Dialog;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.security.keystore.KeyPermanentlyInvalidatedException;
import androidx.vectordrawable.graphics.drawable.AnimatedVectorDrawableCompat;
import androidx.appcompat.app.AlertDialog;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.fragment.app.DialogFragment;
import com.gmeremit.online.gmeremittance_native.GmeApplication;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.base.PrefKeys;
import com.gmeremit.online.gmeremittance_native.security.utils.SecurityUtils;
import com.mtramin.rxfingerprint.data.BiometricExceptions;
import com.mtramin.rxfingerprint.data.FingerprintDecryptionResult;
import java.util.concurrent.TimeUnit;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.disposables.Disposable;
import io.reactivex.observers.DisposableObserver;
import io.reactivex.schedulers.Schedulers;
public class TransactionBiometricPromptDialog extends DialogFragment {
private AnimatedVectorDrawableCompat fingerPrintAVDCompat;
private ImageView passwordPromptImageView;
private Disposable fingerPrintScanningSubscription;
private CompositeDisposable compositeDisposable;
private BiometricPromptResultListener listener;
private View cancelTxt;
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
View view = getActivity().getLayoutInflater().inflate(R.layout.dialog_password_prompt_v2, null);
passwordPromptImageView = view.findViewById(R.id.passwordPromptImageView);
cancelTxt = view.findViewById(R.id.cancel_txt);
builder.setView(view);
Dialog dialog = builder.create();
try {
dialog.getWindow().setBackgroundDrawableResource(R.drawable.ic_rounded_white);
} catch (NullPointerException e) {
}
initialize();
return dialog;
}
private void initialize() {
this.compositeDisposable = new CompositeDisposable();
fingerPrintAVDCompat = AnimatedVectorDrawableCompat.create(getActivity(), R.drawable.avd_fp);
}
public void setResultListener(BiometricPromptResultListener listener) {
this.listener = listener;
}
@Override
public void onStart() {
super.onStart();
startObservingFingerPrintIfRequired(true);
cancelTxt.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dismiss();
}
});
}
@Override
public void onStop() {
super.onStop();
startObservingFingerPrintIfRequired(false);
cancelTxt.setOnClickListener(null);
}
public void animateFingerPrintAppearAnimationIfRequired(boolean action) {
if (action) {
if (fingerPrintAVDCompat != null && !fingerPrintAVDCompat.isRunning()) {
passwordPromptImageView.setImageDrawable(fingerPrintAVDCompat);
fingerPrintAVDCompat.start();
}
} else {
passwordPromptImageView.setImageDrawable(null);
}
}
public void startObservingFingerPrintIfRequired(boolean action) {
if (!action) {
if (fingerPrintScanningSubscription != null && !fingerPrintScanningSubscription.isDisposed())
fingerPrintScanningSubscription.dispose();
} else {
animateFingerPrintAppearAnimationIfRequired(true);
fingerPrintScanningSubscription = authenticateFingerprint().subscribeWith(new FingerprintDecResultObserver());
compositeDisposable.add(fingerPrintScanningSubscription);
}
}
private Observable<FingerprintDecResult> authenticateFingerprint() {
return Observable.zip(Observable.fromCallable(() -> GmeApplication.getStorage().getString(PrefKeys.APP_USER_ID_SECRET_KEY, null)),
Observable.fromCallable(() -> GmeApplication.getStorage().getString(PrefKeys.APP_SECRET_KEY, null))
.flatMap(storedKey -> decryptFromKeyStore(storedKey).flatMap(decAesKey -> SecurityUtils.decryptUsingAES(GmeApplication.getStorage().getString(PrefKeys.APP_USER_SECRET_KEY, null), decAesKey)))
.subscribeOn(Schedulers.io()),
FingerprintDecResult::new)
.doOnSubscribe(subs -> {
animateFingerPrintAppearAnimationIfRequired(true);
})
.observeOn(AndroidSchedulers.mainThread());
}
private Observable<String> decryptFromKeyStore(String data) {
return SecurityUtils.decryptUsingKeyStore(getActivity(),null, data)
.flatMap(authentication -> {
switch (authentication.getResult()) {
case FAILED:
return io.reactivex.Observable.error(new SecurityUtils.FailedFingerPrintException(getString(R.string.fingerprint_not_recognized)));
case HELP:
return io.reactivex.Observable.error(new SecurityUtils.SensorNotReadyException(authentication.getMessage()));
case AUTHENTICATED:
return Observable.just(authentication);
default:
return io.reactivex.Observable.error(new Throwable(authentication.getMessage()));
}
})
.observeOn(AndroidSchedulers.mainThread())
.retryWhen(errors -> errors.flatMap(
error -> {
if (error instanceof SecurityUtils.FailedFingerPrintException || error instanceof SecurityUtils.SensorNotReadyException) {
animateFingerPrintAppearAnimationIfRequired(true);
showToastMessage(error.getMessage());
return Observable.timer(100, TimeUnit.MILLISECONDS);
}
return Observable.error(error);
}
))
.map(FingerprintDecryptionResult::getDecrypted);
}
private void showToastMessage(String message) {
Toast toast = Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT);
TextView v = (TextView) toast.getView().findViewById(android.R.id.message);
if (v != null) v.setGravity(Gravity.CENTER);
toast.show();
}
public class FingerprintDecResult {
String userId;
String userPwd;
public FingerprintDecResult(String userId, String userPwd) {
this.userId = userId;
this.userPwd = userPwd;
}
public String getUserId() {
return userId;
}
public String getUserPwd() {
return userPwd;
}
@Override
public String toString() {
return "UserCredentialDecryptionResultDTO{" +
"userId='" + userId + '\'' +
", userPwd='" + userPwd + '\'' +
'}';
}
}
public class FingerprintDecResultObserver extends DisposableObserver<FingerprintDecResult> {
@Override
public void onNext(FingerprintDecResult fingerprintDecResult) {
dismiss();
if (listener != null)
listener.onBiometricAuthSuccess(fingerprintDecResult.getUserPwd());
}
@Override
public void onError(Throwable e) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && e instanceof KeyPermanentlyInvalidatedException) {
SharedPreferences.Editor editor = GmeApplication.getStorage().edit();
editor.putString(PrefKeys.APP_USER_ID_SECRET_KEY, null);
editor.putBoolean(PrefKeys.APP_FINGER_PRINT_ENABLED, false);
editor.putString(PrefKeys.APP_USER_SECRET_KEY, null);
editor.putString(PrefKeys.APP_SECRET_KEY, null);
editor.apply();
showToastMessage(getString(R.string.fingerprint_changed_externally));
} else if (e instanceof BiometricExceptions.BiometricAuthFailedException) {
showToastMessage(e.getMessage());
new Handler().postDelayed(TransactionBiometricPromptDialog.this::dismiss, 200);
}
Log.d(SecurityUtils.TAG, "Failed : " + e.getMessage());
}
@Override
public void onComplete() {
}
}
public interface BiometricPromptResultListener {
void onBiometricAuthSuccess(String decResult);
}
}

453
app/src/main/java/com/gmeremit/online/gmeremittance_native/transactionpasspromt/view/TransactionPasswordPromptActivity.java

@ -1,453 +0,0 @@
package com.gmeremit.online.gmeremittance_native.transactionpasspromt.view;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.graphics.Rect;
import android.os.Build;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import androidx.vectordrawable.graphics.drawable.AnimatedVectorDrawableCompat;
import androidx.core.content.ContextCompat;
import androidx.core.view.GestureDetectorCompat;
import androidx.appcompat.app.AppCompatDelegate;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.style.ForegroundColorSpan;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.RelativeLayout;
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.GmeErrorTextView;
import com.gmeremit.online.gmeremittance_native.transactionpasspromt.gateway.TransactionPasswordPromptV2Gateway;
import com.gmeremit.online.gmeremittance_native.transactionpasspromt.presenter.TransactionPasswordPromptV2Presenter;
import com.gmeremit.online.gmeremittance_native.transactionpasspromt.presenter.TransactionPasswordPromptV2PresenterInterface;
import com.gmeremit.online.gmeremittance_native.security.securitykeypad.SecurityKeyboardManager;
import com.gmeremit.online.gmeremittance_native.security.securitykeypad.SecurityKeyboardView;
import com.gmeremit.online.gmeremittance_native.security.securitykeypad.SecurityKeypadRequestParamBuilder;
import com.softsecurity.transkey.TransKeyActivity;
import java.util.Locale;
import butterknife.BindView;
import butterknife.ButterKnife;
public class TransactionPasswordPromptActivity extends BaseActivity implements SecurityKeyboardView.SecurityKeyboardFocusStateListener, TransactionPasswordPromptV2PresenterInterface.TransactionPasswordPromptV2ContractInterface, View.OnClickListener {
static {
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
}
public static final String OTP_COUNTDOWN_VALUE = "bundleCountdownValue";
SecurityKeyboardManager securityKeyboardManager;
@BindView(R.id.securityKeyboard)
SecurityKeyboardView securityKeyboardView;
@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;
@BindView(R.id.rootView)
View rootView;
@BindView(R.id.passwordPromptImageView)
ImageView passwordPromptImageView;
@BindView(R.id.orTextView)
TextView orTextView;
@BindView(R.id.passwordErrorTxt)
GmeErrorTextView passwordErrorTxt;
private SecurityKeypadListener securityKeypadListener;
private GestureDetectorCompat gestureDetector;
private TransactionPasswordPromptActivityGestureDetector myViewGestureDetector;
public static final String TRANSACTION_PWD_ENC_DATA = "bundleKeyEncData";
public static final String PAYMENT_TYPE_BUNDLE_KEY = "bundleKeyPaymentType";
public static final String SELECTED_AMT_FOR_OTP_BUNDLE_KEY = "bundleKeySelectedAmtOtp";
public static final String SELECTED_KFTC_ID_FOR_OTP_BUNDLE_KEY = "bundleKeySelectedKFTCId";
// private String paymentType;
private TransactionPasswordPromptV2PresenterInterface presenter;
private CountDownTimer countDownTimer;
private AnimatedVectorDrawableCompat fingerPrintAVDCompat;
@Override
protected void onCreate(Bundle savedInstanceState) {
enableActivityToTakeScreenShot(false);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_transaction_password_prompt);
ButterKnife.bind(this);
setUpWindowWithInsets();
preInit();
init();
performDefaultAction(savedInstanceState);
}
private void setUpWindowWithInsets() {
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.O||Build.VERSION.SDK_INT==Build.VERSION_CODES.O_MR1) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
} else {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
Window window = getWindow();
if (window != null) {
window.getAttributes().windowAnimations = R.style.SlideInAnimation;
window.setBackgroundDrawableResource(R.drawable.ic_rounded_password_prompt_activity_bg);
window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
}
}
private void preInit() {
presenter = new TransactionPasswordPromptV2Presenter(this,new TransactionPasswordPromptV2Gateway(), getIntent().getStringExtra(PAYMENT_TYPE_BUNDLE_KEY));
if (presenter.checkIfRequiredOTPScreen()) {
presenter.updateCountdown(getIntent().getLongExtra(OTP_COUNTDOWN_VALUE, -1));
presenter.updateSelectedAmount(getIntent().getStringExtra(SELECTED_AMT_FOR_OTP_BUNDLE_KEY));
presenter.updateSelectedKftcId(getIntent().getStringExtra(SELECTED_KFTC_ID_FOR_OTP_BUNDLE_KEY));
}
else
resendRequest.setVisibility(View.GONE);
}
private void init() {
securityKeyboardView.setKeyboardContainerView(keypadContainer);
securityKeyboardView.setKeyboardBallonView(ballonView);
securityKeypadListener = new SecurityKeypadListener();
myViewGestureDetector = new TransactionPasswordPromptActivityGestureDetector();
gestureDetector = new GestureDetectorCompat(this, myViewGestureDetector);
try {
securityKeyboardManager = new SecurityKeyboardManager(this);
SecurityKeypadRequestParamBuilder request = new SecurityKeypadRequestParamBuilder(this);
request.disableKeyPadEffect(false);
presenter.verifyTxnType();
} catch (Exception e) {
e.printStackTrace();
}
}
private void performDefaultAction(Bundle savedInstanceState) {
securityKeyboardManager.showKeyboard();
if (presenter.checkIfRequiredOTPScreen()) {
new Handler().postDelayed(() -> {
presenter.getOtp();
}, 400);
}
}
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
return (securityKeyboardView.checkIfTouchIntersectKeypadLayout(ev) || gestureDetector.onTouchEvent(ev) || super.dispatchTouchEvent(ev));
}
private boolean checkIfTouchOutsiedRootView(float x, float y) {
int posX = (int) x;
int posY = (int) y;
int[] rootViewLeftAndTopCoordinates = new int[2];
rootView.getLocationOnScreen(rootViewLeftAndTopCoordinates);
Rect rootViewBoundRect = new Rect(rootViewLeftAndTopCoordinates[0], rootViewLeftAndTopCoordinates[1],
rootViewLeftAndTopCoordinates[0] + rootView.getMeasuredWidth(),
rootViewLeftAndTopCoordinates[1] + rootView.getMeasuredHeight());
return !rootViewBoundRect.contains(posX, posY);
}
@Override
protected void onStart() {
super.onStart();
securityKeyboardView.setSecurityKeyboardFocusStateListener(this);
if (presenter.checkIfRequiredOTPScreen())
resendRequest.setOnClickListener(this);
else
presenter.startObservingFingerPrintIfRequired(true);
}
@Override
protected void onStop() {
super.onStop();
securityKeyboardView.setSecurityKeyboardFocusStateListener(null);
if (presenter.checkIfRequiredOTPScreen())
resendRequest.setOnClickListener(null);
else
presenter.startObservingFingerPrintIfRequired(false);
}
@Override
protected void onResume() {
super.onResume();
}
@Override
protected void onPause() {
super.onPause();
}
@SuppressLint("NewApi")
@Override
public void animateFingerPrintAppearAnimationIfRequired(boolean action) {
if (action) {
if (fingerPrintAVDCompat != null && !fingerPrintAVDCompat.isRunning()) {
passwordPromptImageView.setImageDrawable(fingerPrintAVDCompat);
fingerPrintAVDCompat.start();
}
} else {
passwordPromptImageView.setImageDrawable(null);
}
}
@Override
public void setupAutoDebitTxnPasswordPromptView() {
SecurityKeypadRequestParamBuilder request = new SecurityKeypadRequestParamBuilder(this);
request.disableKeyPadEffect(false);
request.setKeypadType(TransKeyActivity.mTK_TYPE_KEYPAD_NUMBER);
request.setHintString(getString(R.string.otp_password_hint_text));
title.setText(getString(R.string.enter_otp_password_text));
request.setMaxLength(4);
ballonView.setVisibility(View.INVISIBLE);
securityKeyboardManager.bindWithSecurityWidgetView(securityKeyboardView)
.setBallonView(ballonView)
.setKeyboardContainer(keypadContainer)
.setRequestParams(request)
.setActionListener(securityKeypadListener)
.build();
}
@Override
public void setupWalletTxnPasswordPromptView() {
SecurityKeypadRequestParamBuilder request = new SecurityKeypadRequestParamBuilder(this);
request.disableKeyPadEffect(false);
request.setHintString(getString(R.string.password_text));
title.setText(getString(R.string.enter_login_password_text));
resendRequest.setVisibility(View.INVISIBLE);
securityKeyboardManager.bindWithSecurityWidgetView(securityKeyboardView)
.setBallonView(ballonView)
.setKeyboardContainer(keypadContainer)
.setRequestParams(request)
.setActionListener(securityKeypadListener)
.build();
}
@Override
public void addFingerprintIcon(boolean action) {
if (action) {
orTextView.setVisibility(View.VISIBLE);
passwordPromptImageView.setImageResource(0);
passwordPromptImageView.setImageDrawable(null);
if (fingerPrintAVDCompat == null)
fingerPrintAVDCompat = AnimatedVectorDrawableCompat.create(this, R.drawable.avd_fp);
} else {
orTextView.setVisibility(View.GONE);
fingerPrintAVDCompat = null;
passwordPromptImageView.setImageResource(0);
passwordPromptImageView.setImageDrawable(null);
passwordPromptImageView.setImageResource(R.drawable.ic_penny_test_pending);
}
}
@Override
public void clearImageView() {
passwordPromptImageView.setImageResource(0);
passwordPromptImageView.setImageDrawable(null);
}
@Override
public void onSecurityViewRecievedFocus() {
if (securityKeyboardManager != null && !securityKeyboardManager.isKeyboardVisible())
securityKeyboardManager.showKeyboard();
}
@Override
public void onSecurityViewLostFocus() {
}
@Override
public void startCountdownView(long durationMillisecond) {
countDownTimer = new CountDownTimer(durationMillisecond, 1000) {
int redColor = ContextCompat.getColor(TransactionPasswordPromptActivity.this, R.color.colorPrimary);
int grayColor = ContextCompat.getColor(TransactionPasswordPromptActivity.this, R.color.darkgray2);
@Override
public void onTick(long millisUntilFinished) {
presenter.updateCountdown(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);
presenter.updateCountdown(-1);
}
};
countDownTimer.start();
}
private void updateIntentOnCanellationAndFinish() {
boolean result = presenter.checkIfRequiredOTPScreen();
if (result) {
Intent backIntent = new Intent();
setResult(RESULT_CANCELED, backIntent);
backIntent.putExtra(OTP_COUNTDOWN_VALUE, presenter.getLatestCountDownValue());
}
finish();
}
@Override
public void showResendRequestView(boolean action) {
if (resendRequest.getVisibility() != View.VISIBLE)
resendRequest.setVisibility(View.VISIBLE);
if (action) {
if (countDownTimer != null)
countDownTimer.cancel();
presenter.updateCountdown(-1);
resendRequest.setText(getString(R.string.resend_request_text));
resendRequest.setOnClickListener(this);
} else {
resendRequest.setText("");
resendRequest.setOnClickListener(null);
}
}
@Override
public Context getContext() {
return this;
}
@Override
public void onBiometricAuthSuccess(String decPassword) {
Intent returnIntent = new Intent();
returnIntent.putExtra(TRANSACTION_PWD_ENC_DATA, decPassword);
setResult(Activity.RESULT_OK, returnIntent);
finish();
}
@Override
public void onBackPressed() {
updateIntentOnCanellationAndFinish();
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.resend_request:
this.presenter.getOtp();
break;
}
}
class SecurityKeypadListener implements SecurityKeyboardManager.SecurityKeyboardActionListenerFacade {
@Override
public void done(Intent intent) {
String encData = intent.getStringExtra(TransKeyActivity.mTK_PARAM_SECURE_DATA);
if (validateStringNotEmpty(encData)) {
passwordErrorTxt.setErrorText(null);
Intent returnIntent = new Intent();
returnIntent.putExtra(TRANSACTION_PWD_ENC_DATA, encData);
setResult(Activity.RESULT_OK, returnIntent);
finish();
} else {
if (presenter.checkIfRequiredOTPScreen())
passwordErrorTxt.setErrorText(getString(R.string.otp_empty_error));
else
passwordErrorTxt.setErrorText(getString(R.string.password_empty_error));
if (securityKeyboardManager != null && !securityKeyboardManager.isKeyboardVisible())
securityKeyboardManager.showKeyboard();
}
}
@Override
public void cancel(Intent intent) {
updateIntentOnCanellationAndFinish();
}
private boolean validateStringNotEmpty(String data) {
return (data != null && data.length() > 0);
}
@Override
public void input(int i) {
}
@Override
public void minTextSizeCallback() {
}
@Override
public void maxTextSizeCallback() {
}
}
class TransactionPasswordPromptActivityGestureDetector extends GestureDetector.SimpleOnGestureListener {
@Override
public boolean onSingleTapUp(MotionEvent e) {
if (e.getAction() == MotionEvent.ACTION_UP) {
boolean hasToucheOutsideTheView = checkIfTouchOutsiedRootView(e.getX(), e.getY());
if (hasToucheOutsideTheView)
updateIntentOnCanellationAndFinish();
return hasToucheOutsideTheView;
}
return super.onSingleTapUp(e);
}
}
}

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

@ -276,13 +276,14 @@
android:textColor="@color/black"
app:txtfontName="@string/semibold" />
<Button
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeButton
android:id="@+id/btn_ok"
android:layout_width="300dp"
android:layout_height="45dp"
style="@style/gme_button"
android:layout_width="@dimen/_200sdp"
android:layout_gravity="center"
android:layout_marginTop="20dp"
android:layout_marginBottom="30dp"
android:layout_marginTop="@dimen/_15sdp"
android:layout_marginBottom="@dimen/_20sdp"
android:background="@drawable/ic_rounded_background_red_coloured"
android:enabled="true"
android:text="@string/continue_text"
@ -290,14 +291,15 @@
android:textColor="@color/white"
android:textSize="16sp" />
<Button
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeButton
style="@style/gme_button"
android:visibility="gone"
android:id="@+id/btn_submit"
android:layout_width="300dp"
android:layout_height="45dp"
android:layout_width="@dimen/_200sdp"
android:layout_gravity="center"
android:layout_marginTop="20dp"
android:layout_marginBottom="30dp"
android:layout_marginTop="@dimen/_15sdp"
android:layout_marginBottom="@dimen/_20sdp"
android:background="@drawable/ic_rounded_background_red_coloured"
android:enabled="false"
android:text="@string/proceed_text"

19
app/src/main/res/layout/activity_login_v2.xml

@ -118,17 +118,26 @@
android:layout_marginRight="13dp"
/>
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView
<com.facebook.shimmer.ShimmerFrameLayout
android:layout_marginTop="@dimen/_5sdp"
android:layout_marginBottom="@dimen/_5sdp"
android:visibility="gone"
android:id="@+id/fingerprintScannerTxtView"
android:id="@+id/fingerprintScanner"
android:visibility="visible"
android:layout_gravity="center"
app:duration="2500"
android:padding="@dimen/_8sdp"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView
android:text="@string/use_fingerprint_text"
android:minHeight="48dp"
android:id="@+id/fingerprintScannerTxtView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:txtfontName="@string/regular"
android:textColor="@color/bluebg"
/>
</com.facebook.shimmer.ShimmerFrameLayout>
<FrameLayout
android:id="@+id/progressbar_login_container"

26
app/src/main/res/values/styles.xml

@ -1,12 +1,12 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<style name="AppTheme" parent="Theme.MaterialComponents.Light">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="bottomSheetDialogTheme">@style/AppBottomSheetDialogTheme</item>
<item name="bottomSheetDialogTheme">@style/RoundedBottomSheetDialog</item>
</style>
@ -169,6 +169,28 @@
</style>
<style name="RoundedBottomSheetDialog" parent="@style/ThemeOverlay.MaterialComponents.BottomSheetDialog">
<item name="bottomSheetStyle">@style/RoundedBottomSheet</item>
<item name="android:windowIsFloating">false</item> <!-- This is important -->
<item name="android:statusBarColor" tools:targetApi="lollipop">@android:color/transparent</item> <!-- And then this will be needed -->
<item name="android:navigationBarColor" tools:targetApi="lollipop">@android:color/white</item>
<item name="android:windowBackground">@drawable/bg_window_top_inset</item>
</style>
<style name="RoundedBottomSheet" parent="Widget.MaterialComponents.BottomSheet">
<item name="shapeAppearanceOverlay">@style/RoundedAppearanceBottomSheetDialog</item>
</style>
<style name="RoundedAppearanceBottomSheetDialog" parent="">
<item name="cornerFamily">rounded</item>
<item name="cornerSizeTopRight">@dimen/_10sdp</item>
<item name="cornerSizeTopLeft">@dimen/_10sdp</item>
<item name="cornerSizeBottomRight">0dp</item>
<item name="cornerSizeBottomLeft">0dp</item>
</style>
</resources>
Loading…
Cancel
Save