From 26e2ae950debe64389564c7c88911adae3bcf47a Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Wed, 30 Sep 2015 17:25:29 -0700 Subject: Use TextWatcher to update call type toggle. Bug: 24341350 Change-Id: I2c4a4d04f3ed400e8f619879d94a708d3b0c1cf3 --- .../dialer/tests/calllog/FillCallLogTestActivity.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'tests/src/com') 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. } }); -- cgit v1.2.3