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

Commit 54190a2b authored by Chelsea Hao's avatar Chelsea Hao Committed by Android (Google) Code Review
Browse files

Merge changes I2e87eb59,I34141bb3,I289fce00 into main

* changes:
  Read and write auto on toggle value.
  Add auto on toggle UI.
  Move bluetooth_qs_tile_dialog_auto_on_toggle to settingslib.
parents f77fce7b e385589f
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -17,3 +17,9 @@ flag {
    }
}

flag {
   name: "bluetooth_qs_tile_dialog_auto_on_toggle"
   namespace: "bluetooth"
   description: "Displays the auto on toggle in the bluetooth QS tile dialog"
   bug: "316985153"
}
+0 −7
Original line number Diff line number Diff line
@@ -353,13 +353,6 @@ flag {
   bug: "311145851"
}

flag {
   name: "bluetooth_qs_tile_dialog_auto_on_toggle"
   namespace: "systemui"
   description: "Displays the auto on toggle in the bluetooth QS tile dialog"
   bug: "316985153"
}

flag {
   name: "smartspace_relocate_to_bottom"
   namespace: "systemui"
+83 −10
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="21dp"
        android:minHeight="145dp"
        android:minHeight="@dimen/bluetooth_dialog_scroll_view_min_height"
        android:fillViewport="true"
        app:layout_constrainedHeight="true"
        app:layout_constraintStart_toStartOf="parent"
@@ -97,11 +97,11 @@
            <TextView
                android:id="@+id/bluetooth_toggle_title"
                android:layout_width="0dp"
                android:layout_height="64dp"
                android:maxLines="1"
                android:layout_height="68dp"
                android:maxLines="2"
                android:ellipsize="end"
                android:gravity="start|center_vertical"
                android:paddingEnd="0dp"
                android:paddingEnd="15dp"
                android:paddingStart="36dp"
                android:text="@string/turn_on_bluetooth"
                android:clickable="false"
@@ -114,7 +114,7 @@
            <Switch
                android:id="@+id/bluetooth_toggle"
                android:layout_width="wrap_content"
                android:layout_height="64dp"
                android:layout_height="68dp"
                android:gravity="start|center_vertical"
                android:paddingEnd="40dp"
                android:contentDescription="@string/turn_on_bluetooth"
@@ -126,14 +126,79 @@
                app:layout_constraintStart_toEndOf="@+id/bluetooth_toggle_title"
                app:layout_constraintTop_toTopOf="parent" />

            <androidx.constraintlayout.widget.Group
                android:id="@+id/bluetooth_auto_on_toggle_layout"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:visibility="gone"
                app:constraint_referenced_ids="bluetooth_auto_on_toggle_title,bluetooth_auto_on_toggle,bluetooth_auto_on_toggle_info_icon,bluetooth_auto_on_toggle_info_text" />

            <TextView
                android:id="@+id/bluetooth_auto_on_toggle_title"
                android:layout_width="0dp"
                android:layout_height="68dp"
                android:layout_marginBottom="20dp"
                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:clickable="false"
                android:textAppearance="@style/TextAppearance.Dialog.Title"
                android:textSize="16sp"
                app:layout_constraintEnd_toStartOf="@+id/bluetooth_auto_on_toggle"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/bluetooth_toggle_title" />

            <Switch
                android:id="@+id/bluetooth_auto_on_toggle"
                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_thumb_selector"
                android:track="@drawable/settingslib_track_selector"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toEndOf="@+id/bluetooth_auto_on_toggle_title"
                app:layout_constraintTop_toBottomOf="@+id/bluetooth_toggle" />

            <ImageView
                android:id="@+id/bluetooth_auto_on_toggle_info_icon"
                android:src="@drawable/ic_info_outline"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:tint="?android:attr/textColorTertiary"
                android:paddingStart="36dp"
                android:layout_marginTop="20dp"
                android:layout_marginBottom="@dimen/bluetooth_dialog_layout_margin"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/bluetooth_auto_on_toggle" />

            <TextView
                android:id="@+id/bluetooth_auto_on_toggle_info_text"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="20dp"
                android:paddingStart="36dp"
                android:paddingEnd="40dp"
                android:text="@string/turn_on_bluetooth_auto_info"
                android:textAppearance="@style/TextAppearance.Dialog.Body.Message"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/bluetooth_auto_on_toggle_info_icon" />

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/device_list"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/bluetooth_toggle"
                app:layout_constraintBottom_toTopOf="@+id/see_all_button" />
                app:layout_constraintTop_toBottomOf="@+id/bluetooth_toggle" />

            <Button
                android:id="@+id/see_all_button"
@@ -168,12 +233,10 @@
                android:background="@drawable/bluetooth_tile_dialog_bg_off"
                android:layout_width="0dp"
                android:layout_height="64dp"
                android:layout_marginBottom="9dp"
                android:contentDescription="@string/accessibility_bluetooth_device_settings_pair_new_device"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/see_all_button"
                app:layout_constraintBottom_toTopOf="@+id/done_button"
                android:drawableStart="@drawable/ic_add"
                android:drawablePadding="20dp"
                android:drawableTint="?android:attr/textColorPrimary"
@@ -186,11 +249,19 @@
                android:ellipsize="end"
                android:visibility="gone" />

            <androidx.constraintlayout.widget.Barrier
                android:id="@+id/barrier"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:barrierDirection="bottom"
                app:constraint_referenced_ids="pair_new_device_button,bluetooth_auto_on_toggle_info_text" />

            <Button
                android:id="@+id/done_button"
                style="@style/Widget.Dialog.Button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="9dp"
                android:layout_marginBottom="@dimen/dialog_bottom_padding"
                android:layout_marginEnd="@dimen/dialog_side_padding"
                android:layout_marginStart="@dimen/dialog_side_padding"
@@ -200,7 +271,9 @@
                android:maxLines="1"
                android:text="@string/inline_done_button"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintBottom_toBottomOf="parent" />
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/barrier"
                app:layout_constraintVertical_bias="1" />
        </androidx.constraintlayout.widget.ConstraintLayout>
    </androidx.core.widget.NestedScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
 No newline at end of file
+4 −0
Original line number Diff line number Diff line
@@ -1717,6 +1717,10 @@
    <dimen name="bluetooth_dialog_layout_margin">16dp</dimen>
    <!-- The height of the bluetooth device in bluetooth dialog. -->
    <dimen name="bluetooth_dialog_device_height">72dp</dimen>
    <!-- The height of the main scroll view in bluetooth dialog. -->
    <dimen name="bluetooth_dialog_scroll_view_min_height">145dp</dimen>
    <!-- The height of the main scroll view in bluetooth dialog with auto on toggle. -->
    <dimen name="bluetooth_dialog_scroll_view_min_height_with_auto_on">350dp</dimen>

    <!-- Height percentage of the parent container occupied by the communal view -->
    <item name="communal_source_height_percentage" format="float" type="dimen">0.80</item>
+4 −0
Original line number Diff line number Diff line
@@ -669,6 +669,10 @@
    <string name="accessibility_quick_settings_bluetooth_device_tap_to_disconnect">disconnect</string>
    <!-- QuickSettings: Accessibility label to activate a device [CHAR LIMIT=NONE]-->
    <string name="accessibility_quick_settings_bluetooth_device_tap_to_activate">activate</string>
    <!-- QuickSettings: Bluetooth auto on tomorrow [CHAR LIMIT=NONE]-->
    <string name="turn_on_bluetooth_auto_tomorrow">Automatically turn on again tomorrow</string>
    <!-- QuickSettings: Bluetooth auto on info text [CHAR LIMIT=NONE]-->
    <string name="turn_on_bluetooth_auto_info">Features like Quick Share, Find My Device, and device location use Bluetooth</string>

    <!-- QuickSettings: Bluetooth secondary label for the battery level of a connected device [CHAR LIMIT=20]-->
    <string name="quick_settings_bluetooth_secondary_label_battery_level"><xliff:g id="battery_level_as_percentage">%s</xliff:g> battery</string>
Loading