diff options
-rw-r--r-- | res/drawable-hdpi/ic_dial_action_vm.png | bin | 0 -> 560 bytes | |||
-rw-r--r-- | res/drawable-hdpi/ic_menu_dialpad_dk.png (renamed from res/drawable-hdpi/ic_dialer_menu_dialpad_dk.png) | bin | 747 -> 747 bytes | |||
-rw-r--r-- | res/drawable-hdpi/ic_menu_history_dk.png (renamed from res/drawable-hdpi/ic_dialer_menu_history_dk.png) | bin | 1605 -> 1605 bytes | |||
-rw-r--r-- | res/drawable-hdpi/ic_menu_history_lt.png | bin | 0 -> 1565 bytes | |||
-rw-r--r-- | res/drawable-hdpi/ic_menu_overflow_dk.png (renamed from res/drawable-hdpi/ic_menu_overflow_dark.png) | bin | 647 -> 647 bytes | |||
-rw-r--r-- | res/drawable-hdpi/ic_menu_overflow_lt.png | bin | 0 -> 643 bytes | |||
-rw-r--r-- | res/drawable-mdpi/ic_dial_action_vm.png | bin | 0 -> 440 bytes | |||
-rw-r--r-- | res/drawable-mdpi/ic_menu_dialpad_dk.png (renamed from res/drawable-mdpi/ic_dialer_menu_dialpad_dk.png) | bin | 897 -> 897 bytes | |||
-rw-r--r-- | res/drawable-mdpi/ic_menu_history_dk.png (renamed from res/drawable-mdpi/ic_dialer_menu_history_dk.png) | bin | 1107 -> 1107 bytes | |||
-rw-r--r-- | res/drawable-mdpi/ic_menu_history_lt.png | bin | 0 -> 1086 bytes | |||
-rw-r--r-- | res/drawable-mdpi/ic_menu_overflow_dk.png (renamed from res/drawable-mdpi/ic_menu_overflow_dark.png) | bin | 616 -> 616 bytes | |||
-rw-r--r-- | res/drawable-mdpi/ic_menu_overflow_lt.png | bin | 0 -> 615 bytes | |||
-rw-r--r-- | res/drawable-xhdpi/ic_dial_action_vm.png | bin | 0 -> 723 bytes | |||
-rw-r--r-- | res/drawable-xhdpi/ic_menu_dialpad_dk.png (renamed from res/drawable-xhdpi/ic_dialer_menu_dialpad_dk.png) | bin | 1363 -> 1363 bytes | |||
-rw-r--r-- | res/drawable-xhdpi/ic_menu_history_dk.png (renamed from res/drawable-xhdpi/ic_dialer_menu_history_dk.png) | bin | 2289 -> 2289 bytes | |||
-rw-r--r-- | res/drawable-xhdpi/ic_menu_history_lt.png | bin | 0 -> 2237 bytes | |||
-rw-r--r-- | res/drawable-xhdpi/ic_menu_overflow_dk.png (renamed from res/drawable-xhdpi/ic_menu_overflow_dark.png) | bin | 800 -> 800 bytes | |||
-rw-r--r-- | res/drawable-xhdpi/ic_menu_overflow_lt.png | bin | 0 -> 797 bytes | |||
-rw-r--r-- | res/layout/dialpad_key.xml | 9 | ||||
-rw-r--r-- | res/layout/new_dialpad.xml | 70 | ||||
-rw-r--r-- | res/layout/new_dialpad_fragment.xml | 8 | ||||
-rw-r--r-- | res/layout/new_phone_favorites_fragment.xml | 6 | ||||
-rw-r--r-- | res/menu/dialpad_options_new.xml | 32 | ||||
-rw-r--r-- | res/values/colors.xml | 7 | ||||
-rw-r--r-- | res/values/dimens.xml | 5 | ||||
-rw-r--r-- | src/com/android/dialer/NewDialtactsActivity.java | 3 | ||||
-rw-r--r-- | src/com/android/dialer/dialpad/NewDialpadFragment.java | 59 |
27 files changed, 136 insertions, 63 deletions
diff --git a/res/drawable-hdpi/ic_dial_action_vm.png b/res/drawable-hdpi/ic_dial_action_vm.png Binary files differnew file mode 100644 index 000000000..68ee3d6c9 --- /dev/null +++ b/res/drawable-hdpi/ic_dial_action_vm.png diff --git a/res/drawable-hdpi/ic_dialer_menu_dialpad_dk.png b/res/drawable-hdpi/ic_menu_dialpad_dk.png Binary files differindex 4da8f2855..4da8f2855 100644 --- a/res/drawable-hdpi/ic_dialer_menu_dialpad_dk.png +++ b/res/drawable-hdpi/ic_menu_dialpad_dk.png diff --git a/res/drawable-hdpi/ic_dialer_menu_history_dk.png b/res/drawable-hdpi/ic_menu_history_dk.png Binary files differindex b8d1944b2..b8d1944b2 100644 --- a/res/drawable-hdpi/ic_dialer_menu_history_dk.png +++ b/res/drawable-hdpi/ic_menu_history_dk.png diff --git a/res/drawable-hdpi/ic_menu_history_lt.png b/res/drawable-hdpi/ic_menu_history_lt.png Binary files differnew file mode 100644 index 000000000..a36323ca9 --- /dev/null +++ b/res/drawable-hdpi/ic_menu_history_lt.png diff --git a/res/drawable-hdpi/ic_menu_overflow_dark.png b/res/drawable-hdpi/ic_menu_overflow_dk.png Binary files differindex 69741cbf0..69741cbf0 100644 --- a/res/drawable-hdpi/ic_menu_overflow_dark.png +++ b/res/drawable-hdpi/ic_menu_overflow_dk.png diff --git a/res/drawable-hdpi/ic_menu_overflow_lt.png b/res/drawable-hdpi/ic_menu_overflow_lt.png Binary files differnew file mode 100644 index 000000000..2561b8c22 --- /dev/null +++ b/res/drawable-hdpi/ic_menu_overflow_lt.png diff --git a/res/drawable-mdpi/ic_dial_action_vm.png b/res/drawable-mdpi/ic_dial_action_vm.png Binary files differnew file mode 100644 index 000000000..5b91b42a6 --- /dev/null +++ b/res/drawable-mdpi/ic_dial_action_vm.png diff --git a/res/drawable-mdpi/ic_dialer_menu_dialpad_dk.png b/res/drawable-mdpi/ic_menu_dialpad_dk.png Binary files differindex 5a3ac0c33..5a3ac0c33 100644 --- a/res/drawable-mdpi/ic_dialer_menu_dialpad_dk.png +++ b/res/drawable-mdpi/ic_menu_dialpad_dk.png diff --git a/res/drawable-mdpi/ic_dialer_menu_history_dk.png b/res/drawable-mdpi/ic_menu_history_dk.png Binary files differindex d9306baf6..d9306baf6 100644 --- a/res/drawable-mdpi/ic_dialer_menu_history_dk.png +++ b/res/drawable-mdpi/ic_menu_history_dk.png diff --git a/res/drawable-mdpi/ic_menu_history_lt.png b/res/drawable-mdpi/ic_menu_history_lt.png Binary files differnew file mode 100644 index 000000000..3597a5e82 --- /dev/null +++ b/res/drawable-mdpi/ic_menu_history_lt.png diff --git a/res/drawable-mdpi/ic_menu_overflow_dark.png b/res/drawable-mdpi/ic_menu_overflow_dk.png Binary files differindex 2a477c827..2a477c827 100644 --- a/res/drawable-mdpi/ic_menu_overflow_dark.png +++ b/res/drawable-mdpi/ic_menu_overflow_dk.png diff --git a/res/drawable-mdpi/ic_menu_overflow_lt.png b/res/drawable-mdpi/ic_menu_overflow_lt.png Binary files differnew file mode 100644 index 000000000..7dc68c91e --- /dev/null +++ b/res/drawable-mdpi/ic_menu_overflow_lt.png diff --git a/res/drawable-xhdpi/ic_dial_action_vm.png b/res/drawable-xhdpi/ic_dial_action_vm.png Binary files differnew file mode 100644 index 000000000..269fd1a92 --- /dev/null +++ b/res/drawable-xhdpi/ic_dial_action_vm.png diff --git a/res/drawable-xhdpi/ic_dialer_menu_dialpad_dk.png b/res/drawable-xhdpi/ic_menu_dialpad_dk.png Binary files differindex 317bf6611..317bf6611 100644 --- a/res/drawable-xhdpi/ic_dialer_menu_dialpad_dk.png +++ b/res/drawable-xhdpi/ic_menu_dialpad_dk.png diff --git a/res/drawable-xhdpi/ic_dialer_menu_history_dk.png b/res/drawable-xhdpi/ic_menu_history_dk.png Binary files differindex 63ad62b39..63ad62b39 100644 --- a/res/drawable-xhdpi/ic_dialer_menu_history_dk.png +++ b/res/drawable-xhdpi/ic_menu_history_dk.png diff --git a/res/drawable-xhdpi/ic_menu_history_lt.png b/res/drawable-xhdpi/ic_menu_history_lt.png Binary files differnew file mode 100644 index 000000000..6b411cbc3 --- /dev/null +++ b/res/drawable-xhdpi/ic_menu_history_lt.png diff --git a/res/drawable-xhdpi/ic_menu_overflow_dark.png b/res/drawable-xhdpi/ic_menu_overflow_dk.png Binary files differindex 8cbd50827..8cbd50827 100644 --- a/res/drawable-xhdpi/ic_menu_overflow_dark.png +++ b/res/drawable-xhdpi/ic_menu_overflow_dk.png diff --git a/res/drawable-xhdpi/ic_menu_overflow_lt.png b/res/drawable-xhdpi/ic_menu_overflow_lt.png Binary files differnew file mode 100644 index 000000000..95e436c4b --- /dev/null +++ b/res/drawable-xhdpi/ic_menu_overflow_lt.png diff --git a/res/layout/dialpad_key.xml b/res/layout/dialpad_key.xml index eef12a12f..b204c20a2 100644 --- a/res/layout/dialpad_key.xml +++ b/res/layout/dialpad_key.xml @@ -17,15 +17,14 @@ <!-- A layout representing a single key in the dialpad --> <com.android.dialer.dialpad.DialpadKeyButton xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/dialpad_key" style="@style/DialtactsDialpadButtonStyle" android:clickable="true" > <TextView android:id="@+id/dialpad_key_number" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textColor="#33b5e5" - android:textSize="40dp" + android:textColor="@color/dialpad_primary_text_color" + android:textSize="@dimen/dialpad_key_numbers_size" android:fontFamily="sans-serif-light" android:layout_centerInParent="true" /> @@ -33,8 +32,8 @@ android:id="@+id/dialpad_key_letters" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textColor="#aaaaaa" - android:textSize="11dp" + android:textColor="@color/dialpad_secondary_text_color" + android:textSize="@dimen/dialpad_key_letters_size" android:paddingRight="11dp" android:layout_alignBaseline="@id/dialpad_key_number" android:fontFamily="sans-serif-light" diff --git a/res/layout/new_dialpad.xml b/res/layout/new_dialpad.xml index e71d4edf0..60240bc3f 100644 --- a/res/layout/new_dialpad.xml +++ b/res/layout/new_dialpad.xml @@ -30,34 +30,82 @@ android:layoutDirection="ltr" > <TableRow - android:layout_height="0px" - android:layout_weight="1"> - <include layout="@layout/dialpad_key" android:id="@+id/one"/> + android:layout_height="0px" + android:layout_weight="1"> + <com.android.dialer.dialpad.DialpadKeyButton + xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/one" + style="@style/DialtactsDialpadButtonStyle" + android:clickable="true" > + <TextView + android:id="@+id/dialpad_key_number" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textColor="@color/dialpad_primary_text_color" + android:textSize="@dimen/dialpad_key_numbers_size" + android:fontFamily="sans-serif-light" + android:layout_centerInParent="true" /> + <ImageView + android:id="@+id/dialpad_key_voicemail" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:src="@drawable/ic_dial_action_vm" + android:paddingRight="11dp" + android:layout_alignBaseline="@id/dialpad_key_number" + android:baselineAlignBottom="true" + android:layout_alignParentRight="true" /> + </com.android.dialer.dialpad.DialpadKeyButton> <include layout="@layout/dialpad_key" android:id="@+id/two"/> <include layout="@layout/dialpad_key" android:id="@+id/three"/> </TableRow> <TableRow - android:layout_height="0px" - android:layout_weight="1"> + android:layout_height="0px" + android:layout_weight="1"> <include layout="@layout/dialpad_key" android:id="@+id/four"/> <include layout="@layout/dialpad_key" android:id="@+id/five"/> <include layout="@layout/dialpad_key" android:id="@+id/six"/> </TableRow> <TableRow - android:layout_height="0px" - android:layout_weight="1"> + android:layout_height="0px" + android:layout_weight="1"> <include layout="@layout/dialpad_key" android:id="@+id/seven"/> <include layout="@layout/dialpad_key" android:id="@+id/eight"/> <include layout="@layout/dialpad_key" android:id="@+id/nine"/> </TableRow> <TableRow - android:layout_height="0px" - android:layout_weight="1"> - <include layout="@layout/dialpad_key" android:id="@+id/star"/> + android:layout_height="0px" + android:layout_weight="1"> + <com.android.dialer.dialpad.DialpadKeyButton + xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/star" + style="@style/DialtactsDialpadButtonStyle" + android:clickable="true" > + <TextView + android:id="@id/dialpad_key_number" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textColor="@color/dialpad_secondary_text_color" + android:textSize="@dimen/dialpad_key_special_characters_size" + android:fontFamily="sans-serif-light" + android:layout_centerInParent="true" /> + </com.android.dialer.dialpad.DialpadKeyButton> <include layout="@layout/dialpad_key" android:id="@+id/zero"/> - <include layout="@layout/dialpad_key" android:id="@+id/pound"/> + <com.android.dialer.dialpad.DialpadKeyButton + xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/pound" + style="@style/DialtactsDialpadButtonStyle" + android:clickable="true" > + <TextView + android:id="@id/dialpad_key_number" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textColor="@color/dialpad_secondary_text_color" + android:textSize="@dimen/dialpad_key_special_characters_size" + android:fontFamily="sans-serif-light" + android:layout_centerInParent="true" /> + </com.android.dialer.dialpad.DialpadKeyButton> </TableRow> </TableLayout> diff --git a/res/layout/new_dialpad_fragment.xml b/res/layout/new_dialpad_fragment.xml index c357d4752..f6f652caa 100644 --- a/res/layout/new_dialpad_fragment.xml +++ b/res/layout/new_dialpad_fragment.xml @@ -85,9 +85,9 @@ android:layout_height="@dimen/fake_action_bar_height" android:layout_width="@dimen/fake_menu_button_min_width" android:layout_gravity="bottom|start" - android:background="?android:attr/selectableItemBackground" + android:background="@drawable/btn_call" android:contentDescription="@string/action_menu_call_history_description" - android:src="@drawable/ic_dialer_menu_history_dk"/> + android:src="@drawable/ic_menu_history_lt"/> <ImageButton android:id="@+id/dialButton" android:layout_width="0dp" @@ -103,8 +103,8 @@ android:layout_height="@dimen/fake_action_bar_height" android:layout_width="@dimen/fake_menu_button_min_width" android:layout_gravity="bottom|end" - android:background="?android:attr/selectableItemBackground" - android:src="@drawable/ic_menu_overflow_dark" + android:background="@drawable/btn_call" + android:src="@drawable/ic_menu_overflow_lt" android:contentDescription="@string/action_menu_overflow_description" /> </LinearLayout> diff --git a/res/layout/new_phone_favorites_fragment.xml b/res/layout/new_phone_favorites_fragment.xml index cc11ea164..2b6bbe447 100644 --- a/res/layout/new_phone_favorites_fragment.xml +++ b/res/layout/new_phone_favorites_fragment.xml @@ -58,7 +58,7 @@ android:layout_gravity="bottom|start" android:background="?android:attr/selectableItemBackground" android:contentDescription="@string/action_menu_call_history_description" - android:src="@drawable/ic_dialer_menu_history_dk"/> + android:src="@drawable/ic_menu_history_dk"/> <ImageButton android:id="@+id/dialpad_button" android:layout_width="@dimen/fake_menu_button_min_width" @@ -66,13 +66,13 @@ android:layout_gravity="bottom|center" android:background="?android:attr/selectableItemBackground" android:contentDescription="@string/description_search_button" - android:src="@drawable/ic_dialer_menu_dialpad_dk"/> + android:src="@drawable/ic_menu_dialpad_dk"/> <ImageButton android:id="@+id/overflow_menu" android:layout_width="@dimen/fake_menu_button_min_width" android:layout_height="match_parent" android:layout_gravity="bottom|end" - android:src="@drawable/ic_menu_overflow_dark" + android:src="@drawable/ic_menu_overflow_dk" android:contentDescription="@string/action_menu_overflow_description" android:background="?android:attr/selectableItemBackground"/> </FrameLayout> diff --git a/res/menu/dialpad_options_new.xml b/res/menu/dialpad_options_new.xml new file mode 100644 index 000000000..0727dd57c --- /dev/null +++ b/res/menu/dialpad_options_new.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2011 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. +--> +<menu xmlns:android="http://schemas.android.com/apk/res/android"> + <item + android:id="@+id/menu_add_contacts" + android:title="@string/recentCalls_addToContact" + android:showAsAction="withText" + android:orderInCategory="1" /> + <item + android:id="@+id/menu_2s_pause" + android:title="@string/add_2sec_pause" + android:showAsAction="withText" + android:orderInCategory="1" /> + <item + android:id="@+id/menu_add_wait" + android:title="@string/add_wait" + android:showAsAction="withText" + android:orderInCategory="1" /> +</menu> diff --git a/res/values/colors.xml b/res/values/colors.xml index 85ccc6857..9cf7251a9 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -53,10 +53,9 @@ <color name="background_dialpad">#ee020709</color> <!-- Primary color of dialpad text, including the call button --> - <color name="dialpad_primary_text_color">#0099cc</color> - <!-- Secondary color of dialpad text (mainly used for the letters corresponding to each digit - --> - <color name="dialpad_secondary_text_color">#888888</color> + <color name="dialpad_primary_text_color">#33b5e5</color> + <!-- Secondary color of dialpad text (used for the letters corresponding to each digit --> + <color name="dialpad_secondary_text_color">#aaaaaa</color> <!-- Background color of action bars --> <color name="actionbar_background_color">#e6e6e6</color> diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 061be73b9..7b4c65e22 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -49,6 +49,11 @@ <integer name="dialpad_layout_weight_dialpad">65</integer> <integer name="dialpad_layout_weight_additional_buttons">15</integer> + <!-- Text dimensions for dialpad keys --> + <dimen name="dialpad_key_numbers_size">40dp</dimen> + <dimen name="dialpad_key_letters_size">11dp</dimen> + <dimen name="dialpad_key_special_characters_size">25dp</dimen> + <dimen name="fake_action_bar_height">48dp</dimen> <!-- Min with of fake menu buttons, which should be same as ActionBar's one --> <dimen name="fake_menu_button_min_width">56dp</dimen> diff --git a/src/com/android/dialer/NewDialtactsActivity.java b/src/com/android/dialer/NewDialtactsActivity.java index 61f2e41f3..95d9ea7df 100644 --- a/src/com/android/dialer/NewDialtactsActivity.java +++ b/src/com/android/dialer/NewDialtactsActivity.java @@ -329,7 +329,6 @@ public class NewDialtactsActivity extends TransactionSafeActivity implements Vie @Override public void onClick(View view) { switch (view.getId()) { - case R.id.overflow_menu_on_dialpad: case R.id.overflow_menu: { final PopupMenu popupMenu = new PopupMenu(NewDialtactsActivity.this, view); final Menu menu = popupMenu.getMenu(); @@ -503,8 +502,6 @@ public class NewDialtactsActivity extends TransactionSafeActivity implements Vie } public void setupFakeActionBarItemsForDialpadFragment() { - final View overflowButton = findViewById(R.id.overflow_menu_on_dialpad); - overflowButton.setOnClickListener(this); final View callhistoryButton = findViewById(R.id.call_history_on_dialpad_button); callhistoryButton.setOnClickListener(this); } diff --git a/src/com/android/dialer/dialpad/NewDialpadFragment.java b/src/com/android/dialer/dialpad/NewDialpadFragment.java index 659c608c2..7eb7c0f99 100644 --- a/src/com/android/dialer/dialpad/NewDialpadFragment.java +++ b/src/com/android/dialer/dialpad/NewDialpadFragment.java @@ -426,6 +426,9 @@ public class NewDialpadFragment extends Fragment throw new ClassCastException(activity.toString() + " must implement OnDialpadFragmentStartedListener"); } + + final View overflowButton = getView().findViewById(R.id.overflow_menu_on_dialpad); + overflowButton.setOnClickListener(this); } private boolean isLayoutReady() { @@ -605,7 +608,9 @@ public class NewDialpadFragment extends Fragment numberView = (TextView) dialpadKey.findViewById(R.id.dialpad_key_number); lettersView = (TextView) dialpadKey.findViewById(R.id.dialpad_key_letters); numberView.setText(resources.getString(numberIds[i])); - lettersView.setText(resources.getString(letterIds[i])); + if (lettersView != null) { + lettersView.setText(resources.getString(letterIds[i])); + } } // Long-pressing one button will initiate Voicemail. @@ -751,24 +756,8 @@ public class NewDialpadFragment extends Fragment } private void setupMenuItems(Menu menu) { - final MenuItem callSettingsMenuItem = menu.findItem(R.id.menu_call_settings_dialpad); final MenuItem addToContactMenuItem = menu.findItem(R.id.menu_add_contacts); - // Check if all the menu items are inflated correctly. As a shortcut, we assume all menu - // items are ready if the first item is non-null. - if (callSettingsMenuItem == null) { - return; - } - - final Activity activity = getActivity(); - if (activity != null && ViewConfiguration.get(activity).hasPermanentMenuKey()) { - // Call settings should be available via its parent Activity. - callSettingsMenuItem.setVisible(false); - } else { - callSettingsMenuItem.setVisible(true); - callSettingsMenuItem.setIntent(DialtactsActivity.getCallSettingsIntent()); - } - // We show "add to contacts" menu only when the user is // seeing usual dialpad and has typed at least one digit. // We never show a menu if the "choose dialpad" UI is up. @@ -776,7 +765,6 @@ public class NewDialpadFragment extends Fragment addToContactMenuItem.setVisible(false); } else { final CharSequence digits = mDigits.getText(); - // Put the current digits string into an intent addToContactMenuItem.setIntent(getAddToContactIntent(digits)); addToContactMenuItem.setVisible(true); @@ -942,6 +930,15 @@ public class NewDialpadFragment extends Fragment @Override public void onClick(View view) { switch (view.getId()) { + case R.id.overflow_menu_on_dialpad: { + final PopupMenu popupMenu = new PopupMenu(getActivity(), view); + final Menu menu = popupMenu.getMenu(); + popupMenu.inflate(R.menu.dialpad_options_new); + popupMenu.setOnMenuItemClickListener(this); + setupMenuItems(menu); + popupMenu.show(); + break; + } case R.id.deleteButton: { keyPressed(KeyEvent.KEYCODE_DEL); return; @@ -964,19 +961,6 @@ public class NewDialpadFragment extends Fragment } } - public PopupMenu constructPopupMenu(View anchorView) { - final Context context = getActivity(); - if (context == null) { - return null; - } - final PopupMenu popupMenu = new PopupMenu(context, anchorView); - final Menu menu = popupMenu.getMenu(); - popupMenu.inflate(R.menu.dialpad_options); - popupMenu.setOnMenuItemClickListener(this); - setupMenuItems(menu); - return popupMenu; - } - @Override public boolean onLongClick(View view) { final Editable digits = mDigits.getText(); @@ -1521,13 +1505,22 @@ public class NewDialpadFragment extends Fragment @Override public boolean onMenuItemClick(MenuItem item) { - return onOptionsItemSelected(item); + // R.id.menu_add_contacts already has an add to contact intent populated by setupMenuItems + switch (item.getItemId()) { + case R.id.menu_2s_pause: + updateDialString(PAUSE); + return true; + case R.id.menu_add_wait: + updateDialString(WAIT); + return true; + default: + return false; + } } /** * Updates the dial string (mDigits) after inserting a Pause character (,) * or Wait character (;). - * TODO krelease: add new dialpad buttons to add PAUSE and WAIT characters */ private void updateDialString(char newDigit) { if(newDigit != WAIT && newDigit != PAUSE) { |