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

Commit ea75bd1d authored by Fabian Kozynski's avatar Fabian Kozynski
Browse files

Prepare to remove new headers flag

This CL sets everything up for removal of the flag. In particular:

* Shortcircuits any conditional the flag was in to true.
* Removes all the header views and code from QuickStatusBarHeader and
  controller. This still exists because it contains QuickQSPanel and
  refactoring is outside of the scope of this CL.
* Renames LargeScreenShadeHeaderController to ShadeHeaderController
* Replaces the view with a MotionLayout unconditionally
* Removes dimens that were explicitly for combined headers and applies
  them to the default dimen.
* Combines LargeScreenShadeHeaderControllerTest and
  LargeShadeHeaderControllerCombinedTest into ShadeHeaderControllerTest
* Adds the views to the NotificationPanelUnfoldAnimationController

Bug: 254512321
Test: SystemUITests
Test: QS PlatformScenarioTests
Change-Id: I578b82571dc91a9e31c196f3affe60d84c64a1fe
parent ce7c4bef
Loading
Loading
Loading
Loading
+0 −100
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2021 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:systemui="http://schemas.android.com/apk/res-auto"
    android:id="@+id/split_shade_status_bar"
    android:layout_width="match_parent"
    android:layout_height="@dimen/large_screen_shade_header_height"
    android:minHeight="@dimen/large_screen_shade_header_min_height"
    android:clickable="false"
    android:focusable="true"
    android:paddingLeft="@dimen/large_screen_shade_header_left_padding"
    android:paddingRight="@dimen/qs_panel_padding"
    android:visibility="gone"
    android:theme="@style/Theme.SystemUI.QuickSettings.Header">

    <com.android.systemui.statusbar.policy.Clock
        android:id="@+id/clock"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:minWidth="48dp"
        android:minHeight="@dimen/large_screen_shade_header_min_height"
        android:gravity="start|center_vertical"
        android:paddingStart="@dimen/status_bar_left_clock_starting_padding"
        android:paddingEnd="@dimen/status_bar_left_clock_end_padding"
        android:singleLine="true"
        android:textAppearance="@style/TextAppearance.QS.Status" />

    <com.android.systemui.statusbar.policy.DateView
        android:id="@+id/date"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="start|center_vertical"
        android:gravity="center_vertical"
        android:singleLine="true"
        android:textAppearance="@style/TextAppearance.QS.Status"
        systemui:datePattern="@string/abbrev_wday_month_day_no_year_alarm" />

    <FrameLayout
        android:id="@+id/rightLayout"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:gravity="end">

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_gravity="end|center_vertical">

            <include
                android:id="@+id/carrier_group"
                layout="@layout/qs_carrier_group"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_gravity="end|center_vertical"
                android:layout_marginStart="8dp"
                android:focusable="false"
                android:minHeight="@dimen/large_screen_shade_header_min_height"
                android:minWidth="48dp" />

            <com.android.systemui.statusbar.phone.StatusIconContainer
                android:id="@+id/statusIcons"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:paddingEnd="@dimen/signal_cluster_battery_padding" />

            <com.android.systemui.battery.BatteryMeterView
                android:id="@+id/batteryRemainingIcon"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                systemui:textAppearance="@style/TextAppearance.QS.Status" />
            <FrameLayout
                android:id="@+id/privacy_container"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:minHeight="48dp"
                android:layout_weight="1"
                android:paddingStart="16dp">

                <include layout="@layout/ongoing_privacy_chip" />

            </FrameLayout>
        </LinearLayout>
    </FrameLayout>

