mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-25 05:27:42 +00:00
Revert "Fix soft keyboard popping up when the text was selected when the other keyboard was open."
This reverts commit 6d41d1f6d2.
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
package org.thoughtcrime.securesms.components;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.text.InputType;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.EditText;
|
||||
|
||||
@@ -14,7 +12,6 @@ import org.thoughtcrime.securesms.util.ServiceUtil;
|
||||
|
||||
public class InputAwareLayout extends KeyboardAwareLinearLayout implements OnKeyboardShownListener {
|
||||
private InputView current;
|
||||
private int previousInputType = InputType.TYPE_NULL;
|
||||
|
||||
public InputAwareLayout(Context context) {
|
||||
this(context, null);
|
||||
@@ -47,8 +44,6 @@ public class InputAwareLayout extends KeyboardAwareLinearLayout implements OnKey
|
||||
input.show(getKeyboardHeight(), current != null);
|
||||
current = input;
|
||||
}
|
||||
|
||||
setShowSoftInputOnFocusCompat(imeTarget, false);
|
||||
}
|
||||
|
||||
public InputView getCurrentInput() {
|
||||
@@ -58,8 +53,6 @@ public class InputAwareLayout extends KeyboardAwareLinearLayout implements OnKey
|
||||
public void hideCurrentInput(EditText imeTarget) {
|
||||
if (isKeyboardOpen()) hideSoftkey(imeTarget, null);
|
||||
else hideAttachedInput(false);
|
||||
|
||||
setShowSoftInputOnFocusCompat(imeTarget, true);
|
||||
}
|
||||
|
||||
public void hideAttachedInput(boolean instant) {
|
||||
@@ -72,13 +65,6 @@ public class InputAwareLayout extends KeyboardAwareLinearLayout implements OnKey
|
||||
}
|
||||
|
||||
public void showSoftkey(final EditText inputTarget) {
|
||||
showSoftkey(inputTarget, false);
|
||||
}
|
||||
|
||||
public void showSoftkey(final EditText inputTarget, boolean force) {
|
||||
if (!force && isInputOpen()) return;
|
||||
|
||||
setShowSoftInputOnFocusCompat(inputTarget, true);
|
||||
postOnKeyboardOpen(new Runnable() {
|
||||
@Override public void run() {
|
||||
hideAttachedInput(true);
|
||||
@@ -99,20 +85,6 @@ public class InputAwareLayout extends KeyboardAwareLinearLayout implements OnKey
|
||||
.hideSoftInputFromWindow(inputTarget.getWindowToken(), 0);
|
||||
}
|
||||
|
||||
private void setShowSoftInputOnFocusCompat(EditText imeTarget, boolean show) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
imeTarget.setShowSoftInputOnFocus(show);
|
||||
} else if (show) {
|
||||
if (previousInputType != InputType.TYPE_NULL) {
|
||||
imeTarget.setInputType(previousInputType);
|
||||
}
|
||||
} else {
|
||||
previousInputType = imeTarget.getInputType();
|
||||
imeTarget.setRawInputType(InputType.TYPE_CLASS_TEXT);
|
||||
imeTarget.setTextIsSelectable(true);
|
||||
}
|
||||
}
|
||||
|
||||
public interface InputView {
|
||||
void show(int height, boolean immediate);
|
||||
void hide(boolean immediate);
|
||||
|
||||
@@ -3286,7 +3286,7 @@ public class ConversationParentFragment extends Fragment
|
||||
emojiDrawerStub.get().setFragmentManager(getChildFragmentManager());
|
||||
|
||||
if (container.getCurrentInput() == emojiDrawerStub.get()) {
|
||||
container.showSoftkey(composeText, true);
|
||||
container.showSoftkey(composeText);
|
||||
} else {
|
||||
container.show(composeText, emojiDrawerStub.get());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user