Merge "DirectReply: Send button was wrongly actionable on empty field" into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
47d849da9f
@@ -91,8 +91,6 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
|
|||||||
mEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
mEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||||
|
|
||||||
// Check if this was the result of hitting the enter key
|
|
||||||
final boolean isSoftImeEvent = event == null
|
final boolean isSoftImeEvent = event == null
|
||||||
&& (actionId == EditorInfo.IME_ACTION_DONE
|
&& (actionId == EditorInfo.IME_ACTION_DONE
|
||||||
|| actionId == EditorInfo.IME_ACTION_NEXT
|
|| actionId == EditorInfo.IME_ACTION_NEXT
|
||||||
@@ -102,7 +100,10 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
|
|||||||
&& event.getAction() == KeyEvent.ACTION_DOWN;
|
&& event.getAction() == KeyEvent.ACTION_DOWN;
|
||||||
|
|
||||||
if (isSoftImeEvent || isKeyboardEnterKey) {
|
if (isSoftImeEvent || isKeyboardEnterKey) {
|
||||||
sendRemoteInput();
|
if (mEditText.length() > 0) {
|
||||||
|
sendRemoteInput();
|
||||||
|
}
|
||||||
|
// Consume action to prevent IME from closing.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user