mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Merge d00e6502b1 into 28fa7b1a20
This commit is contained in:
commit
2a8697743c
1 changed files with 7 additions and 8 deletions
|
|
@ -14,7 +14,6 @@ import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import android.view.inputmethod.InputMethodManager
|
import android.view.inputmethod.InputMethodManager
|
||||||
import android.widget.TextView
|
|
||||||
import androidx.annotation.ColorRes
|
import androidx.annotation.ColorRes
|
||||||
import androidx.annotation.StringRes
|
import androidx.annotation.StringRes
|
||||||
import androidx.annotation.VisibleForTesting
|
import androidx.annotation.VisibleForTesting
|
||||||
|
|
@ -284,11 +283,11 @@ class LoginActivity : AccountAuthenticatorActivity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun onEditorAction(textView: TextView, actionId: Int, keyEvent: KeyEvent?) =
|
// private fun onEditorAction(textView: TextView, actionId: Int, keyEvent: KeyEvent?) =
|
||||||
if (binding!!.loginButton.isEnabled && isTriggerAction(actionId, keyEvent)) {
|
// if (binding!!.loginButton.isEnabled && isTriggerAction(actionId, keyEvent)) {
|
||||||
performLogin()
|
// performLogin()
|
||||||
true
|
// true
|
||||||
} else false
|
// } else false
|
||||||
|
|
||||||
private fun isTriggerAction(actionId: Int, keyEvent: KeyEvent?) =
|
private fun isTriggerAction(actionId: Int, keyEvent: KeyEvent?) =
|
||||||
actionId == EditorInfo.IME_ACTION_NEXT || actionId == EditorInfo.IME_ACTION_DONE || keyEvent?.keyCode == KeyEvent.KEYCODE_ENTER
|
actionId == EditorInfo.IME_ACTION_NEXT || actionId == EditorInfo.IME_ACTION_DONE || keyEvent?.keyCode == KeyEvent.KEYCODE_ENTER
|
||||||
|
|
@ -472,8 +471,8 @@ class LoginActivity : AccountAuthenticatorActivity() {
|
||||||
|
|
||||||
private fun onTextChanged(text: String) {
|
private fun onTextChanged(text: String) {
|
||||||
val enabled =
|
val enabled =
|
||||||
binding!!.loginUsername.text!!.length != 0 && binding!!.loginPassword.text!!.length != 0 &&
|
binding!!.loginUsername.text!!.isNotEmpty() && binding!!.loginPassword.text!!.isNotEmpty() &&
|
||||||
(BuildConfig.DEBUG || binding!!.loginTwoFactor.text!!.length != 0 || binding!!.loginTwoFactor.visibility != View.VISIBLE)
|
(BuildConfig.DEBUG || binding!!.loginTwoFactor.text!!.isNotEmpty() || binding!!.loginTwoFactor.visibility != View.VISIBLE)
|
||||||
binding!!.loginButton.isEnabled = enabled
|
binding!!.loginButton.isEnabled = enabled
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue