OSDN Git Service

Added backspace button.
authorNicolas Catania <niko@google.com>
Sun, 20 Sep 2009 17:56:40 +0000 (10:56 -0700)
committerNicolas Catania <niko@google.com>
Mon, 21 Sep 2009 16:24:17 +0000 (09:24 -0700)
Deleted old unused resource (delete active, normal, pressed, selected).

Renamed 'backspace' instances to 'delete' for consistency.
Removed the linear layout that used to hold the digit and backspace.

Bug 2104523

24 files changed:
res/drawable-finger/btn_dial_delete.xml
res/drawable-finger/btn_dial_delete_activated.9.png [deleted file]
res/drawable-finger/btn_dial_delete_active.xml [deleted file]
res/drawable-finger/btn_dial_delete_normal.9.png [deleted file]
res/drawable-finger/btn_dial_delete_pressed.9.png [deleted file]
res/drawable-finger/btn_dial_delete_selected.9.png [deleted file]
res/drawable-finger/ic_delete_phone_number.xml [deleted file]
res/drawable-finger/ic_delete_phone_number_blk.png [deleted file]
res/drawable-finger/ic_delete_phone_number_wht.png [deleted file]
res/drawable-hdpi-finger/btn_dial_action_right_disable.9.png [new file with mode: 0755]
res/drawable-hdpi-finger/btn_dial_action_right_disable_focused.9.png [new file with mode: 0755]
res/drawable-hdpi-finger/btn_dial_action_right_normal.9.png [new file with mode: 0755]
res/drawable-hdpi-finger/btn_dial_action_right_pressed.9.png [new file with mode: 0755]
res/drawable-hdpi-finger/btn_dial_action_right_selected.9.png [new file with mode: 0755]
res/drawable-hdpi-finger/ic_dial_action_delete.png [new file with mode: 0755]
res/drawable-mdpi-finger/btn_dial_action_right_disable.9.png [new file with mode: 0755]
res/drawable-mdpi-finger/btn_dial_action_right_disable_focused.9.png [new file with mode: 0755]
res/drawable-mdpi-finger/btn_dial_action_right_normal.9.png [new file with mode: 0755]
res/drawable-mdpi-finger/btn_dial_action_right_pressed.9.png [new file with mode: 0755]
res/drawable-mdpi-finger/btn_dial_action_right_selected.9.png [new file with mode: 0755]
res/drawable-mdpi-finger/ic_dial_action_delete.png [new file with mode: 0755]
res/layout-finger/twelve_key_dialer.xml
res/layout-land-finger/twelve_key_dialer.xml
src/com/android/contacts/TwelveKeyDialer.java

index 235554d..b8c672d 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2008 The Android Open Source Project
+<!-- 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.
      limitations under the License.
 -->
 
+<!-- Background resource for backspace button for the various 12 key dialers. -->
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_pressed="true" 
-        android:drawable="@drawable/btn_dial_delete_pressed" />
-    <item android:state_focused="true"
-        android:drawable="@drawable/btn_dial_delete_selected" />
-    <item
-        android:drawable="@drawable/btn_dial_delete_normal" />
+    <!-- Disabled views -->
+    <item android:state_focused="true" android:state_enabled="false"
+        android:drawable="@drawable/btn_dial_action_right_disable_focused" />
+    <item android:state_enabled="false"
+        android:drawable="@drawable/btn_dial_action_right_disable" />
+
+    <!-- Enabled views -->
+    <item android:state_pressed="true" android:state_enabled="true"
+        android:drawable="@drawable/btn_dial_action_right_pressed" />
+    <item android:state_focused="true" android:state_enabled="true"
+        android:drawable="@drawable/btn_dial_action_right_selected" />
+    <item android:state_enabled="true"
+        android:drawable="@drawable/btn_dial_action_right_normal" />
 </selector>
 
diff --git a/res/drawable-finger/btn_dial_delete_activated.9.png b/res/drawable-finger/btn_dial_delete_activated.9.png
deleted file mode 100644 (file)
index 453a368..0000000
Binary files a/res/drawable-finger/btn_dial_delete_activated.9.png and /dev/null differ
diff --git a/res/drawable-finger/btn_dial_delete_active.xml b/res/drawable-finger/btn_dial_delete_active.xml
deleted file mode 100644 (file)
index 3403f34..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2008 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_delete_pressed" />
-    <item android:state_focused="true"
-        android:drawable="@drawable/btn_dial_delete_selected" />
-    <item
-        android:drawable="@drawable/btn_dial_delete_activated" />
-</selector>
-
diff --git a/res/drawable-finger/btn_dial_delete_normal.9.png b/res/drawable-finger/btn_dial_delete_normal.9.png
deleted file mode 100644 (file)
index 9da1cff..0000000
Binary files a/res/drawable-finger/btn_dial_delete_normal.9.png and /dev/null differ
diff --git a/res/drawable-finger/btn_dial_delete_pressed.9.png b/res/drawable-finger/btn_dial_delete_pressed.9.png
deleted file mode 100644 (file)
index 5bbc20d..0000000
Binary files a/res/drawable-finger/btn_dial_delete_pressed.9.png and /dev/null differ
diff --git a/res/drawable-finger/btn_dial_delete_selected.9.png b/res/drawable-finger/btn_dial_delete_selected.9.png
deleted file mode 100644 (file)
index d959768..0000000
Binary files a/res/drawable-finger/btn_dial_delete_selected.9.png and /dev/null differ
diff --git a/res/drawable-finger/ic_delete_phone_number.xml b/res/drawable-finger/ic_delete_phone_number.xml
deleted file mode 100644 (file)
index adfc0ce..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2008 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/ic_delete_phone_number_blk" />
-    <item android:state_focused="true"
-        android:drawable="@drawable/ic_delete_phone_number_blk" />
-    <item
-        android:drawable="@drawable/ic_delete_phone_number_wht" />
-</selector>
-
diff --git a/res/drawable-finger/ic_delete_phone_number_blk.png b/res/drawable-finger/ic_delete_phone_number_blk.png
deleted file mode 100644 (file)
index 2e83d36..0000000
Binary files a/res/drawable-finger/ic_delete_phone_number_blk.png and /dev/null differ
diff --git a/res/drawable-finger/ic_delete_phone_number_wht.png b/res/drawable-finger/ic_delete_phone_number_wht.png
deleted file mode 100644 (file)
index 988bcfd..0000000
Binary files a/res/drawable-finger/ic_delete_phone_number_wht.png and /dev/null differ
diff --git a/res/drawable-hdpi-finger/btn_dial_action_right_disable.9.png b/res/drawable-hdpi-finger/btn_dial_action_right_disable.9.png
new file mode 100755 (executable)
index 0000000..6e6fa30
Binary files /dev/null and b/res/drawable-hdpi-finger/btn_dial_action_right_disable.9.png differ
diff --git a/res/drawable-hdpi-finger/btn_dial_action_right_disable_focused.9.png b/res/drawable-hdpi-finger/btn_dial_action_right_disable_focused.9.png
new file mode 100755 (executable)
index 0000000..46a042f
Binary files /dev/null and b/res/drawable-hdpi-finger/btn_dial_action_right_disable_focused.9.png differ
diff --git a/res/drawable-hdpi-finger/btn_dial_action_right_normal.9.png b/res/drawable-hdpi-finger/btn_dial_action_right_normal.9.png
new file mode 100755 (executable)
index 0000000..6e6fa30
Binary files /dev/null and b/res/drawable-hdpi-finger/btn_dial_action_right_normal.9.png differ
diff --git a/res/drawable-hdpi-finger/btn_dial_action_right_pressed.9.png b/res/drawable-hdpi-finger/btn_dial_action_right_pressed.9.png
new file mode 100755 (executable)
index 0000000..d66a509
Binary files /dev/null and b/res/drawable-hdpi-finger/btn_dial_action_right_pressed.9.png differ
diff --git a/res/drawable-hdpi-finger/btn_dial_action_right_selected.9.png b/res/drawable-hdpi-finger/btn_dial_action_right_selected.9.png
new file mode 100755 (executable)
index 0000000..d2ee98b
Binary files /dev/null and b/res/drawable-hdpi-finger/btn_dial_action_right_selected.9.png differ
diff --git a/res/drawable-hdpi-finger/ic_dial_action_delete.png b/res/drawable-hdpi-finger/ic_dial_action_delete.png
new file mode 100755 (executable)
index 0000000..2e206c8
Binary files /dev/null and b/res/drawable-hdpi-finger/ic_dial_action_delete.png differ
diff --git a/res/drawable-mdpi-finger/btn_dial_action_right_disable.9.png b/res/drawable-mdpi-finger/btn_dial_action_right_disable.9.png
new file mode 100755 (executable)
index 0000000..85dfff0
Binary files /dev/null and b/res/drawable-mdpi-finger/btn_dial_action_right_disable.9.png differ
diff --git a/res/drawable-mdpi-finger/btn_dial_action_right_disable_focused.9.png b/res/drawable-mdpi-finger/btn_dial_action_right_disable_focused.9.png
new file mode 100755 (executable)
index 0000000..1f76f0c
Binary files /dev/null and b/res/drawable-mdpi-finger/btn_dial_action_right_disable_focused.9.png differ
diff --git a/res/drawable-mdpi-finger/btn_dial_action_right_normal.9.png b/res/drawable-mdpi-finger/btn_dial_action_right_normal.9.png
new file mode 100755 (executable)
index 0000000..85dfff0
Binary files /dev/null and b/res/drawable-mdpi-finger/btn_dial_action_right_normal.9.png differ
diff --git a/res/drawable-mdpi-finger/btn_dial_action_right_pressed.9.png b/res/drawable-mdpi-finger/btn_dial_action_right_pressed.9.png
new file mode 100755 (executable)
index 0000000..226633f
Binary files /dev/null and b/res/drawable-mdpi-finger/btn_dial_action_right_pressed.9.png differ
diff --git a/res/drawable-mdpi-finger/btn_dial_action_right_selected.9.png b/res/drawable-mdpi-finger/btn_dial_action_right_selected.9.png
new file mode 100755 (executable)
index 0000000..9cca52c
Binary files /dev/null and b/res/drawable-mdpi-finger/btn_dial_action_right_selected.9.png differ
diff --git a/res/drawable-mdpi-finger/ic_dial_action_delete.png b/res/drawable-mdpi-finger/ic_dial_action_delete.png
new file mode 100755 (executable)
index 0000000..440ae37
Binary files /dev/null and b/res/drawable-mdpi-finger/ic_dial_action_delete.png differ
index c904deb..74f644b 100644 (file)
     android:layout_height="fill_parent"
     android:orientation="vertical"
 >
-    <LinearLayout android:id="@+id/digitsAndBackspace"
+    <!-- Text field above the keypad where the digits are displayed -->
+    <EditText android:id="@+id/digits"
         android:layout_width="fill_parent"
         android:layout_height="66dip"
-        android:layout_marginTop="3dip"
-        android:layout_marginBottom="5dip"
-        android:layout_marginLeft="3dip"
-        android:layout_marginRight="3dip"
-        android:orientation="horizontal"
-    >
-
-        <EditText android:id="@+id/digits"
-            android:layout_width="0dip"
-            android:layout_weight="1"
-            android:layout_height="66dip"
-            android:maxLines="1"
-            android:scrollHorizontally="true"
-            android:textSize="28sp"
-            android:freezesText="true"
-            android:background="@drawable/btn_dial_textfield"
-            android:textColor="@color/dialer_button_text"
-            android:focusableInTouchMode="false"
-            android:nextFocusRight="@+id/backspace"
-        />
-
-        <ImageButton android:id="@+id/backspace"
-            style="@android:style/Widget.Button.Inset"
-            android:layout_width="wrap_content"
-            android:layout_height="66dip"
-            android:background="@drawable/btn_dial_delete"
-            android:src="@drawable/ic_delete_phone_number"
-            android:gravity="center"
-        />
-
-    </LinearLayout>
+        android:maxLines="1"
+        android:scrollHorizontally="true"
+        android:textSize="28sp"
+        android:freezesText="true"
+        android:background="@drawable/btn_dial_textfield"
+        android:textColor="@color/dialer_button_text"
+        android:focusableInTouchMode="false"
+    />
 
     <!-- Keypad section -->
     <include layout="@layout/dialpad" />
 
