Taping the dialed number allows editing.
Previously, taping the dialed number used to dial the number.
Now if non-empty, a cursor shows up at the tap location.
The user can then use the dialpad to delete/insert new numbers.
The previous version of the selectors that drive the number background
has been moved to the non finger drawable because they show the right
background when focused.
In touch mode, the background does not change when focused.
Bug:2160189
diff --git a/src/com/android/contacts/TwelveKeyDialer.java b/src/com/android/contacts/TwelveKeyDialer.java
index 58ba9d8..176997a 100644
--- a/src/com/android/contacts/TwelveKeyDialer.java
+++ b/src/com/android/contacts/TwelveKeyDialer.java
@@ -162,6 +162,7 @@
if (notEmpty) {
mDigits.setBackgroundDrawable(mDigitsBackground);
} else {
+ mDigits.setCursorVisible(false);
mDigits.setBackgroundDrawable(mDigitsEmptyBackground);
}
@@ -184,6 +185,8 @@
mDigits.setKeyListener(DialerKeyListener.getInstance());
mDigits.setOnClickListener(this);
mDigits.setOnKeyListener(this);
+ mDigits.setInputType(android.text.InputType.TYPE_NULL); // Don't show IME when focused.
+
maybeAddNumberFormatting();
// Check for the presence of the keypad
@@ -656,8 +659,7 @@
keyPressed(KeyEvent.KEYCODE_DEL);
return;
}
- case R.id.dialButton:
- case R.id.digits: {
+ case R.id.dialButton: {
vibrate(); // Vibrate here too, just like we do for the regular keys
placeCall();
return;
@@ -667,6 +669,12 @@
vibrate();
return;
}
+ case R.id.digits: {
+ if (mDigits.length() != 0) {
+ mDigits.setCursorVisible(true);
+ }
+ return;
+ }
}
}