summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/calllog/ui/res/layout
diff options
context:
space:
mode:
Diffstat (limited to 'java/com/android/dialer/calllog/ui/res/layout')
-rw-r--r--java/com/android/dialer/calllog/ui/res/layout/new_call_log_entry.xml91
1 files changed, 49 insertions, 42 deletions
diff --git a/java/com/android/dialer/calllog/ui/res/layout/new_call_log_entry.xml b/java/com/android/dialer/calllog/ui/res/layout/new_call_log_entry.xml
index e3052c097..2fc8e7bb8 100644
--- a/java/com/android/dialer/calllog/ui/res/layout/new_call_log_entry.xml
+++ b/java/com/android/dialer/calllog/ui/res/layout/new_call_log_entry.xml
@@ -17,6 +17,7 @@
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="72dp">
@@ -29,22 +30,34 @@
android:layout_marginEnd="10dp"
android:layout_centerVertical="true"/>
- <!-- The frame layout is necessary to avoid clipping the icons and ellipsize the text when the
- content is too wide to fit.
- -->
- <FrameLayout
- android:id="@+id/primary_row"
+ <LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_marginTop="14dp"
android:layout_toEndOf="@+id/contact_photo_view"
- android:layout_toStartOf="@+id/menu_button">
+ android:layout_toStartOf="@+id/menu_button"
+ android:orientation="vertical">
+ <!-- 1st row: primary info -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginTop="14dp"
android:orientation="horizontal">
+ <!--
+ Important note:
+
+ The following TextView is the only widget that defines a weight in the containing
+ LinearLayout, of which the purpose is to avoid pushing the widgets after it out of the
+ boundary when the text is too long.
+
+ Generally it is more efficient to assign a width/height of 0dp so that the TextView does
+ not have to measure its own size since it will absorb all the remaining space anyway.
+
+ However, as the TextView is part of an entry in the call log's RecyclerView, we must set
+ layout_width to "wrap_content" so that the TextView can adjust its size when recycled for
+ text of different lengths.
+ -->
<TextView
android:id="@+id/primary_text"
style="@style/PrimaryText"
@@ -54,32 +67,29 @@
android:layout_marginEnd="6dp"
android:ellipsize="end"
android:lineSpacingMultiplier="1.5"
- android:singleLine="true"/>
-
+ android:singleLine="true"
+ tools:ignore="InefficientWeight"/>
<ImageView
android:id="@+id/hd_icon"
android:layout_width="wrap_content"
android:layout_height="18dp"
android:layout_gravity="center_vertical"
- android:src="@drawable/quantum_ic_hd_vd_theme_24"
- />
+ android:src="@drawable/quantum_ic_hd_vd_theme_24"/>
<ImageView
android:id="@+id/wifi_icon"
android:layout_width="wrap_content"
android:layout_height="18dp"
android:layout_gravity="center_vertical"
- android:src="@drawable/quantum_ic_signal_wifi_4_bar_vd_theme_24"
- />
+ android:src="@drawable/quantum_ic_signal_wifi_4_bar_vd_theme_24"/>
<ImageView
android:id="@+id/assisted_dial_icon"
android:layout_width="wrap_content"
android:layout_height="18dp"
android:layout_gravity="center_vertical"
- android:src="@drawable/quantum_ic_language_vd_theme_24"
- />
+ android:src="@drawable/quantum_ic_language_vd_theme_24"/>
<TextView
android:id="@+id/call_count"
@@ -90,43 +100,40 @@
android:lineSpacingMultiplier="1.5"/>
</LinearLayout>
- </FrameLayout>
-
- <LinearLayout
- android:id="@+id/secondary_row"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@+id/primary_row"
- android:layout_toEndOf="@+id/contact_photo_view"
- android:orientation="horizontal">
- <ImageView
- android:id="@+id/call_type_icon"
+ <!-- 2nd row: secondary info -->
+ <LinearLayout
android:layout_width="wrap_content"
- android:layout_height="18dp"
- android:layout_gravity="center_vertical"
- />
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+ <ImageView
+ android:id="@+id/call_type_icon"
+ android:layout_width="wrap_content"
+ android:layout_height="18dp"
+ android:layout_gravity="center_vertical"/>
+
+ <TextView
+ android:id="@+id/secondary_text"
+ style="@style/SecondaryText"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:ellipsize="end"
+ android:lineSpacingMultiplier="1.4"
+ android:singleLine="true"/>
+
+ </LinearLayout>
+
+ <!-- 3rd row: phone account info -->
<TextView
- android:id="@+id/secondary_text"
+ android:id="@+id/phone_account"
style="@style/SecondaryText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
- android:lineSpacingMultiplier="1.4"
android:singleLine="true"/>
- </LinearLayout>
- <TextView
- android:id="@+id/phone_account"
- style="@style/SecondaryText"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@+id/secondary_row"
- android:layout_toEndOf="@+id/contact_photo_view"
- android:ellipsize="end"
- android:singleLine="true"
- android:visibility="visible"/>
+ </LinearLayout>
<ImageView
android:id="@+id/menu_button"