Fix focus

This commit is contained in:
J-Jamet
2021-08-23 11:11:11 +02:00
parent aef2ef8479
commit f34f615b80
3 changed files with 6 additions and 5 deletions

View File

@@ -45,7 +45,7 @@
android:label="@string/app_name"
android:launchMode="singleTop"
android:configChanges="keyboardHidden"
android:windowSoftInputMode="stateHidden" >
android:windowSoftInputMode="stateHidden|stateAlwaysHidden" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />

View File

@@ -268,7 +268,7 @@ open class PasswordActivity : DatabaseModeActivity(), AdvancedUnlockFragment.Bui
if (result.isSuccess) {
launchGroupActivityIfLoaded(database)
} else {
passwordView?.requestFocus()
passwordView?.requestFocusFromTouch()
var resultError = ""
val resultException = result.exception
@@ -443,9 +443,8 @@ open class PasswordActivity : DatabaseModeActivity(), AdvancedUnlockFragment.Bui
// Auto select the password field and open keyboard
passwordView?.requestFocusFromTouch()
val imm: InputMethodManager? =
getSystemService(INPUT_METHOD_SERVICE) as? InputMethodManager?
imm?.showSoftInput(passwordView, InputMethodManager.SHOW_IMPLICIT)
val inputMethodManager = getSystemService(INPUT_METHOD_SERVICE) as? InputMethodManager?
inputMethodManager?.showSoftInput(passwordView, InputMethodManager.SHOW_IMPLICIT)
}
private fun enableOrNotTheConfirmationButton() {

View File

@@ -160,6 +160,8 @@
android:inputType="textPassword"
android:importantForAccessibility="no"
android:importantForAutofill="yes"
android:focusable="true"
android:focusableInTouchMode="true"
android:autofillHints="password"
android:imeOptions="actionDone|flagNoPersonalizedLearning"
android:maxLines="1"/>