diff options
author | Andrew Lee <anwlee@google.com> | 2015-04-15 17:23:27 -0700 |
---|---|---|
committer | Andrew Lee <anwlee@google.com> | 2015-04-16 09:39:49 -0700 |
commit | c1b7d0ae8cdfc0f0dddb5c2bb45c8239ffc6a264 (patch) | |
tree | 7e3747d673f53e9c201442a503f6cff0a6e3bfe6 /res | |
parent | 1582ac15d1f30a651000aa5d5098d73be3aa4810 (diff) |
Move call log actions into expandable view.
This isn't the prettiest thing ever, but with this the "framework" of
all of the changes for the new visual style of the call logs is in
place. From here on out, the remainder of tasks should be unblocked
and relatively independent.
+ Rename ...ItemViews to ...ItemViewHolder. This probably wasn't
completely necessary, but is more proper given the new architecture.
+ ViewHolder is now officially where most of the independent UI logic
for a single call log list item should live. This changelist moves
further in that direction by storing references and helpers in it, to
lessen what must be passed in from the adapter.
+ Split out the call action from the rest of the actions, since it
has a special treatment on the card.
+ Convert text action buttons into a vertical stack.
+ Consolidate action stylings into a single style, for simplicity.
+ Miscellaneous style and string changes to put things in a better
state. This included tweaking some of the (ripple) backgrounds.
+ Update tests, according to changes.
Bug: 19372817
Change-Id: Ic923c0bcbbc1c153952131d0c772df9e9589fb03
Diffstat (limited to 'res')
-rw-r--r-- | res/drawable/call_log_background.xml | 18 | ||||
-rw-r--r-- | res/layout/call_log_list_item.xml | 24 | ||||
-rw-r--r-- | res/layout/call_log_list_item_actions.xml | 145 | ||||
-rw-r--r-- | res/values/dimens.xml | 6 | ||||
-rw-r--r-- | res/values/strings.xml | 43 | ||||
-rw-r--r-- | res/values/styles.xml | 13 |
6 files changed, 90 insertions, 159 deletions
diff --git a/res/drawable/call_log_background.xml b/res/drawable/call_log_background.xml deleted file mode 100644 index 1b3dbc979..000000000 --- a/res/drawable/call_log_background.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2014 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. ---> -<ripple xmlns:android="http://schemas.android.com/apk/res/android" - android:color="?android:attr/colorControlHighlight" />
\ No newline at end of file diff --git a/res/layout/call_log_list_item.xml b/res/layout/call_log_list_item.xml index 9ea3db8d0..7a826d9f5 100644 --- a/res/layout/call_log_list_item.xml +++ b/res/layout/call_log_list_item.xml @@ -44,15 +44,13 @@ android:layout_height="wrap_content" android:layout_margin="4dp" android:baselineAligned="false" - android:orientation="vertical" - android:gravity="center_vertical" card_view:cardCornerRadius="4dp" card_view:cardBackgroundColor="@color/background_dialer_call_log_list_item"> <!-- Primary area containing the contact badge and caller information --> <LinearLayout android:id="@+id/primary_action_view" - android:background="@drawable/call_log_background" + android:background="?android:attr/selectableItemBackground" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingStart="@dimen/call_log_start_margin" @@ -142,26 +140,28 @@ </LinearLayout> <ImageView - android:id="@+id/call_indicator_icon" + android:id="@+id/call_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_marginEnd="@dimen/call_log_icon_margin" + android:background="?android:attr/selectableItemBackgroundBorderless" android:src="@drawable/ic_card_phone" android:tint="@color/recent_call_log_item_phone_icon_tint" android:alpha="0.3" - android:importantForAccessibility="no" + android:contentDescription="@string/description_call_log_call_action" android:visibility="gone" /> - <!-- Viewstub with additional expandable actions for a call log entry --> - <ViewStub android:id="@+id/call_log_entry_actions_stub" - android:inflatedId="@+id/call_log_entry_actions" - android:layout="@layout/call_log_list_item_actions" - android:layout_width="match_parent" - android:layout_height="wrap_content"/> - </LinearLayout> + <!-- Viewstub with additional expandable actions for a call log entry --> + <ViewStub android:id="@+id/call_log_entry_actions_stub" + android:inflatedId="@+id/call_log_entry_actions" + android:layout="@layout/call_log_list_item_actions" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="bottom" /> + </android.support.v7.widget.CardView> </LinearLayout> diff --git a/res/layout/call_log_list_item_actions.xml b/res/layout/call_log_list_item_actions.xml index 1280089f5..8ef92bf1a 100644 --- a/res/layout/call_log_list_item_actions.xml +++ b/res/layout/call_log_list_item_actions.xml @@ -14,100 +14,53 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License --> -<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:id="@+id/call_log_action_container"> - <LinearLayout - android:id="@+id/call_log_entry_actions_ll" - android:gravity="center_vertical" +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/call_log_action_container" + android:gravity="center_vertical" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:visibility="visible" + android:importantForAccessibility="1"> + + <!-- Temporary border spacer. --> + <View android:layout_width="match_parent" - android:layout_height="@dimen/call_log_action_height" - android:orientation="horizontal" - android:paddingStart="@dimen/call_log_actions_left_padding" - android:visibility="visible" - android:importantForAccessibility="1" - > - <TextView - android:id="@+id/call_back_action" - android:background="?android:attr/selectableItemBackground" - android:gravity="center" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="@dimen/call_log_action_horizontal_padding" - android:paddingEnd="@dimen/call_log_action_horizontal_padding" - android:text="@string/call_log_action_call_back" - android:textColor="@color/call_log_action_text" - android:textSize="@dimen/call_log_list_item_actions_text_size" - android:textStyle="bold" - android:nextFocusLeft="@+id/primary_action_view" - android:nextFocusRight="@+id/video_call_action" - android:focusable="true" - android:singleLine="true"/> - <TextView - android:id="@+id/video_call_action" - android:background="?android:attr/selectableItemBackground" - android:gravity="center" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="@dimen/call_log_action_horizontal_padding" - android:paddingEnd="@dimen/call_log_action_horizontal_padding" - android:text="@string/call_log_action_video_call" - android:textColor="?attr/call_log_secondary_text_color" - android:textSize="@dimen/call_log_list_item_actions_text_size" - android:textStyle="bold" - android:nextFocusLeft="@+id/call_back_action" - android:nextFocusRight="@+id/voicemail_action" - android:focusable="true" - android:singleLine="true"/> - <TextView - android:id="@+id/voicemail_action" - android:background="?android:attr/selectableItemBackground" - android:gravity="center" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="@dimen/call_log_action_horizontal_padding" - android:paddingEnd="@dimen/call_log_action_horizontal_padding" - android:text="@string/call_log_action_voicemail" - android:textColor="@color/call_log_action_text" - android:textSize="@dimen/call_log_list_item_actions_text_size" - android:textStyle="bold" - android:nextFocusLeft="@+id/video_call_action" - android:nextFocusRight="@+id/details_action" - android:focusable="true" - android:singleLine="true"/> - <TextView - android:id="@+id/details_action" - android:background="?android:attr/selectableItemBackground" - android:gravity="center" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="@dimen/call_log_action_horizontal_padding" - android:paddingEnd="@dimen/call_log_action_horizontal_padding" - android:text="@string/call_log_action_details" - android:textColor="?attr/call_log_secondary_text_color" - android:textSize="@dimen/call_log_list_item_actions_text_size" - android:textStyle="bold" - android:nextFocusLeft="@+id/voicemail_action" - android:nextFocusRight="@+id/report_action" - android:focusable="true" - android:singleLine="true"/> - <TextView - android:id="@+id/report_action" - android:background="?android:attr/selectableItemBackground" - android:gravity="center" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="@dimen/call_log_action_horizontal_padding" - android:paddingEnd="@dimen/call_log_action_horizontal_padding" - android:text="@string/call_log_action_report" - android:textColor="?attr/call_log_secondary_text_color" - android:textSize="@dimen/call_log_list_item_actions_text_size" - android:textStyle="bold" - android:nextFocusLeft="@+id/details_action" - android:nextFocusRight="@+id/primary_action_view" - android:focusable="true" - android:singleLine="true" - android:visibility="gone"/> - </LinearLayout> -</FrameLayout> + android:layout_height="1dp" + android:layout_weight="1" + android:background="#eeeeee" /> + + <TextView + android:id="@+id/video_call_action" + style="@style/CallLogActionsStyle" + android:background="?android:attr/selectableItemBackground" + android:text="@string/call_log_action_video_call" + android:nextFocusLeft="@+id/primary_action_view" + android:nextFocusRight="@+id/voicemail_action" /> + + <TextView + android:id="@+id/voicemail_action" + style="@style/CallLogActionsStyle" + android:background="?android:attr/selectableItemBackground" + android:text="@string/call_log_action_voicemail" + android:nextFocusLeft="@+id/video_call_action" + android:nextFocusRight="@+id/details_action" /> + + <TextView + android:id="@+id/details_action" + style="@style/CallLogActionsStyle" + android:background="?android:attr/selectableItemBackground" + android:text="@string/call_log_action_details" + android:nextFocusLeft="@+id/voicemail_action" + android:nextFocusRight="@+id/report_action" /> + + <TextView + android:id="@+id/report_action" + style="@style/CallLogActionsStyle" + android:background="?android:attr/selectableItemBackground" + android:text="@string/call_log_action_report" + android:nextFocusLeft="@+id/details_action" + android:nextFocusRight="@+id/primary_action_view" + android:visibility="gone" /> + +</LinearLayout> diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 0902cb70d..502b21a59 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -99,14 +99,14 @@ <dimen name="search_list_padding_top">16dp</dimen> <dimen name="search_box_elevation">3dp</dimen> - <!-- Padding to the left and right of call log action buttons. --> - <dimen name="call_log_action_horizontal_padding">8dp</dimen> + <dimen name="call_log_action_height">48dp</dimen> + <dimen name="call_log_action_horizontal_padding">24dp</dimen> <!-- Left-padding for the call log action buttons - ensures the buttons align with the text to the right of the contact badge. Adjust when any of the following change: call_log_action_horizontal_padding call_log_list_contact_photo_size --> <dimen name="call_log_actions_left_padding">64dp</dimen> - <dimen name="call_log_primary_text_size">16sp</dimen> + <dimen name="call_log_primary_text_size">14sp</dimen> <dimen name="call_log_secondary_text_size">14sp</dimen> <dimen name="call_log_list_item_actions_text_size">12sp</dimen> <!-- Height of the call log actions section for each call log entry --> diff --git a/res/values/strings.xml b/res/values/strings.xml index 4c4921d31..4ee5b45c8 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -539,30 +539,10 @@ [CHAR LIMIT=21] --> <string name="favorites_menu_all_contacts">ALL CONTACTS</string> - <!-- Button text for the "call back" button displayed underneath an entry in the call log. This - is used to describe the action of calling a phone number that the user previously received - an incoming call from. Tapping causes a call to be placed to the number represented by the - call log entry. - [CHAR LIMIT=30] --> - <string name="call_log_action_call_back">CALL BACK</string> - - <!-- BUTTON text for the "call" button displayed underneath an entry in the call log. This - is used to describe the action of calling a phone number. Tapping causes a call to be - placed to the number represented by the call log entry. - [CHAR LIMIT=30] --> - <string name="call_log_action_call">CALL</string> - - <!-- BUTTON text for the "redial" button displayed underneath an entry in the call log. This - is used to describe the action of calling a phone number that the user previously made an - outgoing call to. Tapping causes a call to be placed to the number represented by the call - log entry. - [CHAR LIMIT=30] --> - <string name="call_log_action_redial">REDIAL</string> - - <!-- Button text for the "video call" button displayed underneath an entry in the call log. + <!-- Button text for the "video call" displayed underneath an entry in the call log. Tapping causes a video call to be placed to the caller represented by the call log entry. - [CHAR LIMIT=30] --> - <string name="call_log_action_video_call">VIDEO CALL</string> + [CHAR LIMIT=50] --> + <string name="call_log_action_video_call">Video call</string> <!-- Button text for the "LISTEN" button displayed underneath an entry in the call log. Tapping navigates the user to the call details screen where the user can listen to the @@ -570,11 +550,10 @@ [CHAR LIMIT=30] --> <string name="call_log_action_voicemail">LISTEN</string> - <!-- Button text for the "DETAILS" button displayed underneath an entry in the call log. + <!-- Button text for the button displayed underneath an entry in the call log. Tapping navigates the user to the call details screen where the user can view details for - the call log entry. - [CHAR LIMIT=30] --> - <string name="call_log_action_details">DETAILS</string> + the call log entry. [CHAR LIMIT=50] --> + <string name="call_log_action_details">View details</string> <!-- String describing an incoming missed call entry in the call log. Note: AccessibilityServices uses this attribute to announce what the view represents. @@ -598,11 +577,15 @@ [CHAR LIMIT=NONE] --> <string name="description_phone_account">on <xliff:g id="phoneAccount" example="SIM 1">^1</xliff:g></string> - <!-- String describing the "call back" action for an entry in the call log. The call back + <!-- String describing the phone icon on a call log list item. When tapped, it will place a + call to the number represented by that call log entry. [CHAR LIMIT=NONE]--> + <string name="description_call_log_call_action">Call</string> + + <!-- String describing the "call" action for an entry in the call log. The call back action triggers a return call to the named user. Note: AccessibilityServices uses this attribute to announce the purpose of the button. [CHAR LIMIT=NONE] --> - <string name="description_call_back_action">Call back <xliff:g id="nameOrNumber" example="John Smith">^1</xliff:g></string> + <string name="description_call_action">Call <xliff:g id="nameOrNumber" example="John Smith">^1</xliff:g></string> <!-- String describing the "video call" action for an entry in the call log. The video call action triggers a return video call to the named person/number. @@ -630,7 +613,7 @@ <!-- Button text for the "report" button displayed underneath an entry in the call log. Tapping causes the call log entry to be reported to Google as a bad id. [CHAR LIMIT=30] --> - <string name="call_log_action_report">REPORT</string> + <string name="call_log_action_report">Report</string> <!-- String used as a header in the call log above calls which occurred today. [CHAR LIMIT=65] --> diff --git a/res/values/styles.xml b/res/values/styles.xml index 8bd5f9d8e..cfb2480c8 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -158,6 +158,19 @@ <item name="android:overScrollMode">always</item> </style> + <style name="CallLogActionsStyle"> + <item name="android:layout_width">match_parent</item> + <item name="android:layout_height">@dimen/call_log_action_height</item> + <item name="android:gravity">start|center_vertical</item> + <item name="android:paddingStart">@dimen/call_log_action_horizontal_padding</item> + <item name="android:paddingEnd">@dimen/call_log_action_horizontal_padding</item> + <item name="android:textColor">?attr/call_log_secondary_text_color</item> + <item name="android:textSize">@dimen/call_log_list_item_actions_text_size</item> + <item name="android:fontFamily">"sans-serif-medium"</item> + <item name="android:focusable">true</item> + <item name="android:singleLine">true</item> + </style> + <style name="DismissButtonStyle"> <item name="android:paddingLeft">@dimen/dismiss_button_padding_start</item> <item name="android:paddingRight">@dimen/dismiss_button_padding_end</item> |