-    <!-- Horizontal row of buttons (Voicemail + DialButton + Backspace.) -->
-    <LinearLayout android:id="@+id/voicemailAndDialAndBackspace"
+    <!-- Horizontal row of buttons (Voicemail + DialButton + Delete.) -->
+    <LinearLayout android:id="@+id/voicemailAndDialAndDelete"
         android:layout_width="wrap_content"
         android:layout_height="fill_parent"
         android:layout_gravity="center_horizontal"
             android:state_enabled="false"
             android:background="@drawable/btn_dial_action"
             android:src="@drawable/ic_dial_action_call" />
+
+        <!-- Onscreen "Backspace/Delete" button -->
+        <ImageButton android:id="@+id/deleteButton"
+            android:layout_width="90dip"
+            android:layout_height="52dip"
+            android:layout_gravity="center_vertical"
+            android:state_enabled="false"
+            android:background="@drawable/btn_dial_delete"
+            android:src="@drawable/ic_dial_action_delete" />
     </LinearLayout>
 
     <!-- "Dialpad chooser" UI, shown only when the user brings up the
index 9547ed5..0b89572 100644 (file)
     android:layout_height="fill_parent"
     android:orientation="vertical"
 >
-    <LinearLayout android:id="@+id/digitsAndBackspace"
+
+    <!-- Text field above the keypad where the digits are displayed -->
+    <EditText android:id="@+id/digits"
         android:layout_width="fill_parent"
         android:layout_height="66dip"
-        android:addStatesFromChildren="true"
-        android:gravity="center_vertical"
-        android:baselineAligned="false"
-        android:layout_marginTop="3dip"
-        android:layout_marginBottom="5dip"
-        android:layout_marginLeft="3dip"
-        android:layout_marginRight="3dip"
-    >
-
-        <EditText android:id="@+id/digits"
-            android:layout_width="0dip"
-            android:layout_weight="1"
-            android:layout_height="66dip"
-            android:maxLines="1"
-            android:scrollHorizontally="true"
-            android:textSize="28sp"
-            android:freezesText="true"
-            android:background="@drawable/btn_dial_textfield"
-            android:textColor="@color/dialer_button_text"
-            android:hint="@string/dialerKeyboardHintText"
-        />
-
-        <!--
-            The button goes at the right.
-        -->
-        <ImageButton android:id="@+id/backspace"
-            style="@android:style/Widget.Button.Inset"
-            android:src="@drawable/ic_delete_phone_number"
-            android:layout_width="wrap_content"
-            android:layout_height="66dip"
-            android:background="@drawable/btn_dial_delete"
-            android:gravity="center"
-        />
-
-    </LinearLayout>
+        android:maxLines="1"
+        android:scrollHorizontally="true"
+        android:textSize="28sp"
+        android:freezesText="true"
+        android:background="@drawable/btn_dial_textfield"
+        android:textColor="@color/dialer_button_text"
+        android:hint="@string/dialerKeyboardHintText"
+     />
 
-    <!-- Horizontal row of buttons (Voicemail + DialButton + Backspace.) -->
-    <LinearLayout android:id="@+id/voicemailAndDialAndBackspace"
+    <!-- Horizontal row of buttons (Voicemail + DialButton + Delete.) -->
+    <LinearLayout android:id="@+id/voicemailAndDialAndDelete"
         android:layout_width="wrap_content"
         android:layout_height="fill_parent"
         android:layout_gravity="center_horizontal"
             android:state_enabled="false"
             android:background="@drawable/btn_dial_action"
             android:src="@drawable/ic_dial_action_call" />
