Files
app_Settings/res/layout/le_audio_bt_entity_header.xml
Angela Wang b5dbe8af2b Show battery info for mono audio location device
1. Show mono battery info in LeAudioBluetoothDetailsHeaderController
   without side text in front of the battery icon
2. Show mono side device on Settings > Accessibility > Hearing devices's
   summary without side information

Flag: EXEMPT bugfix
Bug: 379616650
Test: atest AccessibilityHearingAidPreferenceControllerTest
Test: manually check UI with real device
Change-Id: I4a1a3357e2cef51df505923e38da33767c78e8f3
2024-11-22 07:17:48 +00:00

199 lines
9.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2022 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"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/entity_header"
style="@style/EntityHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:gravity="center_horizontal"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center">
<TextView
android:id="@+id/entity_header_title"
style="@style/TextAppearance.EntityHeaderTitle"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:ellipsize="marquee"
android:textDirection="locale"
android:layout_marginStart="48dp"
android:layout_marginEnd="48dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constrainedWidth="true" />
<ImageButton
android:id="@+id/rename_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="@dimen/min_tap_target_size"
android:minHeight="@dimen/min_tap_target_size"
android:background="@android:color/transparent"
android:src="@drawable/ic_mode_edit"
android:contentDescription="@string/bluetooth_rename_button"
android:tint="@color/settingslib_materialColorOnSurface"
app:layout_constraintStart_toEndOf="@+id/entity_header_title"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:visibility="gone" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/entity_header_summary"
style="@style/TextAppearance.EntityHeaderSummary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="4dp"
android:ellipsize="marquee"
android:textDirection="locale"/>
<ImageView
android:id="@+id/entity_header_icon"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_marginTop="24dp"
android:scaleType="fitCenter"
android:antialias="true"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center_vertical"
android:orientation="vertical">
<LinearLayout
android:id="@+id/bt_battery_case"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/le_bluetooth_battery_start_margin"
android:layout_marginTop="@dimen/le_bluetooth_battery_top_margin"
android:orientation="horizontal"
android:visibility="gone"
android:focusable="true">
<TextView
style="@style/TextAppearance.EntityHeaderTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start|center_vertical"
android:ellipsize="end"
android:textDirection="locale"
android:text="@string/bluetooth_middle_name"
android:textSize="@dimen/advanced_bluetooth_header_title_text_size"/>
<TextView
android:id="@+id/bt_battery_case_summary"
style="@style/TextAppearance.EntityHeaderSummary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/le_bluetooth_summary_start_margin"
android:minWidth="@dimen/le_bluetooth_summary_min_width"
android:padding="@dimen/le_bluetooth_summary_padding"
android:drawablePadding="@dimen/le_bluetooth_summary_drawable_padding"/>
</LinearLayout>
<LinearLayout
android:id="@+id/bt_battery_left"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/le_bluetooth_battery_start_margin"
android:layout_marginTop="@dimen/le_bluetooth_battery_top_margin"
android:orientation="horizontal"
android:visibility="gone"
android:focusable="true">
<TextView
style="@style/TextAppearance.EntityHeaderTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start|center_vertical"
android:ellipsize="end"
android:textDirection="locale"
android:text="@string/bluetooth_left_name"
android:textSize="@dimen/advanced_bluetooth_header_title_text_size"/>
<TextView
android:id="@+id/bt_battery_left_summary"
style="@style/TextAppearance.EntityHeaderSummary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/le_bluetooth_summary_start_margin"
android:minWidth="@dimen/le_bluetooth_summary_min_width"
android:padding="@dimen/le_bluetooth_summary_padding"
android:drawablePadding="@dimen/le_bluetooth_summary_drawable_padding"/>
</LinearLayout>
<LinearLayout
android:id="@+id/bt_battery_right"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/le_bluetooth_battery_start_margin"
android:layout_marginTop="@dimen/le_bluetooth_battery_top_margin"
android:orientation="horizontal"
android:visibility="gone"
android:focusable="true">
<TextView
style="@style/TextAppearance.EntityHeaderTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start|center_vertical"
android:ellipsize="end"
android:textDirection="locale"
android:text="@string/bluetooth_right_name"
android:textSize="@dimen/advanced_bluetooth_header_title_text_size"/>
<TextView
android:id="@+id/bt_battery_right_summary"
style="@style/TextAppearance.EntityHeaderSummary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/le_bluetooth_summary_start_margin"
android:minWidth="@dimen/le_bluetooth_summary_min_width"
android:padding="@dimen/le_bluetooth_summary_padding"
android:drawablePadding="@dimen/le_bluetooth_summary_drawable_padding"/>
</LinearLayout>
<LinearLayout
android:id="@+id/bt_battery_mono"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/le_bluetooth_battery_start_margin"
android:layout_marginTop="@dimen/le_bluetooth_battery_top_margin"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:visibility="gone"
android:focusable="true">
<TextView
android:id="@+id/bt_battery_mono_summary"
style="@style/TextAppearance.EntityHeaderSummary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/le_bluetooth_summary_padding"
android:drawablePadding="@dimen/le_bluetooth_summary_drawable_padding"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>