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

Commit 3e077016 authored by John Spurlock's avatar John Spurlock
Browse files

Zen: Improve zen mode panel condition selection.

 - Decouple condition requests from expansion, now
   pre-request when zen panel unhidden.
 - Animate zen mode panel expansion.
 - Improve default selection logic, ensure something
   is selected as soon as we are in the expanded state.
 - Tweak visual spacing.
 - Map null condition to Indef properly when we start
   out in zen.
 - Avoid unnecessary condition teardown when the conditions
   are updated but unchanged from current.
 - Cap number of optional conditions to display, default=3.

Bug: 18335618

Change-Id: I007b7c3b2e75e2b42805af240684aa8581e9951a
parent c1de25d8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@ public class Condition implements Parcelable {
    }

    public static boolean isValidId(Uri id, String pkg) {
        return id != null && id.getScheme().equals(SCHEME) && id.getAuthority().equals(pkg);
        return id != null && SCHEME.equals(id.getScheme()) && pkg.equals(id.getAuthority());
    }

    public static final Parcelable.Creator<Condition> CREATOR
+4 −3
Original line number Diff line number Diff line
@@ -17,14 +17,15 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="@dimen/qs_detail_item_height"
    android:layout_marginBottom="@dimen/zen_mode_condition_detail_item_spacing"
    android:layout_marginStart="@dimen/zen_mode_condition_detail_button_padding"
    android:layout_marginEnd="@dimen/zen_mode_condition_detail_button_padding" >

    <RadioButton
        android:id="@android:id/checkbox"
        android:layout_width="40dp"
        android:layout_marginStart="2dp"
        android:layout_marginEnd="1dp"
        android:layout_marginStart="7dp"
        android:layout_marginEnd="4dp"
        android:layout_height="match_parent"
        android:layout_alignParentStart="true"
        android:gravity="center" />
@@ -51,6 +52,7 @@
            android:id="@android:id/text2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/zen_mode_condition_detail_item_interline_spacing"
            android:ellipsize="end"
            android:textAlignment="viewStart"
            android:maxLines="1"
@@ -64,7 +66,6 @@
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:layout_centerVertical="true"
        android:layout_marginEnd="@dimen/zen_mode_condition_detail_button_padding"
        android:scaleType="center"
        android:layout_toStartOf="@android:id/button2"
        android:contentDescription="@string/accessibility_quick_settings_less_time"
+5 −1
Original line number Diff line number Diff line
@@ -58,6 +58,8 @@
            android:background="@drawable/btn_borderless_rect"
            android:clickable="true"
            android:drawableEnd="@drawable/qs_subhead_caret"
            android:maxLines="2"
            android:ellipsize="end"
            android:textAppearance="@style/TextAppearance.QS.Subhead" />

        <TextView
@@ -67,6 +69,8 @@
            android:layout_gravity="center_vertical"
            android:gravity="center_vertical"
            android:paddingLeft="8dp"
            android:maxLines="2"
            android:ellipsize="end"
            android:textAppearance="@style/TextAppearance.QS.Subhead" />

        <ImageView
@@ -87,6 +91,6 @@
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:paddingBottom="@dimen/qs_panel_padding" />
        android:paddingBottom="@dimen/zen_mode_condition_detail_bottom_padding" />

</com.android.systemui.volume.ZenModePanel>
+3 −0
Original line number Diff line number Diff line
@@ -278,6 +278,9 @@
    <!-- Number of times to show the strong alarm warning text in the volume dialog -->
    <integer name="zen_mode_alarm_warning_threshold">5</integer>

    <!-- Maximum number of optional conditions to display in the zen mode selection panel -->
    <integer name="zen_mode_max_conditions">3</integer>

    <!-- Enable the default volume dialog -->
    <bool name="enable_volume_ui">true</bool>
</resources>
+10 −0
Original line number Diff line number Diff line
@@ -197,8 +197,18 @@
    <!-- How far the expanded QS panel peeks from the header in collapsed state. -->
    <dimen name="qs_peek_height">8dp</dimen>

    <!-- Zen mode panel: condition item button padding -->
    <dimen name="zen_mode_condition_detail_button_padding">8dp</dimen>

    <!-- Zen mode panel: spacing between condition items -->
    <dimen name="zen_mode_condition_detail_item_spacing">12dp</dimen>

    <!-- Zen mode panel: spacing between two-line condition upper and lower lines -->
    <dimen name="zen_mode_condition_detail_item_interline_spacing">4dp</dimen>

    <!-- Zen mode panel: bottom padding, a bit less than qs_panel_padding -->
    <dimen name="zen_mode_condition_detail_bottom_padding">4dp</dimen>

    <!-- used by DessertCase -->
    <dimen name="dessert_case_cell_size">192dp</dimen>

Loading