Skip to content

Commit dca2ade

Browse files
committed
fix: WebUI — the keyboard shows for text fields of the camera's page (#120)
1 parent b2da67f commit dca2ade

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎android/app/src/main/java/com/openipc/decoder/MenuManager.java‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,18 @@ public void onReceivedHttpAuthRequest(
530530
});
531531
mBrowserDialog = dialog;
532532
dialog.show();
533+
// AlertDialog marks its window "no input method" when its content has no EditText,
534+
// and a WebView is not one: text fields of the camera's page then got no keyboard
535+
// (#120). Clear that, and let the page take the focus for its fields
536+
android.view.Window w = dialog.getWindow();
537+
if (w != null) {
538+
w.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
539+
| WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
540+
w.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
541+
}
542+
view.setFocusable(true);
543+
view.setFocusableInTouchMode(true);
544+
view.requestFocus(View.FOCUS_DOWN);
533545
view.loadUrl(scheme + "://" + link);
534546
}
535547

0 commit comments

Comments
 (0)