mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-27 10:17:18 +00:00
Simplified PIN focus
This commit is contained in:
parent
0ca2bfcf45
commit
5945263f77
1 changed files with 14 additions and 31 deletions
|
@ -1377,8 +1377,12 @@ public class Helper {
|
|||
view.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Log.i("showKeyboard view=" + view);
|
||||
imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
|
||||
try {
|
||||
Log.i("showKeyboard view=" + view);
|
||||
imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
}
|
||||
}
|
||||
}, 250);
|
||||
}
|
||||
|
@ -1390,8 +1394,12 @@ public class Helper {
|
|||
if (imm == null)
|
||||
return;
|
||||
|
||||
Log.i("hideKeyboard view=" + view);
|
||||
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
|
||||
try {
|
||||
Log.i("hideKeyboard view=" + view);
|
||||
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
}
|
||||
}
|
||||
|
||||
static String getViewName(View view) {
|
||||
|
@ -2317,32 +2325,7 @@ public class Helper {
|
|||
@Override
|
||||
public void onFocusChange(View v, boolean hasFocus) {
|
||||
if (hasFocus)
|
||||
try {
|
||||
dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
/*
|
||||
java.lang.IllegalArgumentException: View=DecorView@f197613[ActivityMain] not attached to window manager
|
||||
at android.view.WindowManagerGlobal.findViewLocked(WindowManagerGlobal.java:604)
|
||||
at android.view.WindowManagerGlobal.updateViewLayout(WindowManagerGlobal.java:493)
|
||||
at android.view.WindowManagerImpl.updateViewLayout(WindowManagerImpl.java:121)
|
||||
at android.app.Dialog.onWindowAttributesChanged(Dialog.java:1072)
|
||||
at androidx.appcompat.view.WindowCallbackWrapper.onWindowAttributesChanged(WindowCallbackWrapper:114)
|
||||
at android.view.Window.dispatchWindowAttributesChanged(Window.java:1236)
|
||||
at com.android.internal.policy.PhoneWindow.dispatchWindowAttributesChanged(PhoneWindow.java:3229)
|
||||
at android.view.Window.setSoftInputMode(Window.java:1123)
|
||||
at eu.faircode.email.Helper$15.onFocusChange(Helper:2169)
|
||||
at android.view.View.onFocusChanged(View.java:8828)
|
||||
at android.widget.TextView.onFocusChanged(TextView.java:12091)
|
||||
at android.widget.EditText.onFocusChanged(EditText.java:248)
|
||||
at android.view.View.handleFocusGainInternal(View.java:8498)
|
||||
at android.view.View.requestFocusNoSearch(View.java:14103)
|
||||
at android.view.View.requestFocus(View.java:14077)
|
||||
at android.view.View.requestFocus(View.java:14044)
|
||||
at android.view.View.requestFocus(View.java:13986)
|
||||
at eu.faircode.email.Helper$16.run(Helper:2187)
|
||||
*/
|
||||
}
|
||||
showKeyboard(etPin);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -2355,7 +2338,7 @@ public class Helper {
|
|||
long wait = (long) Math.pow(PIN_FAILURE_DELAY, pin_failure_count) * 1000L;
|
||||
long delay = pin_failure_at + wait - new Date().getTime();
|
||||
Log.i("PIN wait=" + wait + " delay=" + delay);
|
||||
ApplicationEx.getMainHandler().postDelayed(new Runnable() {
|
||||
dview.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
etPin.setCompoundDrawables(null, null, null, null);
|
||||
|
|
Loading…
Reference in a new issue