Merge "DirectReply: Send button was wrongly actionable on empty field" into nyc-dev

am: 47d849da9f

* commit '47d849da9f848a8fc3121aca58695890e9eb8969':
  DirectReply: Send button was wrongly actionable on empty field

Change-Id: Iddd37c9435c070c1aee9c95fd0fef3b1a5c1f56e
This commit is contained in:
Adrian Roos
2016-04-29 21:35:05 +00:00
committed by android-build-merger

View File

@@ -91,8 +91,6 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
mEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
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
&& (actionId == EditorInfo.IME_ACTION_DONE
|| actionId == EditorInfo.IME_ACTION_NEXT
@@ -102,7 +100,10 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
&& event.getAction() == KeyEvent.ACTION_DOWN;
if (isSoftImeEvent || isKeyboardEnterKey) {
sendRemoteInput();
if (mEditText.length() > 0) {
sendRemoteInput();
}
// Consume action to prevent IME from closing.
return true;
}
return false;