Add ring indicator for battery level

Bug: 343317785
Test: atest AdvancedBluetoothDetailsHeaderControllerTest
Flag: com.android.settings.flags.enable_bluetooth_device_details_polish
Change-Id: Ib657db60be8d377ea990674c4d2438ea8a6854d0
This commit is contained in:
Haijie Hong
2024-07-03 11:29:41 +08:00
parent 62db4b3a4d
commit 5d96249d6e
6 changed files with 78 additions and 13 deletions

View File

@@ -17,21 +17,43 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:focusable="true"
android:orientation="vertical">
<ImageView
android:id="@+id/header_icon"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_gravity="center_horizontal"
android:antialias="true"
android:background="@drawable/circle_outline"
android:padding="8dp"
android:scaleType="fitCenter"/>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal">
<ImageView
android:id="@+id/header_icon"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_gravity="center"
android:antialias="true"
android:background="@drawable/circle_outline"
android:padding="8dp"
android:scaleType="fitCenter" />
<com.google.android.material.progressindicator.CircularProgressIndicator
android:id="@+id/battery_ring"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:indeterminate="false"
app:trackColor="@android:color/transparent"
app:indicatorColor="@color/bluetooth_battery_ring_indicator_color"
app:trackThickness="4dp"
app:indicatorSize="76dp"
app:indicatorInset="0dp"
app:trackCornerRadius="2dp"
android:max="100"
android:visibility="gone" />
</FrameLayout>
<TextView
android:id="@+id/header_title"