+
+        <!-- Onscreen "Backspace/Delete" button -->
+        <ImageButton android:id="@+id/deleteButton"
+            android:layout_width="90dip"
+            android:layout_height="52dip"
+            android:layout_gravity="center_vertical"
+            android:state_enabled="false"
+            android:background="@drawable/btn_dial_delete"
+            android:src="@drawable/ic_dial_action_delete" />
     </LinearLayout>
 
     <!-- "Dialpad chooser" UI, shown only when the user brings up the
index 2be677a..ebb76c0 100644 (file)
@@ -89,11 +89,8 @@ public class TwelveKeyDialer extends Activity implements View.OnClickListener,
     private Object mToneGeneratorLock = new Object();
     private Drawable mDigitsBackground;
     private Drawable mDigitsEmptyBackground;
-    private Drawable mDeleteBackground;
-    private Drawable mDeleteEmptyBackground;
-    private View mDigitsAndBackspace;
     private View mDialpad;
-    private View mVoicemailDialAndBackspaceRow;
+    private View mVoicemailDialAndDeleteRow;
     private View mVoicemailButton;
     private View mDialButton;
     private ListView mDialpadChooser;
@@ -158,19 +155,7 @@ public class TwelveKeyDialer extends Activity implements View.OnClickListener,
             mDigits.getText().clear();
         }
 
-        // Set the proper background for the dial input area
-        if (mDigits.length() != 0) {
-            mDelete.setBackgroundDrawable(mDeleteBackground);
-            mDigits.setBackgroundDrawable(mDigitsBackground);
-            mDigits.setCompoundDrawablesWithIntrinsicBounds(
-                    getResources().getDrawable(R.drawable.ic_dial_number), null, null, null);
-        } else {
-            mDelete.setBackgroundDrawable(mDeleteEmptyBackground);
-            mDigits.setBackgroundDrawable(mDigitsEmptyBackground);
-            mDigits.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
-        }
-
-        updateDialButtonStateEnabledAttr();
+        updateDialAndDeleteButtonStateEnabledAttr();
     }
 
     @Override
@@ -185,11 +170,6 @@ public class TwelveKeyDialer extends Activity implements View.OnClickListener,
         mDigitsBackground = r.getDrawable(R.drawable.btn_dial_textfield_active);
         //mDigitsBackground.setDither(true);
         mDigitsEmptyBackground = r.getDrawable(R.drawable.btn_dial_textfield);
-        //mDigitsEmptyBackground.setDither(true);
-        mDeleteBackground = r.getDrawable(R.drawable.btn_dial_delete_active);
-        //mDeleteBackground.setDither(true);
-        mDeleteEmptyBackground = r.getDrawable(R.drawable.btn_dial_delete);
-        //mDeleteEmptyBackground.setDither(true);
 
         mDigits = (EditText) findViewById(R.id.digits);
         mDigits.setKeyListener(DialerKeyListener.getInstance());
@@ -203,12 +183,12 @@ public class TwelveKeyDialer extends Activity implements View.OnClickListener,
             setupKeypad();
         }
 
-        mVoicemailDialAndBackspaceRow = findViewById(R.id.voicemailAndDialAndBackspace);
+        mVoicemailDialAndDeleteRow = findViewById(R.id.voicemailAndDialAndDelete);
 
         initVoicemailButton();
 
         // Check whether we should show the onscreen "Dial" button.
-        mDialButton = mVoicemailDialAndBackspaceRow.findViewById(R.id.dialButton);
+        mDialButton = mVoicemailDialAndDeleteRow.findViewById(R.id.dialButton);
 
         if (r.getBoolean(R.bool.config_show_onscreen_dial_button)) {
             mDialButton.setOnClickListener(this);
@@ -217,12 +197,11 @@ public class TwelveKeyDialer extends Activity implements View.OnClickListener,
             mDialButton = null;
         }
 
-        view = findViewById(R.id.backspace);
+        view = mVoicemailDialAndDeleteRow.findViewById(R.id.deleteButton);
         view.setOnClickListener(this);
         view.setOnLongClickListener(this);
         mDelete = view;
 
