Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 568d7188 authored by Luna Zhang's avatar Luna Zhang Committed by Android (Google) Code Review
Browse files

Merge "Update bluetooth details view's toggle row UI" into main

parents f9b1b075 39e0cf54
Loading
Loading
Loading
Loading
+35 −33
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/root"
    style="@style/Widget.SliceView.Panel"
    android:layout_width="wrap_content"
@@ -66,34 +67,36 @@
            <TextView
                android:id="@+id/bluetooth_toggle_title"
                android:layout_width="0dp"
                android:layout_height="68dp"
                android:layout_height="@dimen/internet_details_toggle_row_height"
                android:maxLines="2"
                android:ellipsize="end"
                android:gravity="start|center_vertical"
                android:paddingEnd="15dp"
                android:paddingStart="36dp"
                android:paddingEnd="12dp"
                android:layout_marginStart="@dimen/bluetooth_details_toggle_row_margin_start"
                android:text="@string/turn_on_bluetooth"
                android:clickable="false"
                android:textAppearance="@style/TextAppearance.BluetoothTileDialog"
                android:textSize="16sp"
                android:textAppearance="@style/TextAppearance.TileDetailsEntryTitle"
                app:layout_constraintEnd_toStartOf="@+id/bluetooth_toggle"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <Switch
            <com.google.android.material.materialswitch.MaterialSwitch
                android:id="@+id/bluetooth_toggle"
                android:scaleX="0.77"
                android:scaleY="0.77"
                android:layout_width="wrap_content"
                android:layout_height="68dp"
                android:gravity="start|center_vertical"
                android:paddingEnd="40dp"
                android:contentDescription="@string/turn_on_bluetooth"
                android:switchMinWidth="@dimen/settingslib_switch_track_width"
                android:theme="@style/MainSwitch.Settingslib"
                android:thumb="@drawable/settingslib_switch_thumb"
                android:track="@drawable/settingslib_switch_track"
                android:layout_height="wrap_content"
                android:layout_marginEnd="@dimen/bluetooth_details_toggle_row_margin_end"
                android:layout_gravity="end|center_vertical"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toEndOf="@+id/bluetooth_toggle_title"
                app:layout_constraintTop_toTopOf="parent" />
                app:layout_constraintTop_toTopOf="parent"
                android:focusable="true"
                android:clickable="true"
                android:contentDescription="@string/turn_on_bluetooth"
                android:theme="@style/Theme.Material3.DynamicColors.DayNight"
                style="@style/SettingslibSwitchStyle.Expressive"
                tools:ignore="UseSwitchCompatOrMaterialXml" />

            <androidx.constraintlayout.widget.Group
                android:id="@+id/bluetooth_auto_on_toggle_layout"
@@ -105,37 +108,36 @@
            <TextView
                android:id="@+id/bluetooth_auto_on_toggle_title"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:minHeight="68dp"
                android:layout_marginBottom="20dp"
                android:layout_height="@dimen/internet_details_toggle_row_height"
                android:maxLines="2"
                android:ellipsize="end"
                android:text="@string/turn_on_bluetooth_auto_tomorrow"
                android:gravity="start|center_vertical"
                android:paddingEnd="15dp"
                android:paddingStart="36dp"
                android:paddingEnd="12dp"
                android:layout_marginStart="@dimen/bluetooth_details_toggle_row_margin_start"
                android:clickable="false"
                android:textAppearance="@style/TextAppearance.BluetoothTileDialog"
                android:textSize="16sp"
                android:textAppearance="@style/TextAppearance.TileDetailsEntryTitle"
                app:layout_constraintEnd_toStartOf="@+id/bluetooth_auto_on_toggle"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/bluetooth_toggle_title" />

            <Switch
            <com.google.android.material.materialswitch.MaterialSwitch
                android:id="@+id/bluetooth_auto_on_toggle"
                android:scaleX="0.77"
                android:scaleY="0.77"
                android:layout_width="wrap_content"
                android:layout_height="68dp"
                android:layout_marginBottom="20dp"
                android:gravity="start|center_vertical"
                android:paddingEnd="40dp"
                android:contentDescription="@string/turn_on_bluetooth_auto_tomorrow"
                android:switchMinWidth="@dimen/settingslib_switch_track_width"
                android:theme="@style/MainSwitch.Settingslib"
                android:thumb="@drawable/settingslib_switch_thumb"
                android:track="@drawable/settingslib_switch_track"
                android:layout_height="wrap_content"
                android:layout_marginEnd="@dimen/bluetooth_details_toggle_row_margin_end"
                android:layout_gravity="end|center_vertical"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toEndOf="@+id/bluetooth_auto_on_toggle_title"
                app:layout_constraintTop_toBottomOf="@+id/bluetooth_toggle" />
                app:layout_constraintTop_toBottomOf="@+id/bluetooth_toggle"
                android:focusable="true"
                android:clickable="true"
                android:contentDescription="@string/turn_on_bluetooth_auto_tomorrow"
                android:theme="@style/Theme.Material3.DynamicColors.DayNight"
                style="@style/SettingslibSwitchStyle.Expressive"
                tools:ignore="UseSwitchCompatOrMaterialXml" />

            <ImageView
                android:id="@+id/bluetooth_auto_on_toggle_info_icon"
+2 −0
Original line number Diff line number Diff line
@@ -2256,6 +2256,8 @@

    <!-- Tile Details start-->
    <dimen name="internet_details_toggle_row_height">48dp</dimen>
    <dimen name="bluetooth_details_toggle_row_margin_start">32dp</dimen>
    <dimen name="bluetooth_details_toggle_row_margin_end">26dp</dimen>
    <dimen name="tile_details_switch_container_width">52dp</dimen>
    <dimen name="tile_details_switch_track_height">24dp</dimen>
    <dimen name="tile_details_button_row_height">40dp</dimen>
+3 −3
Original line number Diff line number Diff line
@@ -29,9 +29,9 @@ import android.view.ViewGroup.LayoutParams.WRAP_CONTENT
import android.view.accessibility.AccessibilityNodeInfo
import android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction
import android.widget.Button
import android.widget.CompoundButton
import android.widget.ImageView
import android.widget.ProgressBar
import android.widget.Switch
import android.widget.TextView
import androidx.annotation.StringRes
import androidx.annotation.VisibleForTesting
@@ -128,11 +128,11 @@ constructor(

    // UI Components
    private lateinit var contentView: View
    private lateinit var bluetoothToggle: Switch
    private lateinit var bluetoothToggle: CompoundButton
    private lateinit var seeAllButton: View
    private lateinit var pairNewDeviceButton: View
    private lateinit var deviceListView: RecyclerView
    private lateinit var autoOnToggle: Switch
    private lateinit var autoOnToggle: CompoundButton
    private lateinit var autoOnToggleLayout: View
    private lateinit var autoOnToggleInfoTextView: TextView
    private lateinit var audioSharingButton: Button