</LinearLayout>
+0 −111
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 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:systemui="http://schemas.android.com/apk/res-auto"
    android:id="@+id/quick_qs_status_icons"
    android:layout_width="match_parent"
    android:layout_height="@*android:dimen/quick_qs_offset_height"
    android:clipChildren="false"
    android:clipToPadding="false"
    android:minHeight="@dimen/qs_header_row_min_height"
    android:clickable="false"
    android:focusable="true"
    android:theme="@style/Theme.SystemUI.QuickSettings.Header">

    <LinearLayout
        android:id="@+id/clock_container"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:orientation="horizontal"
        android:layout_gravity="center_vertical|start"
        android:gravity="center_vertical|start"
        >

        <com.android.systemui.statusbar.policy.Clock
            android:id="@+id/clock"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:minHeight="@dimen/qs_header_row_min_height"
            android:gravity="center_vertical|start"
            android:paddingStart="@dimen/status_bar_left_clock_starting_padding"
            android:paddingEnd="@dimen/status_bar_left_clock_end_padding"
            android:singleLine="true"
            android:textAppearance="@style/TextAppearance.QS.Status" />

        <com.android.systemui.statusbar.policy.VariableDateView
            android:id="@+id/date_clock"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_marginStart="@dimen/status_bar_left_clock_end_padding"
            android:gravity="center_vertical|start"
            android:singleLine="true"
            android:textAppearance="@style/TextAppearance.QS.Status"
            systemui:longDatePattern="@string/abbrev_wday_month_day_no_year_alarm"
            systemui:shortDatePattern="@string/abbrev_month_day_no_year"
        />
    </LinearLayout>

    <include layout="@layout/qs_carrier_group"
        android:id="@+id/carrier_group"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:minHeight="@dimen/qs_header_row_min_height"
        android:minWidth="48dp"
        android:layout_marginStart="8dp"
        android:layout_gravity="end|center_vertical"
        android:focusable="false"/>

    <View
        android:id="@+id/separator"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_gravity="center"
        android:layout_marginStart="8dp"
        android:layout_marginEnd="8dp"
        android:visibility="gone"
        />

    <FrameLayout
        android:id="@+id/rightLayout"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:gravity="end"
        >
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="center_vertical|end"
        >
        <com.android.systemui.statusbar.phone.StatusIconContainer
            android:id="@+id/statusIcons"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:paddingEnd="@dimen/signal_cluster_battery_padding" />

        <com.android.systemui.battery.BatteryMeterView
            android:id="@+id/batteryRemainingIcon"
            android:layout_height="match_parent"
            android:layout_width="0dp"
            android:layout_weight="1"
            systemui:textAppearance="@style/TextAppearance.QS.Status"
            android:paddingEnd="2dp" />

    </LinearLayout>
    </FrameLayout>

</LinearLayout>
+8 −24
Original line number Diff line number Diff line
@@ -33,32 +33,16 @@
    android:paddingStart="0dp"
    android:elevation="4dp" >

    <!-- Date and privacy. Only visible in QS when not in split shade -->
    <include layout="@layout/quick_status_bar_header_date_privacy"/>

    <RelativeLayout
        android:id="@+id/qs_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="top"
        android:clipChildren="false"
        android:clipToPadding="false">
        <!-- Time, icons and Carrier (only in QS when not in split shade) -->
        <include layout="@layout/quick_qs_status_icons"/>

    <com.android.systemui.qs.QuickQSPanel
        android:id="@+id/quick_qs_panel"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
            android:layout_below="@id/quick_qs_status_icons"
        android:layout_marginTop="@dimen/qqs_layout_margin_top"
            android:accessibilityTraversalAfter="@id/quick_qs_status_icons"
        android:clipChildren="false"
        android:clipToPadding="false"
        android:focusable="true"
        android:paddingBottom="@dimen/qqs_layout_padding_bottom"
        android:importantForAccessibility="no">
    </com.android.systemui.qs.QuickQSPanel>
    </RelativeLayout>

</com.android.systemui.qs.QuickStatusBarHeader>
+0 −75
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
** Copyright 2017, 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:systemui="http://schemas.android.com/apk/res-auto"
    android:id="@+id/quick_status_bar_date_privacy"
    android:layout_width="match_parent"
    android:layout_height="@*android:dimen/quick_qs_offset_height"
    android:clipChildren="false"
    android:clipToPadding="false"
    android:gravity="center"
    android:layout_gravity="top"
    android:orientation="horizontal"
    android:importantForAccessibility="no"
    android:clickable="true"
    android:minHeight="48dp">

    <FrameLayout
        android:id="@+id/date_container"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:minHeight="48dp"
        android:layout_weight="1"
        android:gravity="center_vertical|start" >

        <com.android.systemui.statusbar.policy.VariableDateView
            android:id="@+id/date"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="start|center_vertical"
            android:gravity="center_vertical"
            android:singleLine="true"
            android:textAppearance="@style/TextAppearance.QS.Status"
            systemui:longDatePattern="@string/abbrev_wday_month_day_no_year_alarm"
            systemui:shortDatePattern="@string/abbrev_month_day_no_year"
        />
    </FrameLayout>

    <!-- We want this to be centered (to align with notches). In order to do that, the following
         has to hold (in portrait):
         * date_container and privacy_container must have the same width and weight
         -->
    <android.widget.Space
        android:id="@+id/space"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_gravity="center_vertical|center_horizontal"
        android:visibility="gone" />

    <FrameLayout
        android:id="@+id/privacy_container"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:minHeight="48dp"
        android:layout_weight="1"
        android:gravity="center_vertical|end" >

        <include layout="@layout/ongoing_privacy_chip" />

    </FrameLayout>
</LinearLayout>
+0 −1
Original line number Diff line number Diff line
@@ -63,7 +63,6 @@
    <dimen name="large_dialog_width">348dp</dimen>

    <dimen name="qs_panel_padding_top">@dimen/qqs_layout_margin_top</dimen>
    <dimen name="qs_panel_padding_top_combined_headers">@dimen/qs_panel_padding_top</dimen>

    <dimen name="controls_padding_horizontal">16dp</dimen>
</resources>
Loading