1<?xml version="1.0" encoding="utf-8"?>
2<!--
3  ~ Copyright (C) 2017 The Android Open Source Project
4  ~
5  ~ Licensed under the Apache License, Version 2.0 (the "License");
6  ~ you may not use this file except in compliance with the License.
7  ~ You may obtain a copy of the License at
8  ~
9  ~      http://www.apache.org/licenses/LICENSE-2.0
10  ~
11  ~ Unless required by applicable law or agreed to in writing, software
12  ~ distributed under the License is distributed on an "AS IS" BASIS,
13  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  ~ See the License for the specific language governing permissions and
15  ~ limitations under the License
16  -->
17
18<RelativeLayout
19    xmlns:android="http://schemas.android.com/apk/res/android"
20    xmlns:tools="http://schemas.android.com/tools"
21    android:id="@+id/new_call_log_entry_root"
22    android:layout_width="match_parent"
23    android:layout_height="wrap_content"
24    android:minHeight="72dp"
25    android:background="?android:attr/selectableItemBackground">
26
27  <com.android.dialer.widget.ContactPhotoView
28      android:id="@+id/contact_photo_view"
29      android:layout_width="wrap_content"
30      android:layout_height="wrap_content"
31      android:layout_marginStart="8dp"
32      android:layout_marginEnd="8dp"
33      android:layout_centerVertical="true"/>
34
35  <!--
36    A vertical linear layout of three rows: primary info, secondary info, and phone account info.
37    It is marked as not important for a11y as we will set a more user-friendly content description
38    for the entire entry view in Java code.
39  -->
40  <LinearLayout
41      android:layout_width="wrap_content"
42      android:layout_height="wrap_content"
43      android:layout_centerVertical="true"
44      android:layout_toEndOf="@+id/contact_photo_view"
45      android:layout_toStartOf="@+id/call_button"
46      android:orientation="vertical"
47      android:importantForAccessibility="noHideDescendants">
48
49    <!-- 1st row: primary info -->
50    <LinearLayout
51        android:layout_width="wrap_content"
52        android:layout_height="wrap_content"
53        android:orientation="horizontal">
54
55      <!--
56          Important note:
57
58          The following BidiTextView is the only widget that defines a weight in the containing
59          LinearLayout, of which the purpose is to avoid pushing the widgets after it out of the
60          boundary when the text is too long.
61
62          Generally it is more efficient to assign a width/height of 0dp so that the BidiTextView
63          does not have to measure its own size since it will absorb all the remaining space anyway.
64
65          However, as the BidiTextView is part of an entry in the call log's RecyclerView, we must
66          set layout_width to "wrap_content" so that the TextView can adjust its size when recycled
67          for text of different lengths.
68      -->
69      <com.android.dialer.widget.BidiTextView
70          android:id="@+id/primary_text"
71          style="@style/Dialer.TextAppearance.Primary.Ellipsize"
72          android:layout_width="wrap_content"
73          android:layout_height="wrap_content"
74          android:layout_weight="1"
75          android:layout_marginEnd="6dp"
76          android:lineSpacingMultiplier="1.5"
77          tools:ignore="InefficientWeight"/>
78
79      <ImageView
80          android:id="@+id/hd_icon"
81          android:layout_width="wrap_content"
82          android:layout_height="18dp"
83          android:layout_gravity="center_vertical"
84          android:importantForAccessibility="no"
85          android:src="@drawable/quantum_ic_hd_vd_theme_24"/>
86
87      <ImageView
88          android:id="@+id/wifi_icon"
89          android:layout_width="wrap_content"
90          android:layout_height="18dp"
91          android:layout_gravity="center_vertical"
92          android:importantForAccessibility="no"
93          android:src="@drawable/quantum_ic_signal_wifi_4_bar_vd_theme_24"/>
94
95      <ImageView
96          android:id="@+id/assisted_dial_icon"
97          android:layout_width="wrap_content"
98          android:layout_height="18dp"
99          android:layout_gravity="center_vertical"
100          android:importantForAccessibility="no"
101          android:src="@drawable/quantum_ic_language_vd_theme_24"/>
102
103      <TextView
104          android:id="@+id/call_count"
105          style="@style/Dialer.TextAppearance.Primary"
106          android:layout_width="wrap_content"
107          android:layout_height="wrap_content"
108          android:layout_marginEnd="6dp"
109          android:lineSpacingMultiplier="1.5"/>
110
111    </LinearLayout>
112
113    <!-- 2nd row: secondary info -->
114    <LinearLayout
115        android:layout_width="wrap_content"
116        android:layout_height="wrap_content"
117        android:orientation="horizontal"
118        tools:ignore="UseCompoundDrawables">
119
120      <ImageView
121          android:id="@+id/call_type_icon"
122          android:layout_width="wrap_content"
123          android:layout_height="18dp"
124          android:layout_gravity="center_vertical"
125          android:importantForAccessibility="no"/>
126
127      <TextView
128          android:id="@+id/secondary_text"
129          style="@style/Dialer.TextAppearance.Secondary.Ellipsize"
130          android:layout_width="wrap_content"
131          android:layout_height="wrap_content"
132          android:lineSpacingMultiplier="1.4"/>
133
134    </LinearLayout>
135
136    <!-- 3rd row: phone account info -->
137    <TextView
138        android:id="@+id/phone_account"
139        style="@style/Dialer.TextAppearance.Secondary.Ellipsize"
140        android:layout_width="wrap_content"
141        android:layout_height="wrap_content"/>
142
143  </LinearLayout>
144
145  <!--
146    The button to make a call.
147    Its content description is set in Java code.
148  -->
149  <ImageView
150      android:id="@+id/call_button"
151      android:layout_width="56dp"
152      android:layout_height="72dp"
153      android:layout_alignParentEnd="true"
154      android:layout_centerVertical="true"
155      android:background="?android:attr/selectableItemBackgroundBorderless"
156      android:scaleType="center"
157      android:tint="?colorIcon"
158      tools:ignore="ContentDescription"/>
159</RelativeLayout>
160