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/res/drawable-finger/btn_dial_textfield.xml b/res/drawable-finger/btn_dial_textfield.xml
index 4eabf18..109f6ae 100644
--- a/res/drawable-finger/btn_dial_textfield.xml
+++ b/res/drawable-finger/btn_dial_textfield.xml
@@ -15,10 +15,10 @@
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_pressed="true"
+ <item android:state_pressed="true"
android:drawable="@drawable/btn_dial_textfield_pressed" />
<item android:state_focused="true"
- android:drawable="@drawable/btn_dial_textfield_selected" />
+ android:drawable="@drawable/btn_dial_textfield_normal" />
<item
android:drawable="@drawable/btn_dial_textfield_normal" />
</selector>
diff --git a/res/drawable-finger/btn_dial_textfield_active.xml b/res/drawable-finger/btn_dial_textfield_active.xml
index 18b84c6..246d543 100644
--- a/res/drawable-finger/btn_dial_textfield_active.xml
+++ b/res/drawable-finger/btn_dial_textfield_active.xml
@@ -15,10 +15,10 @@
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_pressed="true"
+ <item android:state_pressed="true"
android:drawable="@drawable/btn_dial_textfield_pressed" />
<item android:state_focused="true"
- android:drawable="@drawable/btn_dial_textfield_selected" />
+ android:drawable="@drawable/btn_dial_textfield_activated" />
<item
android:drawable="@drawable/btn_dial_textfield_activated" />
</selector>
diff --git a/res/drawable/btn_dial_textfield.xml b/res/drawable/btn_dial_textfield.xml
new file mode 100644
index 0000000..de914cf
--- /dev/null
+++ b/res/drawable/btn_dial_textfield.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true"
+ android:drawable="@drawable/btn_dial_textfield_pressed" />
+ <item android:state_focused="true"
+ android:drawable="@drawable/btn_dial_textfield_selected" />
+ <item
+ android:drawable="@drawable/btn_dial_textfield_normal" />
+</selector>
+
diff --git a/res/drawable/btn_dial_textfield_active.xml b/res/drawable/btn_dial_textfield_active.xml
new file mode 100644
index 0000000..f3af301
--- /dev/null
+++ b/res/drawable/btn_dial_textfield_active.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true"
+ android:drawable="@drawable/btn_dial_textfield_pressed" />
+ <item android:state_focused="true"
+ android:drawable="@drawable/btn_dial_textfield_selected" />
+ <item
+ android:drawable="@drawable/btn_dial_textfield_activated" />
+</selector>
+
diff --git a/res/layout-finger/twelve_key_dialer.xml b/res/layout-finger/twelve_key_dialer.xml
index 83eb2cf..3550444 100644
--- a/res/layout-finger/twelve_key_dialer.xml
+++ b/res/layout-finger/twelve_key_dialer.xml
@@ -34,7 +34,9 @@
android:freezesText="true"
android:background="@drawable/btn_dial_textfield"
android:textColor="@color/dialer_button_text"
- android:focusableInTouchMode="false"
+ android:focusableInTouchMode="true"
+ android:editable="true"
+ android:cursorVisible="false"
/>
<!-- Keypad section -->
diff --git a/res/layout-long-finger/twelve_key_dialer.xml b/res/layout-long-finger/twelve_key_dialer.xml
index 77f471e..d1d0f37 100644
--- a/res/layout-long-finger/twelve_key_dialer.xml
+++ b/res/layout-long-finger/twelve_key_dialer.xml
@@ -34,7 +34,9 @@
android:freezesText="true"
android:background="@drawable/btn_dial_textfield"
android:textColor="@color/dialer_button_text"
- android:focusableInTouchMode="false"
+ android:focusableInTouchMode="true"
+ android:editable="true"
+ android:cursorVisible="false"
/>
<!-- Keypad section -->
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;
+ }
}
}