summaryrefslogtreecommitdiff
path: root/tests/src/com
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2015-09-30 17:25:29 -0700
committerAndrew Lee <anwlee@google.com>2015-09-30 17:30:04 -0700
commit26e2ae950debe64389564c7c88911adae3bcf47a (patch)
tree3aa34810558affe3031b3490d8f588db77b2b7bc /tests/src/com
parent071d0a4f1c8cf6b6131b7aeabfd2c6b0560b413f (diff)
Use TextWatcher to update call type toggle.
Bug: 24341350 Change-Id: I2c4a4d04f3ed400e8f619879d94a708d3b0c1cf3
Diffstat (limited to 'tests/src/com')
-rw-r--r--tests/src/com/android/dialer/tests/calllog/FillCallLogTestActivity.java18
1 files changed, 15 insertions, 3 deletions
diff --git a/tests/src/com/android/dialer/tests/calllog/FillCallLogTestActivity.java b/tests/src/com/android/dialer/tests/calllog/FillCallLogTestActivity.java
index aa2d2653b..e499e550d 100644
--- a/tests/src/com/android/dialer/tests/calllog/FillCallLogTestActivity.java
+++ b/tests/src/com/android/dialer/tests/calllog/FillCallLogTestActivity.java
@@ -40,6 +40,8 @@ import android.provider.VoicemailContract.Voicemails;
import android.telecom.PhoneAccount;
import android.telecom.PhoneAccountHandle;
import android.telecom.TelecomManager;
+import android.text.Editable;
+import android.text.TextWatcher;
import android.text.format.DateFormat;
import android.util.Log;
import android.view.MotionEvent;
@@ -151,11 +153,21 @@ public class FillCallLogTestActivity extends Activity {
mAccount0 = (RadioButton) findViewById(R.id.account0);
mAccount1 = (RadioButton) findViewById(R.id.account1);
- mCustomCallTypeTextView.setOnTouchListener(new View.OnTouchListener() {
+ mCustomCallTypeTextView.addTextChangedListener(new TextWatcher() {
@Override
- public boolean onTouch(View v, MotionEvent event) {
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+ // Do nothing.
+ }
+
+ @Override
+ public void onTextChanged(CharSequence s, int start, int before, int count) {
+ // Toggle the custom call type radio button if the text is changed/focused.
mCallTypeCustom.toggle();
- return false;
+ }
+
+ @Override
+ public void afterTextChanged(Editable s) {
+ // Do nothing.
}
});