1 <?xml version="1.0" encoding="utf-8"?>
3 <!-- Copyright 2015 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file.
8 <!-- Overall layout and amount of padding is based on specs for
9 "Two-line item (icon with text)" from:
10 https://www.google.com/design/spec/components/lists.html#lists-specs
13 - Left edge of the image is 16dp from the left edge of the screen
14 - Right edge of the text is 16dp from the right edge of the screen
15 - The height of the list item is 72dp
16 - Vertical text padding: top = bottom = 20dp
18 Intentional UI spec violation: We allow the status line to grow up to 2
19 lines, and therefore we can end up with a total of 3 lines. We want this
20 because this behavior preserves all of error information, and seems
22 - Still looks ok, despite not being strictly conforming to the UI spec.
23 - Happens rarely (on small screens in vertical orientation - think Nexus 5
26 TODO(lukasza): Temporary UI spec violation: The left edge of the text is
27 not exactly 72dp from the left edge of the screen. Instead of 72dp we
28 have 16dp (outer layout start padding) + 16dp (inner layout start padding)
29 + *original* image width. Overriding image width to be exactly 40dp would
30 achieve 72dp text distance from screen edge, but scaling the image leads
34 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
35 android:minHeight="72dp"
36 android:paddingStart="16dp"
37 android:paddingEnd="16dp"
38 android:paddingTop="20dp"
39 android:paddingBottom="20dp"
40 android:orientation="horizontal">
43 android:layout_gravity="start|center_vertical"
44 android:layout_height="wrap_content"
45 android:layout_width="wrap_content"
47 android:contentDescription="@string/host_icon_offline_description"
48 android:src="@drawable/ic_host_offline"/>
51 android:layout_gravity="end|center_vertical"
52 android:layout_height="wrap_content"
53 android:layout_width="0dp"
54 android:layout_weight="1"
55 android:orientation="vertical"
56 android:paddingStart="16dp"
57 android:paddingEnd="0dp"
58 android:paddingTop="0dp"
59 android:paddingBottom="0dp">
62 android:gravity="start|center_vertical"
63 android:id="@+id/host_label"
64 android:layout_height="wrap_content"
65 android:layout_width="wrap_content"
66 android:paddingTop="0dp"
67 android:textColor="?android:attr/textColorSecondary"
68 style="?android:attr/textAppearanceMedium"/>
71 android:ellipsize="end"
72 android:gravity="start|center_vertical"
73 android:id="@+id/host_status"
74 android:layout_height="wrap_content"
75 android:layout_width="wrap_content"
76 android:paddingBottom="0dp"
78 android:textColor="?android:attr/textColorSecondary"
79 style="?android:attr/textAppearanceSmall"/>