diff --git a/luhn/src/main/java/xyz/belvi/luhn/Luhn.java b/luhn/src/main/java/xyz/belvi/luhn/Luhn.java index 9b06933..71e85d5 100755 --- a/luhn/src/main/java/xyz/belvi/luhn/Luhn.java +++ b/luhn/src/main/java/xyz/belvi/luhn/Luhn.java @@ -72,6 +72,13 @@ public static void startLuhn(Context context, LuhnCallback luhnCallback, @StyleR ); } + public static void startLuhn(Context context, LuhnCallback luhnCallback, Bundle cardIOBundle) { + sLuhnCallback = luhnCallback; + context.startActivity(new Intent(context, Luhn.class) + .putExtra(CARD_IO, cardIOBundle) + ); + } + public static void startLuhn(Context context, LuhnCallback luhnCallback, Bundle cardIOBundle, @StyleRes int style) { sLuhnCallback = luhnCallback; context.startActivity(new Intent(context, Luhn.class) @@ -387,6 +394,7 @@ private void initOtp(final int otpLength) { @Override public void run() { otpInputLayout.requestFocus(); + showKeyboard(); otpInputLayout.getPasswordToggleView().setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -459,6 +467,14 @@ private void hideKeyboard() { } } + private void showKeyboard() { + View view = this.getCurrentFocus(); + if (view != null) { + InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + imm.showSoftInput(view, 0); + } + } + private void dismiss(View v) { bottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED); }