mirror of https://github.com/M66B/FairEmail.git
parent
dab05dc61f
commit
3505c1ae03
|
@ -1171,43 +1171,25 @@ public class Helper {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void showKeyboard(final View view) {
|
static void showKeyboard(final View view) {
|
||||||
Context context = view.getContext();
|
final Context context = view.getContext();
|
||||||
InputMethodManager imm =
|
InputMethodManager imm =
|
||||||
(InputMethodManager) context.getSystemService(Activity.INPUT_METHOD_SERVICE);
|
(InputMethodManager) context.getSystemService(Activity.INPUT_METHOD_SERVICE);
|
||||||
if (imm == null)
|
if (imm == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
view.post(new Runnable() {
|
Log.i("showKeyboard view=" + view);
|
||||||
@Override
|
imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
|
||||||
public void run() {
|
|
||||||
try {
|
|
||||||
Log.i("showKeyboard view=" + view);
|
|
||||||
imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
|
|
||||||
} catch (Throwable ex) {
|
|
||||||
Log.e(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void hideKeyboard(final View view) {
|
static void hideKeyboard(final View view) {
|
||||||
Context context = view.getContext();
|
final Context context = view.getContext();
|
||||||
InputMethodManager imm =
|
InputMethodManager imm =
|
||||||
(InputMethodManager) context.getSystemService(Activity.INPUT_METHOD_SERVICE);
|
(InputMethodManager) context.getSystemService(Activity.INPUT_METHOD_SERVICE);
|
||||||
if (imm == null)
|
if (imm == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
view.post(new Runnable() {
|
Log.i("hideKeyboard view=" + view);
|
||||||
@Override
|
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
|
||||||
public void run() {
|
|
||||||
try {
|
|
||||||
Log.i("hideKeyboard view=" + view);
|
|
||||||
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
|
|
||||||
} catch (Throwable ex) {
|
|
||||||
Log.e(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Formatting
|
// Formatting
|
||||||
|
|
Loading…
Reference in New Issue