mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-04-26 16:56:09 +00:00
Merge pull request #527 from alexbakker/fix-131
Automatically focus the EditText when showing text/password dialogs
This commit is contained in:
commit
be0529a0c8
3 changed files with 8 additions and 4 deletions
|
@ -6,10 +6,8 @@ import android.content.ClipData;
|
|||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.Color;
|
||||
import android.provider.Settings;
|
||||
import android.text.Editable;
|
||||
import android.text.InputType;
|
||||
import android.text.TextWatcher;
|
||||
|
@ -124,6 +122,7 @@ public class Dialogs {
|
|||
.setPositiveButton(android.R.string.ok, null)
|
||||
.setNegativeButton(android.R.string.cancel, null)
|
||||
.create();
|
||||
dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
|
||||
|
||||
final AtomicReference<Button> buttonOK = new AtomicReference<>();
|
||||
dialog.setOnShowListener(d -> {
|
||||
|
@ -208,6 +207,7 @@ public class Dialogs {
|
|||
}
|
||||
|
||||
AlertDialog dialog = builder.create();
|
||||
dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
|
||||
showSecureDialog(dialog);
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,9 @@
|
|||
android:hint="@string/password"
|
||||
android:inputType="textPassword"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="wrap_content">
|
||||
<requestFocus/>
|
||||
</EditText>
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
|
|
|
@ -9,5 +9,7 @@
|
|||
<EditText
|
||||
android:id="@+id/text_input"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="wrap_content">
|
||||
<requestFocus/>
|
||||
</EditText>
|
||||
</LinearLayout>
|
||||
|
|
Loading…
Add table
Reference in a new issue