Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c1b7d0ae authored by Andrew Lee's avatar Andrew Lee
Browse files

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
parent 1582ac15
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
<?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
+12 −12
Original line number Diff line number Diff line
@@ -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,25 +140,27 @@
            </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" />

        </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"/>

        </LinearLayout>
            android:layout_height="wrap_content"
            android:layout_gravity="bottom" />

    </android.support.v7.widget.CardView>

+49 −96
Original line number Diff line number Diff line
@@ -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"
<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="@dimen/call_log_action_height"
        android:orientation="horizontal"
        android:paddingStart="@dimen/call_log_actions_left_padding"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    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"/>
    android:importantForAccessibility="1">

    <!-- Temporary border spacer. -->
    <View
        android:layout_width="match_parent"
        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: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"/>
        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: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"/>
        android:nextFocusRight="@+id/details_action" />

    <TextView
        android:id="@+id/details_action"
        style="@style/CallLogActionsStyle"
        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"/>
        android:nextFocusRight="@+id/report_action" />

    <TextView
        android:id="@+id/report_action"
        style="@style/CallLogActionsStyle"
        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>
+3 −3
Original line number Diff line number Diff line
@@ -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 -->
+13 −30
Original line number Diff line number Diff line
@@ -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] -->
Loading