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

Commit 12bbdb5a authored by Danny Baumann's avatar Danny Baumann
Browse files

Re-add call stats feature.

Change-Id: Ib00ab753077788670f1d3390b2031beecb3b65c4
parent bb460785
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -187,6 +187,17 @@
            </intent-filter>
        </activity>

        <activity android:name=".callstats.CallStatsDetailActivity"
            android:label="@string/callStatsDetailTitle"
            android:theme="@style/CallDetailActivityTheme"
            android:screenOrientation="portrait"
            android:icon="@mipmap/ic_launcher_phone" >
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

        <activity android:name="com.android.contacts.common.test.FragmentTestActivity">
            <intent-filter>
                <category android:name="android.intent.category.TEST"/>
+34 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above
      copyright notice, this list of conditions and the following
      disclaimer in the documentation and/or other materials provided
      with the distribution.
    * Neither the name of The Linux Foundation, Inc. nor the names of its
      contributors may be used to endorse or promote products derived
      from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    style="@style/CallLogSpinnerStyle"
    android:layout_width="match_parent"
    android:layout_height="40dip"
    android:paddingLeft="8dip"
    android:paddingRight="8dip" />
+21 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:paddingStart="@dimen/call_log_outer_margin"
    android:paddingEnd="@dimen/call_log_outer_margin"
    android:paddingBottom="@dimen/call_log_inner_margin">
    <Spinner
        android:id="@+id/filter_sub_spinner"
        android:layout_width="0dip"
        android:layout_height="@dimen/list_section_divider_min_height"
        android:layout_weight="1.2"
        android:layout_marginTop="5dip" />
    <Spinner
        android:id="@+id/filter_status_spinner"
        android:layout_width="0dip"
        android:layout_height="@dimen/list_section_divider_min_height"
        android:layout_weight="2"
        android:layout_marginTop="5dip" />
</LinearLayout>
+109 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2009 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:id="@+id/call_stats_detail"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:layout_alignParentStart="true"
    android:layout_alignParentTop="true"
    android:background="@color/background_dialer_call_log" >

    <!-- Caller information "card" -->
    <LinearLayout
        android:id="@+id/caller_information"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingStart="@dimen/call_detail_horizontal_margin"
        android:paddingTop="@dimen/call_detail_top_margin"
        android:paddingBottom="@dimen/call_detail_bottom_margin"
        android:baselineAligned="false"
        android:orientation="horizontal"
        android:elevation="@dimen/call_detail_elevation"
        android:focusable="true"
        android:background="@color/background_dialer_white" >

        <QuickContactBadge
            android:id="@+id/quick_contact_photo"
            android:layout_width="@dimen/contact_photo_size"
            android:layout_height="@dimen/contact_photo_size"
            android:layout_alignParentStart="true"
            android:layout_gravity="top"
            android:layout_marginTop="3dp"
            android:focusable="true" />

        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:orientation="vertical"
            android:gravity="center_vertical"
            android:layout_marginStart="@dimen/call_detail_horizontal_margin">

            <TextView
                android:id="@+id/caller_name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textColor="?attr/call_log_primary_text_color"
                android:textSize="@dimen/call_log_primary_text_size"
                android:includeFontPadding="false"
                android:layout_marginBottom="5dp"
                android:singleLine="true" />

            <TextView
                android:id="@+id/caller_number"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textColor="?attr/call_log_secondary_text_color"
                android:textSize="@dimen/call_log_secondary_text_size"
                android:layout_marginBottom="1dp"
                android:singleLine="true" />

            <TextView
                android:id="@+id/phone_account_label"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textColor="?attr/call_log_secondary_text_color"
                android:textSize="@dimen/call_log_secondary_text_size"
                android:singleLine="true"
                android:visibility="gone"
                />
        </LinearLayout>

        <ImageView
            android:id="@+id/call_back_button"
            android:layout_width="@dimen/call_log_list_item_primary_action_dimen"
            android:layout_height="@dimen/call_log_list_item_primary_action_dimen"
            android:layout_marginEnd="16dp"
            android:background="?android:attr/selectableItemBackgroundBorderless"
            android:src="@drawable/ic_call_24dp"
            android:scaleType="center"
            android:tint="@color/call_log_list_item_primary_action_icon_tint"
            android:contentDescription="@string/description_call_log_call_action"
            android:visibility="gone" />

    </LinearLayout>

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <!-- The actual details -->
        <include layout="@layout/call_stats_detail_info" />

    </ScrollView>

