diff options
author | calderwoodra <calderwoodra@google.com> | 2018-05-02 12:33:06 -0700 |
---|---|---|
committer | Weijia Xu <weijiaxu@google.com> | 2018-05-04 06:15:45 +0000 |
commit | d22ef290c45701ef65d9d0e004a64c683c8c2788 (patch) | |
tree | e7a3a892e171451b8ca891b0291340e46fc448e4 /java/com/android/dialer/speeddial/res | |
parent | 9c70e4ca34c2f3f0c5d48b549602603eed7a6c2e (diff) |
Migrated context menu to be a PopupMenu instead.
This gives us huge amounts of functionality with very little technical cost but
some trade off in UX.
Bug: 77761183,78492250
Test: existing
PiperOrigin-RevId: 195133774
Change-Id: I57e48b5defc4ae1c7bfbed13e3fbc16ebd607944
Diffstat (limited to 'java/com/android/dialer/speeddial/res')
4 files changed, 52 insertions, 129 deletions
diff --git a/java/com/android/dialer/speeddial/res/layout/context_menu_layout.xml b/java/com/android/dialer/speeddial/res/layout/context_menu_layout.xml deleted file mode 100644 index a59fa07c7..000000000 --- a/java/com/android/dialer/speeddial/res/layout/context_menu_layout.xml +++ /dev/null @@ -1,93 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2018 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 - --> -<com.android.dialer.speeddial.ContextMenu - xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/contact_menu_container" - android:orientation="vertical" - android:layout_width="160dp" - android:layout_height="wrap_content" - android:clipChildren="true" - android:clipToPadding="false"> - - <FrameLayout - android:layout_width="12dp" - android:layout_height="12dp" - android:layout_marginTop="7dp" - android:layout_marginBottom="-6dp" - android:layout_gravity="center_horizontal" - android:background="@color/background_dialer_white" - android:rotation="45" - android:clipChildren="false" - android:clipToPadding="false"/> - - <LinearLayout - android:id="@+id/context_menu_items_container" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="vertical" - android:background="@drawable/context_menu_background"> - - - <TextView - android:id="@+id/voice_call_container" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/contact_menu_voice_call" - android:drawableStart="@drawable/quantum_ic_phone_vd_theme_24" - style="@style/SpeedDialContextMenuItem"/> - - <TextView - android:id="@+id/video_call_container" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/contact_menu_video_call" - android:drawableStart="@drawable/quantum_ic_videocam_vd_theme_24" - style="@style/SpeedDialContextMenuItem"/> - - <TextView - android:id="@+id/send_message_container" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:paddingBottom="4dp" - android:text="@string/contact_menu_message" - android:drawableStart="@drawable/quantum_ic_message_vd_theme_24" - style="@style/SpeedDialContextMenuItem"/> - - <View - android:id="@+id/divider" - android:layout_width="match_parent" - android:layout_height="1dp" - android:background="@color/divider_line_color"/> - - <TextView - android:id="@+id/remove_container" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:paddingTop="4dp" - android:text="@string/contact_menu_remove" - android:drawableStart="@drawable/quantum_ic_close_vd_theme_24" - style="@style/SpeedDialContextMenuItem"/> - - <TextView - android:id="@+id/contact_info_container" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:drawableStart="@drawable/context_menu_contact_icon" - android:text="@string/contact_menu_contact_info" - style="@style/SpeedDialContextMenuItem.NoDrawableTint"/> - </LinearLayout> -</com.android.dialer.speeddial.ContextMenu>
\ No newline at end of file diff --git a/java/com/android/dialer/speeddial/res/layout/fragment_speed_dial.xml b/java/com/android/dialer/speeddial/res/layout/fragment_speed_dial.xml index 080fba5d3..9a42377be 100644 --- a/java/com/android/dialer/speeddial/res/layout/fragment_speed_dial.xml +++ b/java/com/android/dialer/speeddial/res/layout/fragment_speed_dial.xml @@ -26,17 +26,5 @@ android:clipToPadding="false" android:background="@color/background_dialer_light" android:paddingBottom="@dimen/floating_action_button_list_bottom_padding"/> - - <FrameLayout - android:id="@+id/context_menu_background" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:visibility="invisible"/> - - <!-- This menu is visible when you long click on a favorite contact. --> - <include - android:id="@+id/favorite_contact_context_menu" - layout="@layout/context_menu_layout" - android:visibility="invisible"/> </FrameLayout> diff --git a/java/com/android/dialer/speeddial/res/menu/add_favorite_menu.xml b/java/com/android/dialer/speeddial/res/menu/add_favorite_menu.xml deleted file mode 100644 index b11c7f5d6..000000000 --- a/java/com/android/dialer/speeddial/res/menu/add_favorite_menu.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2017 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" - xmlns:app="http://schemas.android.com/apk/res-auto"> - <item - android:id="@+id/action_search" - android:title="@android:string/search_go" - app:showAsAction="always" - app:actionViewClass="android.support.v7.widget.SearchView"/> -</menu>
\ No newline at end of file diff --git a/java/com/android/dialer/speeddial/res/menu/starred_contact_context_menu.xml b/java/com/android/dialer/speeddial/res/menu/starred_contact_context_menu.xml new file mode 100644 index 000000000..0143498e1 --- /dev/null +++ b/java/com/android/dialer/speeddial/res/menu/starred_contact_context_menu.xml @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2018 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/starred_contact_context_menu_title" + android:enabled="false" + android:title=""/> + + <item + android:id="@+id/voice_call_container" + android:title="@string/contact_menu_voice_call" + android:icon="@drawable/quantum_ic_phone_vd_theme_24" + android:iconTint="@color/secondary_text_color"/> + + <item + android:id="@+id/video_call_container" + android:title="@string/contact_menu_video_call" + android:icon="@drawable/quantum_ic_videocam_vd_theme_24" + android:iconTint="@color/secondary_text_color"/> + + <item + android:id="@+id/send_message_container" + android:title="@string/contact_menu_message" + android:icon="@drawable/quantum_ic_message_vd_theme_24" + android:iconTint="@color/secondary_text_color"/> + + <item + android:id="@+id/remove_container" + android:title="@string/contact_menu_remove" + android:icon="@drawable/quantum_ic_close_vd_theme_24" + android:iconTint="@color/secondary_text_color"/> + + <item + android:id="@+id/contact_info_container" + android:title="@string/contact_menu_contact_info" + android:icon="@drawable/context_menu_contact_icon" + android:iconTint="#FFFFFF"/> +</menu>
\ No newline at end of file |