-        mDigitsAndBackspace = findViewById(R.id.digitsAndBackspace);
         mDialpad = findViewById(R.id.dialpad);  // This is null in landscape mode
 
         // Set up the "dialpad chooser" UI; see showDialpadChooser().
@@ -438,7 +417,7 @@ public class TwelveKeyDialer extends Activity implements View.OnClickListener,
             showDialpadChooser(false);
         }
 
-        updateDialButtonStateEnabledAttr();
+        updateDialAndDeleteButtonStateEnabledAttr();
     }
 
     @Override
@@ -666,7 +645,7 @@ public class TwelveKeyDialer extends Activity implements View.OnClickListener,
                 keyPressed(KeyEvent.KEYCODE_STAR);
                 return;
             }
-            case R.id.backspace: {
+            case R.id.deleteButton: {
                 keyPressed(KeyEvent.KEYCODE_DEL);
                 return;
             }
@@ -688,8 +667,12 @@ public class TwelveKeyDialer extends Activity implements View.OnClickListener,
         final Editable digits = mDigits.getText();
         int id = view.getId();
         switch (id) {
-            case R.id.backspace: {
+            case R.id.deleteButton: {
                 digits.clear();
+                // TODO: The framework forgets to clear the pressed
+                // status of disabled button. Until this is fixed,
+                // clear manually the pressed status. b/2133127
+                mDelete.setPressed(false);
                 return true;
             }
             case R.id.one: {
@@ -789,9 +772,9 @@ public class TwelveKeyDialer extends Activity implements View.OnClickListener,
     private void showDialpadChooser(boolean enabled) {
         if (enabled) {
             // Log.i(TAG, "Showing dialpad chooser!");
-            mDigitsAndBackspace.setVisibility(View.GONE);
+            mDigits.setVisibility(View.GONE);
             if (mDialpad != null) mDialpad.setVisibility(View.GONE);
-            mVoicemailDialAndBackspaceRow.setVisibility(View.GONE);
+            mVoicemailDialAndDeleteRow.setVisibility(View.GONE);
             mDialpadChooser.setVisibility(View.VISIBLE);
 
             // Instantiate the DialpadChooserAdapter and hook it up to the
@@ -802,9 +785,9 @@ public class TwelveKeyDialer extends Activity implements View.OnClickListener,
             }
         } else {
             // Log.i(TAG, "Displaying normal Dialer UI.");
-            mDigitsAndBackspace.setVisibility(View.VISIBLE);
+            mDigits.setVisibility(View.VISIBLE);
             if (mDialpad != null) mDialpad.setVisibility(View.VISIBLE);
-            mVoicemailDialAndBackspaceRow.setVisibility(View.VISIBLE);
+            mVoicemailDialAndDeleteRow.setVisibility(View.VISIBLE);
             mDialpadChooser.setVisibility(View.GONE);
         }
     }
@@ -1046,14 +1029,18 @@ public class TwelveKeyDialer extends Activity implements View.OnClickListener,
     }
 
     /**
-     * Update the enabledness of the "Dial" button if applicable.
+     * Update the enabledness of the "Dial" and "Backspace" buttons if applicable.
      */
-    private void updateDialButtonStateEnabledAttr() {
+    private void updateDialAndDeleteButtonStateEnabledAttr() {
+        final boolean notEmpty = mDigits.length() != 0;
+
         if (mDialButton != null) {
-            mDialButton.setEnabled(mDigits.length() != 0);
+            mDialButton.setEnabled(notEmpty);
         }
+        mDelete.setEnabled(notEmpty);
     }
 
+
     /**
      * Check if voicemail is enabled/accessible.
      */
@@ -1065,7 +1052,7 @@ public class TwelveKeyDialer extends Activity implements View.OnClickListener,
             // Possibly no READ_PHONE_STATE privilege.
         }
 
-        mVoicemailButton = mVoicemailDialAndBackspaceRow.findViewById(R.id.voicemailButton);
+        mVoicemailButton = mVoicemailDialAndDeleteRow.findViewById(R.id.voicemailButton);
         if (hasVoicemail) {
             mVoicemailButton.setOnClickListener(this);
         } else {