</LinearLayout>
+239 −0
Original line number Diff line number Diff line
<?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.
-->

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:ex="http://schemas.android.com/apk/res/com.android.dialer"
    android:id="@+id/call_stats_info"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:paddingStart="@dimen/call_detail_horizontal_margin"
    android:paddingEnd="@dimen/call_detail_horizontal_margin"
    android:paddingTop="@dimen/call_log_inner_margin"
    android:paddingBottom="@dimen/call_log_inner_margin">

    <TextView
        android:id="@+id/date_filter"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:textColor="@color/secondary_text_color" />

    <RelativeLayout
        android:id="@+id/duration_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/date_filter">

        <TextView
            android:id="@+id/durations_header"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/call_stats_title_durations"
            android:layout_marginBottom="@dimen/call_log_vertical_padding"
            android:textColor="?android:attr/colorAccent"
            style="@android:style/TextAppearance.Material.Subhead" />

        <TextView
            android:id="@+id/total_duration_total"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:layout_below="@id/durations_header"
            android:textColor="?attr/call_log_primary_text_color"
            android:textSize="@dimen/call_log_primary_text_size" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentStart="true"
            android:layout_toStartOf="@id/total_duration_total"
            android:layout_alignBaseline="@id/total_duration_total"
            android:text="@string/call_stats_title_of_total"
            android:textColor="?attr/call_log_primary_text_color"
            android:textSize="@dimen/call_log_primary_text_size" />

        <com.android.dialer.widget.LinearColorBar
            android:id="@+id/duration_total_percent_bar"
            android:layout_width="match_parent"
            android:layout_below="@id/total_duration_total"
            style="@style/CallStatsBarStyle" />

        <TextView
            android:id="@+id/total_duration_number"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:layout_below="@id/duration_total_percent_bar"
            android:textColor="?attr/call_log_primary_text_color"
            android:textSize="@dimen/call_log_primary_text_size" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentStart="true"
            android:layout_toStartOf="@id/total_duration_number"
            android:layout_alignBaseline="@id/total_duration_number"
            android:text="@string/call_stats_title_for_number"
            android:textColor="?attr/call_log_primary_text_color"
            android:textSize="@dimen/call_log_primary_text_size" />

        <com.android.dialer.widget.LinearColorBar
            android:id="@+id/duration_number_percent_bar"
            android:layout_width="match_parent"
            android:layout_below="@id/total_duration_number"
            style="@style/CallStatsBarStyle" />

        <include
            android:id="@+id/in_duration"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/duration_number_percent_bar"
            android:layout_marginBottom="@dimen/call_log_icon_margin"
            layout="@layout/call_stats_detail_line" />

        <include
            android:id="@+id/out_duration"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/in_duration"
            android:layout_marginBottom="@dimen/call_log_icon_margin"
            layout="@layout/call_stats_detail_line" />

    </RelativeLayout>

    <TextView
        android:id="@+id/count_header"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/duration_container"
        android:layout_marginTop="@dimen/call_log_vertical_padding"
        android:layout_marginBottom="@dimen/call_log_vertical_padding"
        android:text="@string/call_stats_title_count"
        android:textColor="?android:attr/colorAccent"
        style="@android:style/TextAppearance.Material.Subhead" />

    <TextView
        android:id="@+id/total_count_total"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentEnd="true"
        android:layout_below="@id/count_header"
        android:textColor="?attr/call_log_primary_text_color"
        android:textSize="@dimen/call_log_primary_text_size" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentStart="true"
        android:layout_toStartOf="@id/total_count_total"
        android:layout_alignBaseline="@id/total_count_total"
        android:text="@string/call_stats_title_of_total"
        android:textColor="?attr/call_log_primary_text_color"
        android:textSize="@dimen/call_log_primary_text_size" />

    <com.android.dialer.widget.LinearColorBar
        android:id="@+id/count_total_percent_bar"
        android:layout_width="match_parent"
        android:layout_below="@id/total_count_total"
        style="@style/CallStatsBarStyle" />

    <TextView
        android:id="@+id/total_count_number"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentEnd="true"
        android:layout_below="@id/count_total_percent_bar"
        android:textColor="?attr/call_log_primary_text_color"
        android:textSize="@dimen/call_log_primary_text_size" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentStart="true"
        android:layout_toStartOf="@id/total_count_number"
        android:layout_alignBaseline="@id/total_count_number"
        android:text="@string/call_stats_title_for_number"
        android:textColor="?attr/call_log_primary_text_color"
        android:textSize="@dimen/call_log_primary_text_size" />

    <com.android.dialer.widget.LinearColorBar
        android:id="@+id/count_number_percent_bar"
        android:layout_width="match_parent"
        android:layout_below="@id/total_count_number"
        style="@style/CallStatsBarStyle" />

    <include
        android:id="@+id/in_count"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/count_number_percent_bar"
        android:layout_marginBottom="@dimen/call_log_icon_margin"
        layout="@layout/call_stats_detail_line" />

    <include
        android:id="@+id/out_count"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/in_count"
        android:layout_marginBottom="@dimen/call_log_icon_margin"
        layout="@layout/call_stats_detail_line" />

    <include
        android:id="@+id/missed_count"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/out_count"
        android:layout_marginBottom="@dimen/call_log_icon_margin"
        layout="@layout/call_stats_detail_line" />

    <include
        android:id="@+id/blocked_count"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/missed_count"
        android:layout_marginBottom="@dimen/call_log_icon_margin"
        layout="@layout/call_stats_detail_line" />

    <TextView
        android:id="@+id/average_header"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/blocked_count"
        android:layout_marginTop="@dimen/call_log_vertical_padding"
        android:layout_marginBottom="@dimen/call_log_vertical_padding"
        android:text="@string/call_stats_title_average_duration"
        android:textColor="?android:attr/colorAccent"
        style="@android:style/TextAppearance.Material.Subhead" />

    <include
        android:id="@+id/in_average"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/average_header"
        android:layout_marginBottom="@dimen/call_log_icon_margin"
        layout="@layout/call_stats_detail_line" />

    <include
        android:id="@+id/out_average"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/in_average"
        android:layout_marginBottom="@dimen/call_log_icon_margin"
        layout="@layout/call_stats_detail_line" />

</RelativeLayout>
Loading