mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Always show the keyboard when asked for it
and maintain keyboard state when hiding view.
This commit is contained in:
@@ -27,6 +27,7 @@ import org.thoughtcrime.securesms.components.emoji.EmojiToggle;
|
||||
import static android.content.Context.INPUT_METHOD_SERVICE;
|
||||
import static android.content.Context.LAYOUT_INFLATER_SERVICE;
|
||||
import static android.view.KeyEvent.KEYCODE_BACK;
|
||||
import static android.view.inputmethod.InputMethodManager.SHOW_FORCED;
|
||||
|
||||
@UiThread
|
||||
public class TextInputView extends KeyboardAwareLinearLayout
|
||||
@@ -107,6 +108,14 @@ public class TextInputView extends KeyboardAwareLinearLayout
|
||||
ui.emojiDrawer.setEmojiEventListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVisibility(int visibility) {
|
||||
if (visibility == GONE && isKeyboardOpen()) {
|
||||
onKeyboardClose();
|
||||
}
|
||||
super.setVisibility(visibility);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onKeyEvent(KeyEvent keyEvent) {
|
||||
ui.editText.dispatchKeyEvent(keyEvent);
|
||||
@@ -169,8 +178,10 @@ public class TextInputView extends KeyboardAwareLinearLayout
|
||||
@Override
|
||||
public void run() {
|
||||
ui.editText.requestFocus();
|
||||
Object o = getContext().getSystemService(INPUT_METHOD_SERVICE);
|
||||
((InputMethodManager) o).showSoftInput(ui.editText, 0);
|
||||
InputMethodManager imm =
|
||||
(InputMethodManager) getContext()
|
||||
.getSystemService(INPUT_METHOD_SERVICE);
|
||||
imm.showSoftInput(ui.editText, SHOW_FORCED);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user