1<?xml version="1.0" encoding="utf-8"?>
2<!--
3  Copyright (C) 2022 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<LinearLayout
19    xmlns:android="http://schemas.android.com/apk/res/android"
20    xmlns:app="http://schemas.android.com/apk/res-auto"
21    android:id="@+id/entity_header"
22    style="@style/EntityHeader"
23    android:layout_width="match_parent"
24    android:layout_height="wrap_content"
25    android:layout_centerHorizontal="true"
26    android:gravity="center_horizontal"
27    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
28    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
29    android:orientation="vertical">
30
31    <androidx.constraintlayout.widget.ConstraintLayout
32        android:layout_width="match_parent"
33        android:layout_height="wrap_content"
34        android:layout_gravity="center_horizontal"
35        android:gravity="center">
36        <TextView
37            android:id="@+id/entity_header_title"
38            style="@style/TextAppearance.EntityHeaderTitle"
39            android:layout_height="wrap_content"
40            android:layout_width="wrap_content"
41            android:layout_gravity="center_horizontal"
42            android:gravity="center"
43            android:ellipsize="marquee"
44            android:textDirection="locale"
45            android:layout_marginStart="48dp"
46            android:layout_marginEnd="48dp"
47            app:layout_constraintStart_toStartOf="parent"
48            app:layout_constraintEnd_toEndOf="parent"
49            app:layout_constraintTop_toTopOf="parent"
50            app:layout_constraintBottom_toBottomOf="parent"
51            app:layout_constrainedWidth="true" />
52        <ImageButton
53            android:id="@+id/rename_button"
54            android:layout_width="wrap_content"
55            android:layout_height="wrap_content"
56            android:minWidth="@dimen/min_tap_target_size"
57            android:minHeight="@dimen/min_tap_target_size"
58            android:background="@android:color/transparent"
59            android:src="@drawable/ic_mode_edit"
60            android:contentDescription="@string/bluetooth_rename_button"
61            android:tint="@color/settingslib_materialColorOnSurface"
62            app:layout_constraintStart_toEndOf="@+id/entity_header_title"
63            app:layout_constraintTop_toTopOf="parent"
64            app:layout_constraintBottom_toBottomOf="parent"
65            android:visibility="gone" />
66    </androidx.constraintlayout.widget.ConstraintLayout>
67
68    <TextView
69        android:id="@+id/entity_header_summary"
70        style="@style/TextAppearance.EntityHeaderSummary"
71        android:layout_width="wrap_content"
72        android:layout_height="wrap_content"
73        android:layout_gravity="center_horizontal"
74        android:layout_marginTop="4dp"
75        android:ellipsize="marquee"
76        android:textDirection="locale"/>
77
78    <ImageView
79        android:id="@+id/entity_header_icon"
80        android:layout_width="72dp"
81        android:layout_height="72dp"
82        android:layout_marginTop="24dp"
83        android:scaleType="fitCenter"
84        android:antialias="true"/>
85
86    <LinearLayout
87        android:layout_width="wrap_content"
88        android:layout_height="wrap_content"
89        android:layout_gravity="center_horizontal"
90        android:gravity="center_vertical"
91        android:orientation="vertical">
92        <LinearLayout
93            android:id="@+id/bt_battery_case"
94            android:layout_width="match_parent"
95            android:layout_height="wrap_content"
96            android:layout_marginStart="@dimen/le_bluetooth_battery_start_margin"
97            android:layout_marginTop="@dimen/le_bluetooth_battery_top_margin"
98            android:orientation="horizontal"
99            android:visibility="gone"
100            android:focusable="true">
101            <TextView
102                style="@style/TextAppearance.EntityHeaderTitle"
103                android:layout_width="wrap_content"
104                android:layout_height="wrap_content"
105                android:layout_weight="1"
106                android:gravity="start|center_vertical"
107                android:ellipsize="end"
108                android:textDirection="locale"
109                android:text="@string/bluetooth_middle_name"
110                android:textSize="@dimen/advanced_bluetooth_header_title_text_size"/>
111            <TextView
112                android:id="@+id/bt_battery_case_summary"
113                style="@style/TextAppearance.EntityHeaderSummary"
114                android:layout_width="wrap_content"
115                android:layout_height="wrap_content"
116                android:layout_marginStart="@dimen/le_bluetooth_summary_start_margin"
117                android:minWidth="@dimen/le_bluetooth_summary_min_width"
118                android:padding="@dimen/le_bluetooth_summary_padding"
119                android:drawablePadding="@dimen/le_bluetooth_summary_drawable_padding"/>
120        </LinearLayout>
121        <LinearLayout
122            android:id="@+id/bt_battery_left"
123            android:layout_width="match_parent"
124            android:layout_height="wrap_content"
125            android:layout_marginStart="@dimen/le_bluetooth_battery_start_margin"
126            android:layout_marginTop="@dimen/le_bluetooth_battery_top_margin"
127            android:orientation="horizontal"
128            android:visibility="gone"
129            android:focusable="true">
130            <TextView
131                style="@style/TextAppearance.EntityHeaderTitle"
132                android:layout_width="wrap_content"
133                android:layout_height="wrap_content"
134                android:layout_weight="1"
135                android:gravity="start|center_vertical"
136                android:ellipsize="end"
137                android:textDirection="locale"
138                android:text="@string/bluetooth_left_name"
139                android:textSize="@dimen/advanced_bluetooth_header_title_text_size"/>
140            <TextView
141                android:id="@+id/bt_battery_left_summary"
142                style="@style/TextAppearance.EntityHeaderSummary"
143                android:layout_width="wrap_content"
144                android:layout_height="wrap_content"
145                android:layout_marginStart="@dimen/le_bluetooth_summary_start_margin"
146                android:minWidth="@dimen/le_bluetooth_summary_min_width"
147                android:padding="@dimen/le_bluetooth_summary_padding"
148                android:drawablePadding="@dimen/le_bluetooth_summary_drawable_padding"/>
149        </LinearLayout>
150        <LinearLayout
151            android:id="@+id/bt_battery_right"
152            android:layout_width="match_parent"
153            android:layout_height="wrap_content"
154            android:layout_marginStart="@dimen/le_bluetooth_battery_start_margin"
155            android:layout_marginTop="@dimen/le_bluetooth_battery_top_margin"
156            android:orientation="horizontal"
157            android:visibility="gone"
158            android:focusable="true">
159            <TextView
160                style="@style/TextAppearance.EntityHeaderTitle"
161                android:layout_width="wrap_content"
162                android:layout_height="wrap_content"
163                android:layout_weight="1"
164                android:gravity="start|center_vertical"
165                android:ellipsize="end"
166                android:textDirection="locale"
167                android:text="@string/bluetooth_right_name"
168                android:textSize="@dimen/advanced_bluetooth_header_title_text_size"/>
169            <TextView
170                android:id="@+id/bt_battery_right_summary"
171                style="@style/TextAppearance.EntityHeaderSummary"
172                android:layout_width="wrap_content"
173                android:layout_height="wrap_content"
174                android:layout_marginStart="@dimen/le_bluetooth_summary_start_margin"
175                android:minWidth="@dimen/le_bluetooth_summary_min_width"
176                android:padding="@dimen/le_bluetooth_summary_padding"
177                android:drawablePadding="@dimen/le_bluetooth_summary_drawable_padding"/>
178        </LinearLayout>
179    </LinearLayout>
180</LinearLayout>
181