From 1c02a9b2ecf48c888e1d41384a43cde5816b1768 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Thu, 20 Jan 2022 23:42:54 +0530 Subject: [PATCH] PasswordDialog: request focus on the password entry input --- app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordDialog.kt | 2 ++ app/src/main/res/layout/dialog_password_entry.xml | 1 + 2 files changed, 3 insertions(+) diff --git a/app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordDialog.kt b/app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordDialog.kt index c66fa7e74..d69a4686e 100644 --- a/app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordDialog.kt +++ b/app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordDialog.kt @@ -9,6 +9,7 @@ import android.app.Dialog import android.content.DialogInterface import android.os.Bundle import android.view.KeyEvent +import android.view.WindowManager import androidx.core.widget.doOnTextChanged import androidx.fragment.app.DialogFragment import com.google.android.material.dialog.MaterialAlertDialogBuilder @@ -33,6 +34,7 @@ class PasswordDialog : DialogFragment() { builder.setTitle(R.string.password) builder.setPositiveButton(android.R.string.ok) { _, _ -> tryEmitPassword() } val dialog = builder.create() + dialog.window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) dialog.setOnShowListener { if (isError) { binding.passwordField.error = getString(R.string.git_operation_wrong_password) diff --git a/app/src/main/res/layout/dialog_password_entry.xml b/app/src/main/res/layout/dialog_password_entry.xml index 3729fb4f2..0072d4910 100644 --- a/app/src/main/res/layout/dialog_password_entry.xml +++ b/app/src/main/res/layout/dialog_password_entry.xml @@ -24,6 +24,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="textPassword" /> +