summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2015-10-05 13:43:54 -0700
committerAndrew Lee <anwlee@google.com>2015-10-07 15:20:49 -0700
commitbf9cca2ee005acd384ae25b80c3945a5fd1d5f20 (patch)
treea4680b72683245da6b9098f7cbcb4bba74590b55 /res
parent34f5df7389ab7966ab974147ddcd6891598b6e43 (diff)
Add footer actions to Call Details.
Some of these are moved down from the overflow. Others are added from the list of those shown after a call log list item long press. This hooks up the block/unblock functionality, although there is still polish (eg. icons) and cleanup (some noted as TODOs), to complete still. Bug: 24109819 Change-Id: I129f5b09ac1c5edb66ab5bd91a46b18961240fb5
Diffstat (limited to 'res')
-rw-r--r--res/layout/call_detail_footer.xml81
-rw-r--r--res/menu/call_details_cab.xml22
-rw-r--r--res/menu/call_details_options.xml25
-rw-r--r--res/values/dimens.xml3
-rw-r--r--res/values/strings.xml31
-rw-r--r--res/values/styles.xml9
6 files changed, 105 insertions, 66 deletions
diff --git a/res/layout/call_detail_footer.xml b/res/layout/call_detail_footer.xml
new file mode 100644
index 000000000..7e56c02c2
--- /dev/null
+++ b/res/layout/call_detail_footer.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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.
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/divider_line_thickness"
+ android:background="@color/call_log_action_divider" />
+
+ <LinearLayout android:id="@+id/call_detail_action_block"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:visibility="gone"
+ style="@style/CallDetailActionItemStyle">
+
+ <TextView android:id="@+id/call_detail_action_block_text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/action_block_number" />
+
+ </LinearLayout>
+
+ <LinearLayout android:id="@+id/call_detail_action_copy"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ style="@style/CallDetailActionItemStyle">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/action_copy_number_text" />
+
+ </LinearLayout>
+
+ <LinearLayout android:id="@+id/call_detail_action_edit_before_call"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:visibility="gone"
+ style="@style/CallDetailActionItemStyle">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/action_edit_number_before_call" />
+
+ </LinearLayout>
+
+ <LinearLayout android:id="@+id/call_detail_action_report"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:visibility="gone"
+ style="@style/CallDetailActionItemStyle">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/action_report_number" />
+
+ </LinearLayout>
+
+</LinearLayout>
diff --git a/res/menu/call_details_cab.xml b/res/menu/call_details_cab.xml
deleted file mode 100644
index 7de675ff1..000000000
--- a/res/menu/call_details_cab.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2012 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/copy_phone_number"
- android:icon="?android:attr/actionModeCopyDrawable"
- android:title="@string/menu_copy"
- />
-</menu>
diff --git a/res/menu/call_details_options.xml b/res/menu/call_details_options.xml
deleted file mode 100644
index 414b6711a..000000000
--- a/res/menu/call_details_options.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?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"
- android:id="@+id/call_details_menu">
-
- <item android:id="@+id/menu_edit_number_before_call"
- android:title="@string/call_log_edit_number_before_call" />
-
- <item android:id="@+id/menu_report"
- android:title="@string/call_detail_menu_report" />
-
-</menu>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 38e4d0e6e..25d046203 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -16,6 +16,7 @@
-->
<resources>
<dimen name="button_horizontal_padding">16dp</dimen>
+ <dimen name="divider_line_thickness">2dp</dimen>
<!--
Drag to remove view (in dp because it is used in conjunction with a statically
@@ -47,6 +48,8 @@
<dimen name="call_detail_header_top_margin">20dp</dimen>
<dimen name="call_detail_header_bottom_margin">9dp</dimen>
<dimen name="call_detail_elevation">0.5dp</dimen>
+ <dimen name="call_detail_action_item_padding_horizontal">36dp</dimen>
+ <dimen name="call_detail_action_item_padding_vertical">16dp</dimen>
<dimen name="transcription_top_margin">18dp</dimen>
<dimen name="transcription_bottom_margin">18dp</dimen>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 3f4b9e2a6..8a438f600 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -42,25 +42,24 @@
[CHAR LIMIT=NONE] -->
<string name="callHistoryIconLabel">Call history</string>
- <!-- Text for a menu item to report a call as having been incorrectly identified.
- [CHAR LIMIT=30] -->
- <string name="call_detail_menu_report">Report inaccurate number</string>
+ <!-- Text for a menu item to report a call as having been incorrectly identified. [CHAR LIMIT=48] -->
+ <string name="action_report_number">Report inaccurate number</string>
- <!-- Option displayed in context menu to copy long pressed phone number to clipboard [CHAR LIMIT=64] -->
- <string name="copy_number_text">Copy number to clipboard</string>
+ <!-- Option displayed in context menu to copy long pressed phone number. [CHAR LIMIT=48] -->
+ <string name="action_copy_number_text">Copy number</string>
- <!-- Option displayed in context menu to copy long pressed voicemail transcription to clipboard [CHAR LIMIT=64] -->
- <string name="copy_transcript_text">Copy transcription to clipboard</string>
+ <!-- Option displayed in context menu to copy long pressed voicemail transcription. [CHAR LIMIT=48] -->
+ <string name="copy_transcript_text">Copy transcription</string>
- <!-- Menu item used to block a number from the call log [CHAR LIMIT=64] -->
- <string name="call_log_block_number">Block number</string>
+ <!-- Label for action to block a number. [CHAR LIMIT=48] -->
+ <string name="action_block_number">Block number</string>
<!-- Text for snackbar to undo blocking a number. [CHAR LIMIT=64] -->
<string name="snackbar_number_blocked">
<xliff:g id="number" example="(555) 555-5555">%1$s</xliff:g> added to block list</string>
- <!-- Menu item used to unblock a number from the call log [CHAR LIMIT=64]-->
- <string name="call_log_unblock_number">Unblock number</string>
+ <!-- Label for action to unblock a number [CHAR LIMIT=48]-->
+ <string name="action_unblock_number">Unblock number</string>
<!-- Text for snackbar to undo unblocking a number. [CHAR LIMIT=64] -->
<string name="snackbar_number_unblocked">
@@ -73,11 +72,8 @@
<!-- Menu item in call details used to remove a call or voicemail from the call log. -->
<string name="call_details_delete">Delete</string>
- <!-- Menu item used to copy a number from the call log to the dialer so it can be edited before calling it -->
- <string name="call_log_edit_number_before_call">Edit number before call</string>
-
- <!-- Menu item used to remove a single call from the call log -->
- <string name="call_log_remove_from_call_log">Delete from call history</string>
+ <!-- Label for action to edit a number before calling it. [CHAR LIMIT=48] -->
+ <string name="action_edit_number_before_call">Edit number before call</string>
<!-- Menu item used to remove all calls from the call log -->
<string name="call_log_delete_all">Clear call history</string>
@@ -260,9 +256,6 @@
[CHAR LIMIT=NONE] -->
<string name="action_menu_dialpad_button">dial pad</string>
- <!-- Menu item to copy something [CHAR_LIMIT=10] -->
- <string name="menu_copy">Copy</string>
-
<!-- Menu item used to show only outgoing in the call log. [CHAR LIMIT=30] -->
<string name="menu_show_outgoing_only">Show outgoing only</string>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 005fd4587..581f79908 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -146,6 +146,15 @@
<item name="android:actionOverflowButtonStyle">@style/DialtactsActionBarOverflowWhite</item>
</style>
+ <style name="CallDetailActionItemStyle">
+ <item name="android:foreground">?android:attr/selectableItemBackground</item>
+ <item name="android:clickable">true</item>
+ <item name="android:paddingStart">@dimen/call_detail_action_item_padding_horizontal</item>
+ <item name="android:paddingEnd">@dimen/call_detail_action_item_padding_horizontal</item>
+ <item name="android:paddingTop">@dimen/call_detail_action_item_padding_vertical</item>
+ <item name="android:paddingBottom">@dimen/call_detail_action_item_padding_vertical</item>
+ </style>
+
<style name="DialtactsActionBarStyle"
parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<!-- Styles that require AppCompat compatibility, remember to update both sets -->