diff options
author | Eric Erfanian <erfanian@google.com> | 2017-04-06 23:16:42 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-04-06 23:16:42 +0000 |
commit | 28188020060d1ad3304dfa0367486ff5bb35da62 (patch) | |
tree | 8d08d4f2292aa84dc435d455891e7ab633d95a25 /java/com/android/dialer/callcomposer/MessageComposerFragment.java | |
parent | 34e183cfd77f68e0ade42d2080c76f54a319430d (diff) | |
parent | 01a86435499d66b267765f89b7dd9c83c158ddfe (diff) |
Update AOSP Dialer source from internal google3 repository at cl/152373142. am: d8046e520a
am: 01a8643549
Change-Id: Ib92542e6b88bc8d8906982280244661ed7dbca8f
Diffstat (limited to 'java/com/android/dialer/callcomposer/MessageComposerFragment.java')
-rw-r--r-- | java/com/android/dialer/callcomposer/MessageComposerFragment.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/java/com/android/dialer/callcomposer/MessageComposerFragment.java b/java/com/android/dialer/callcomposer/MessageComposerFragment.java index d8100033f..2a342bb08 100644 --- a/java/com/android/dialer/callcomposer/MessageComposerFragment.java +++ b/java/com/android/dialer/callcomposer/MessageComposerFragment.java @@ -22,6 +22,7 @@ import android.text.Editable; import android.text.InputFilter; import android.text.TextUtils; import android.text.TextWatcher; +import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; @@ -31,10 +32,15 @@ import android.view.View.OnTouchListener; import android.view.ViewGroup; import android.widget.EditText; import android.widget.TextView; +import android.widget.TextView.OnEditorActionListener; /** Fragment used to compose call with message fragment. */ public class MessageComposerFragment extends CallComposerFragment - implements OnClickListener, TextWatcher, OnTouchListener, OnLongClickListener { + implements OnClickListener, + TextWatcher, + OnTouchListener, + OnLongClickListener, + OnEditorActionListener { private static final String CHAR_LIMIT_KEY = "char_limit"; public static final int NO_CHAR_LIMIT = -1; @@ -70,6 +76,7 @@ public class MessageComposerFragment extends CallComposerFragment customMessage.setOnTouchListener(this); customMessage.setOnLongClickListener(this); customMessage.addTextChangedListener(this); + customMessage.setOnEditorActionListener(this); if (charLimit != NO_CHAR_LIMIT) { TextView remainingChar = (TextView) view.findViewById(R.id.remaining_characters); remainingChar.setText("" + charLimit); @@ -144,4 +151,13 @@ public class MessageComposerFragment extends CallComposerFragment public void clearComposer() { customMessage.getText().clear(); } + + @Override + public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { + if (getMessage() == null) { + return false; + } + getListener().sendAndCall(); + return true; + } } |