Always show keyboard implicit

This commit is contained in:
M66B
2021-04-29 09:46:50 +02:00
parent f98dcd4fd7
commit 9ccef2608f
4 changed files with 28 additions and 34 deletions

View File

@@ -924,34 +924,6 @@ public class Helper {
return color;
}
static void showKeyboard(final View view) {
final InputMethodManager imm =
(InputMethodManager) view.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm == null)
return;
if (view.hasFocus())
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
final View.OnFocusChangeListener listener = view.getOnFocusChangeListener();
view.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (listener != null)
listener.onFocusChange(v, hasFocus);
if (hasFocus)
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
else
imm.toggleSoftInput(0, 0);
}
});
if (!view.hasFocus())
view.requestFocus();
}
static void hideKeyboard(final View view) {
InputMethodManager imm =
(InputMethodManager) view.getContext().getSystemService(Activity.INPUT_METHOD_SERVICE);