OSDN Git Service

Taping the dialed number allows editing.
authorNicolas Catania <niko@google.com>
Thu, 1 Oct 2009 20:00:53 +0000 (13:00 -0700)
committerNicolas Catania <niko@google.com>
Fri, 2 Oct 2009 17:21:04 +0000 (10:21 -0700)
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

res/drawable-finger/btn_dial_textfield.xml
res/drawable-finger/btn_dial_textfield_active.xml
res/drawable/btn_dial_textfield.xml [new file with mode: 0644]
res/drawable/btn_dial_textfield_active.xml [new file with mode: 0644]
res/layout-finger/twelve_key_dialer.xml
res/layout-long-finger/twelve_key_dialer.xml
src/com/android/contacts/TwelveKeyDialer.java

index 4eabf18..109f6ae 100644 (file)
 -->
 
 <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>
index 18b84c6..246d543 100644 (file)
 -->
 
 <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 (file)
index 0000000..de914cf
--- /dev/null
@@ -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 (file)
index 0000000..f3af301
--- /dev/null
@@ -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>
+
index 83eb2cf..3550444 100644 (file)
@@ -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 -->
index 77f471e..d1d0f37 100644 (file)
@@ -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 -->
index 58ba9d8..176997a 100644 (file)
@@ -162,6 +162,7 @@ public class TwelveKeyDialer extends Activity implements View.OnClickListener,
         if (notEmpty) {
             mDigits.setBackgroundDrawable(mDigitsBackground);
         } else {
+            mDigits.setCursorVisible(false);
             mDigits.setBackgroundDrawable(mDigitsEmptyBackground);
         }
 
@@ -184,6 +185,8 @@ public class TwelveKeyDialer extends Activity implements View.OnClickListener,
         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 @@ public class TwelveKeyDialer extends Activity implements View.OnClickListener,
                 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 @@ public class TwelveKeyDialer extends Activity implements View.OnClickListener,
                 vibrate();
                 return;
             }
+            case R.id.digits: {
+                if (mDigits.length() != 0) {
+                    mDigits.setCursorVisible(true);
+                }
+                return;
+            }
         }
     }