Finish removing NEW_FOOTER flag
Test: atest SystemUITests Test: manual Fixes: 220344583 Change-Id: I0b188bba6846a4dd935747893232bafa41be3a7d
This commit is contained in:
@@ -16,8 +16,9 @@
|
||||
-->
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/qs_security_footer_single_line_height"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:clickable="true"
|
||||
android:visibility="gone">
|
||||
@@ -26,7 +27,7 @@
|
||||
android:id="@+id/fgs_text_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="@dimen/new_qs_footer_action_inset"
|
||||
android:layout_marginEnd="@dimen/qs_footer_action_inset"
|
||||
android:background="@drawable/qs_security_footer_background"
|
||||
android:layout_gravity="end"
|
||||
android:gravity="center"
|
||||
@@ -86,7 +87,7 @@
|
||||
android:layout_height="12dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:src="@drawable/new_fgs_dot"
|
||||
android:src="@drawable/fgs_dot"
|
||||
android:contentDescription="@string/fgs_dot_content_description"
|
||||
/>
|
||||
</FrameLayout>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
** Copyright 2021, The Android Open Source Project
|
||||
** Copyright 2022, 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.
|
||||
@@ -18,65 +18,80 @@
|
||||
<!-- Action buttons for footer in QS/QQS, containing settings button, power off button etc -->
|
||||
<com.android.systemui.qs.FooterActionsView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/qs_footer_height"
|
||||
android:layout_height="@dimen/footer_actions_height"
|
||||
android:elevation="@dimen/qs_panel_elevation"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:background="@drawable/qs_footer_actions_background"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_gravity="bottom"
|
||||
>
|
||||
|
||||
<com.android.systemui.statusbar.phone.MultiUserSwitch
|
||||
android:id="@+id/multi_user_switch"
|
||||
android:layout_width="0dp"
|
||||
<LinearLayout
|
||||
android:id="@+id/security_footers_container"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="@dimen/qs_footer_action_button_size"
|
||||
android:layout_marginEnd="@dimen/qs_tile_margin_horizontal"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/qs_footer_action_chip_background"
|
||||
android:focusable="true">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/multi_user_avatar"
|
||||
android:layout_width="@dimen/multi_user_avatar_expanded_size"
|
||||
android:layout_height="@dimen/multi_user_avatar_expanded_size"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="centerInside" />
|
||||
</com.android.systemui.statusbar.phone.MultiUserSwitch>
|
||||
|
||||
<com.android.systemui.statusbar.AlphaOptimizedImageView
|
||||
android:id="@+id/pm_lite"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/qs_footer_action_button_size"
|
||||
android:layout_marginEnd="@dimen/qs_tile_margin_horizontal"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/qs_footer_action_chip_background"
|
||||
android:clickable="true"
|
||||
android:clipToPadding="false"
|
||||
android:focusable="true"
|
||||
android:padding="@dimen/qs_footer_icon_padding"
|
||||
android:src="@*android:drawable/ic_lock_power_off"
|
||||
android:contentDescription="@string/accessibility_quick_settings_power_menu"
|
||||
android:tint="?android:attr/textColorPrimary" />
|
||||
/>
|
||||
|
||||
<com.android.systemui.statusbar.AlphaOptimizedFrameLayout
|
||||
android:id="@+id/settings_button_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/qs_footer_action_button_size"
|
||||
android:background="@drawable/qs_footer_action_chip_background"
|
||||
android:layout_weight="1"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
<!-- Negative margin equal to -->
|
||||
<LinearLayout
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginEnd="@dimen/qs_footer_action_inset_negative"
|
||||
>
|
||||
|
||||
<com.android.systemui.statusbar.phone.SettingsButton
|
||||
android:id="@+id/settings_button"
|
||||
android:layout_width="match_parent"
|
||||
<com.android.systemui.statusbar.phone.MultiUserSwitch
|
||||
android:id="@+id/multi_user_switch"
|
||||
android:layout_width="@dimen/qs_footer_action_button_size"
|
||||
android:layout_height="@dimen/qs_footer_action_button_size"
|
||||
android:layout_gravity="center"
|
||||
android:contentDescription="@string/accessibility_quick_settings_settings"
|
||||
android:background="@drawable/qs_footer_action_chip_background_borderless"
|
||||
android:background="@drawable/qs_footer_action_circle"
|
||||
android:focusable="true">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/multi_user_avatar"
|
||||
android:layout_width="@dimen/qs_footer_icon_size"
|
||||
android:layout_height="@dimen/qs_footer_icon_size"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="centerInside" />
|
||||
</com.android.systemui.statusbar.phone.MultiUserSwitch>
|
||||
|
||||
<com.android.systemui.statusbar.AlphaOptimizedFrameLayout
|
||||
android:id="@+id/settings_button_container"
|
||||
android:layout_width="@dimen/qs_footer_action_button_size"
|
||||
android:layout_height="@dimen/qs_footer_action_button_size"
|
||||
android:background="@drawable/qs_footer_action_circle"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<com.android.systemui.statusbar.phone.SettingsButton
|
||||
android:id="@+id/settings_button"
|
||||
android:layout_width="@dimen/qs_footer_icon_size"
|
||||
android:layout_height="@dimen/qs_footer_icon_size"
|
||||
android:layout_gravity="center"
|
||||
android:background="@android:color/transparent"
|
||||
android:contentDescription="@string/accessibility_quick_settings_settings"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/ic_settings"
|
||||
android:tint="?android:attr/textColorPrimary" />
|
||||
|
||||
</com.android.systemui.statusbar.AlphaOptimizedFrameLayout>
|
||||
|
||||
<com.android.systemui.statusbar.AlphaOptimizedImageView
|
||||
android:id="@+id/pm_lite"
|
||||
android:layout_width="@dimen/qs_footer_action_button_size"
|
||||
android:layout_height="@dimen/qs_footer_action_button_size"
|
||||
android:background="@drawable/qs_footer_action_circle_color"
|
||||
android:clickable="true"
|
||||
android:clipToPadding="false"
|
||||
android:focusable="true"
|
||||
android:padding="@dimen/qs_footer_icon_padding"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/ic_settings"
|
||||
android:tint="?android:attr/textColorPrimary" />
|
||||
|
||||
</com.android.systemui.statusbar.AlphaOptimizedFrameLayout>
|
||||
android:src="@*android:drawable/ic_lock_power_off"
|
||||
android:contentDescription="@string/accessibility_quick_settings_power_menu"
|
||||
android:tint="?androidprv:attr/textColorOnAccent" />
|
||||
|
||||
</LinearLayout>
|
||||
</com.android.systemui.qs.FooterActionsView>
|
||||
@@ -1,97 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
** Copyright 2022, 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.
|
||||
-->
|
||||
|
||||
<!-- Action buttons for footer in QS/QQS, containing settings button, power off button etc -->
|
||||
<com.android.systemui.qs.FooterActionsView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/new_footer_height"
|
||||
android:elevation="@dimen/qs_panel_elevation"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:background="@drawable/qs_footer_actions_background"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_gravity="bottom"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/security_footers_container"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="@dimen/qs_footer_action_button_size"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
/>
|
||||
|
||||
<!-- Negative margin equal to -->
|
||||
<LinearLayout
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginEnd="@dimen/new_qs_footer_action_inset_negative"
|
||||
>
|
||||
|
||||
<com.android.systemui.statusbar.phone.MultiUserSwitch
|
||||
android:id="@+id/multi_user_switch"
|
||||
android:layout_width="@dimen/qs_footer_action_button_size"
|
||||
android:layout_height="@dimen/qs_footer_action_button_size"
|
||||
android:background="@drawable/qs_footer_action_circle"
|
||||
android:focusable="true">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/multi_user_avatar"
|
||||
android:layout_width="@dimen/qs_footer_icon_size"
|
||||
android:layout_height="@dimen/qs_footer_icon_size"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="centerInside" />
|
||||
</com.android.systemui.statusbar.phone.MultiUserSwitch>
|
||||
|
||||
<com.android.systemui.statusbar.AlphaOptimizedFrameLayout
|
||||
android:id="@+id/settings_button_container"
|
||||
android:layout_width="@dimen/qs_footer_action_button_size"
|
||||
android:layout_height="@dimen/qs_footer_action_button_size"
|
||||
android:background="@drawable/qs_footer_action_circle"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<com.android.systemui.statusbar.phone.SettingsButton
|
||||
android:id="@+id/settings_button"
|
||||
android:layout_width="@dimen/qs_footer_icon_size"
|
||||
android:layout_height="@dimen/qs_footer_icon_size"
|
||||
android:layout_gravity="center"
|
||||
android:background="@android:color/transparent"
|
||||
android:contentDescription="@string/accessibility_quick_settings_settings"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/ic_settings"
|
||||
android:tint="?android:attr/textColorPrimary" />
|
||||
|
||||
</com.android.systemui.statusbar.AlphaOptimizedFrameLayout>
|
||||
|
||||
<com.android.systemui.statusbar.AlphaOptimizedImageView
|
||||
android:id="@+id/pm_lite"
|
||||
android:layout_width="@dimen/qs_footer_action_button_size"
|
||||
android:layout_height="@dimen/qs_footer_action_button_size"
|
||||
android:background="@drawable/qs_footer_action_circle_color"
|
||||
android:clickable="true"
|
||||
android:clipToPadding="false"
|
||||
android:focusable="true"
|
||||
android:padding="@dimen/qs_footer_icon_padding"
|
||||
android:src="@*android:drawable/ic_lock_power_off"
|
||||
android:contentDescription="@string/accessibility_quick_settings_power_menu"
|
||||
android:tint="?androidprv:attr/textColorOnAccent" />
|
||||
|
||||
</LinearLayout>
|
||||
</com.android.systemui.qs.FooterActionsView>
|
||||
@@ -1,42 +0,0 @@
|
||||
<?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.
|
||||
-->
|
||||
<inset xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:insetTop="@dimen/qs_footer_action_inset"
|
||||
android:insetBottom="@dimen/qs_footer_action_inset">
|
||||
<ripple
|
||||
android:color="?android:attr/colorControlHighlight"
|
||||
android:height="44dp">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@android:color/white"/>
|
||||
<corners android:radius="@dimen/qs_footer_action_corner_radius"/>
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="?attr/underSurfaceColor"/>
|
||||
<corners android:radius="@dimen/qs_footer_action_corner_radius"/>
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<stroke android:width="1dp" android:color="?android:attr/colorBackground"/>
|
||||
<corners android:radius="@dimen/qs_footer_action_corner_radius"/>
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
</inset>
|
||||
@@ -1,35 +0,0 @@
|
||||
<?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.
|
||||
-->
|
||||
<inset xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:insetTop="@dimen/qs_footer_action_inset"
|
||||
android:insetBottom="@dimen/qs_footer_action_inset">
|
||||
<ripple
|
||||
android:color="?android:attr/colorControlHighlight">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@android:color/white"/>
|
||||
<corners android:radius="@dimen/qs_footer_action_corner_radius"/>
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@android:color/transparent"/>
|
||||
<corners android:radius="@dimen/qs_footer_action_corner_radius"/>
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
</inset>
|
||||
@@ -15,7 +15,7 @@
|
||||
~ limitations under the License.
|
||||
-->
|
||||
<inset xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:inset="@dimen/new_qs_footer_action_inset">
|
||||
android:inset="@dimen/qs_footer_action_inset">
|
||||
<ripple
|
||||
android:color="?android:attr/colorControlHighlight">
|
||||
<item android:id="@android:id/mask">
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
~ limitations under the License.
|
||||
-->
|
||||
<inset xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:inset="@dimen/new_qs_footer_action_inset">
|
||||
android:inset="@dimen/qs_footer_action_inset">
|
||||
<ripple
|
||||
android:color="?android:attr/colorControlHighlight">
|
||||
<item android:id="@android:id/mask">
|
||||
|
||||
@@ -29,11 +29,6 @@
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/qs_footer_height"
|
||||
@@ -80,14 +75,4 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ViewStub
|
||||
android:id="@+id/footer_stub"
|
||||
android:inflatedId="@+id/qs_footer_actions"
|
||||
android:layout="@layout/footer_actions"
|
||||
android:layout_height="@dimen/qs_footer_height"
|
||||
android:layout_width="match_parent"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.android.systemui.qs.QSFooterView>
|
||||
|
||||
@@ -47,11 +47,10 @@
|
||||
|
||||
<include layout="@layout/quick_status_bar_expanded_header" />
|
||||
|
||||
<ViewStub
|
||||
android:id="@+id/container_stub"
|
||||
android:inflatedId="@+id/qs_footer_actions"
|
||||
android:layout="@layout/new_footer_actions"
|
||||
android:layout_height="@dimen/new_footer_height"
|
||||
<include
|
||||
layout="@layout/footer_actions"
|
||||
android:id="@+id/qs_footer_actions"
|
||||
android:layout_height="@dimen/footer_actions_height"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_gravity="bottom"
|
||||
/>
|
||||
|
||||
@@ -14,19 +14,18 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<com.android.systemui.util.DualHeightHorizontalLinearLayout
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:systemui="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/qs_security_footer_height"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/qs_security_footer_single_line_height"
|
||||
android:layout_weight="1"
|
||||
android:clickable="true"
|
||||
android:padding="@dimen/qs_footer_padding"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="@dimen/qs_footer_padding"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_gravity="center_vertical|center_horizontal"
|
||||
android:layout_marginBottom="@dimen/qs_footers_margin_bottom"
|
||||
android:layout_marginEnd="@dimen/qs_footer_action_inset"
|
||||
android:background="@drawable/qs_security_footer_background"
|
||||
systemui:singleLineHeight="@dimen/qs_security_footer_single_line_height"
|
||||
systemui:textViewId="@id/footer_text"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
@@ -43,7 +42,7 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:maxLines="@integer/qs_security_footer_maxLines"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:textAppearance="@style/TextAppearance.QS.SecurityFooter"
|
||||
android:textColor="?android:attr/textColorSecondary"/>
|
||||
@@ -58,4 +57,4 @@
|
||||
android:autoMirrored="true"
|
||||
android:tint="?android:attr/textColorSecondary" />
|
||||
|
||||
</com.android.systemui.util.DualHeightHorizontalLinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -52,7 +52,6 @@
|
||||
<!-- 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
|
||||
* header_text_container must be gone
|
||||
-->
|
||||
<android.widget.Space
|
||||
android:id="@+id/space"
|
||||
@@ -61,17 +60,6 @@
|
||||
android:layout_gravity="center_vertical|center_horizontal"
|
||||
android:visibility="gone" />
|
||||
|
||||
<!-- Will hold security footer in landscape with media -->
|
||||
<FrameLayout
|
||||
android:id="@+id/header_text_container"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/privacy_container"
|
||||
android:layout_width="0dp"
|
||||
|
||||
@@ -188,12 +188,6 @@
|
||||
<attr name="borderColor" format="color" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="DualHeightHorizontalLinearLayout">
|
||||
<attr name="singleLineHeight" format="dimension" />
|
||||
<attr name="singleLineVerticalPadding" format="dimension" />
|
||||
<attr name="textViewId" format="reference" />
|
||||
</declare-styleable>
|
||||
|
||||
<attr name="overlayButtonTextColor" format="color" />
|
||||
|
||||
<declare-styleable name="DreamOverlayDotImageView">
|
||||
|
||||
@@ -327,23 +327,20 @@
|
||||
car setting. -->
|
||||
<dimen name="car_qs_header_system_icons_area_height">54dp</dimen>
|
||||
|
||||
<!-- The height of the quick settings footer that holds the user switcher, settings icon,
|
||||
etc. -->
|
||||
<!-- The height of the quick settings footer that holds the pagination dots and edit button -->
|
||||
<dimen name="qs_footer_height">48dp</dimen>
|
||||
|
||||
<!-- 40dp (circles) + 8dp (circle padding) + 8dp (top) + 4dp (bottom) -->
|
||||
<dimen name="new_footer_height">60dp</dimen>
|
||||
<dimen name="footer_actions_height">60dp</dimen>
|
||||
|
||||
<!-- The size of each of the icon buttons in the QS footer -->
|
||||
<dimen name="qs_footer_action_button_size">48dp</dimen>
|
||||
|
||||
<dimen name="qs_footer_action_corner_radius">20dp</dimen>
|
||||
|
||||
<!-- (48dp - 44dp) / 2 -->
|
||||
<dimen name="qs_footer_action_inset">2dp</dimen>
|
||||
<!-- (48dp - 40dp) / 2 -->
|
||||
<dimen name="new_qs_footer_action_inset">4dp</dimen>
|
||||
<dimen name="new_qs_footer_action_inset_negative">-4dp</dimen>
|
||||
<dimen name="qs_footer_action_inset">4dp</dimen>
|
||||
<dimen name="qs_footer_action_inset_negative">-4dp</dimen>
|
||||
|
||||
<!-- Margins on each side of QS Footer -->
|
||||
<dimen name="qs_footer_margin">2dp</dimen>
|
||||
@@ -495,7 +492,7 @@
|
||||
<dimen name="qs_panel_padding">16dp</dimen>
|
||||
<dimen name="qs_dual_tile_padding_horizontal">6dp</dimen>
|
||||
<dimen name="qs_panel_elevation">4dp</dimen>
|
||||
<dimen name="qs_panel_padding_bottom">@dimen/new_footer_height</dimen>
|
||||
<dimen name="qs_panel_padding_bottom">@dimen/footer_actions_height</dimen>
|
||||
<dimen name="qs_panel_padding_top">48dp</dimen>
|
||||
|
||||
<dimen name="qs_data_usage_text_size">14sp</dimen>
|
||||
|
||||
@@ -112,6 +112,10 @@ public class Flags {
|
||||
public static final ResourceBooleanFlag QS_USER_DETAIL_SHORTCUT =
|
||||
new ResourceBooleanFlag(503, R.bool.flag_lockscreen_qs_user_detail_shortcut);
|
||||
|
||||
/**
|
||||
* @deprecated Not needed anymore
|
||||
*/
|
||||
@Deprecated
|
||||
public static final BooleanFlag NEW_FOOTER = new BooleanFlag(504, true);
|
||||
|
||||
public static final BooleanFlag NEW_HEADER = new BooleanFlag(505, false);
|
||||
|
||||
@@ -23,7 +23,6 @@ import android.provider.Settings
|
||||
import android.provider.Settings.Global.USER_SWITCHER_ENABLED
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.LinearLayout
|
||||
import androidx.annotation.VisibleForTesting
|
||||
import com.android.internal.jank.InteractionJankMonitor
|
||||
import com.android.internal.logging.MetricsLogger
|
||||
@@ -32,8 +31,6 @@ import com.android.internal.logging.nano.MetricsProto
|
||||
import com.android.keyguard.KeyguardUpdateMonitor
|
||||
import com.android.systemui.R
|
||||
import com.android.systemui.animation.ActivityLaunchAnimator
|
||||
import com.android.systemui.flags.FeatureFlags
|
||||
import com.android.systemui.flags.Flags
|
||||
import com.android.systemui.globalactions.GlobalActionsDialogLite
|
||||
import com.android.systemui.plugins.ActivityStarter
|
||||
import com.android.systemui.plugins.FalsingManager
|
||||
@@ -45,7 +42,6 @@ import com.android.systemui.statusbar.phone.SettingsButton
|
||||
import com.android.systemui.statusbar.policy.DeviceProvisionedController
|
||||
import com.android.systemui.statusbar.policy.UserInfoController
|
||||
import com.android.systemui.statusbar.policy.UserInfoController.OnUserInfoChangedListener
|
||||
import com.android.systemui.util.DualHeightHorizontalLinearLayout
|
||||
import com.android.systemui.util.ViewController
|
||||
import com.android.systemui.util.settings.GlobalSettings
|
||||
import javax.inject.Inject
|
||||
@@ -74,8 +70,7 @@ internal class FooterActionsController @Inject constructor(
|
||||
private val uiEventLogger: UiEventLogger,
|
||||
@Named(PM_LITE_ENABLED) private val showPMLiteButton: Boolean,
|
||||
private val globalSetting: GlobalSettings,
|
||||
private val handler: Handler,
|
||||
private val featureFlags: FeatureFlags
|
||||
private val handler: Handler
|
||||
) : ViewController<FooterActionsView>(view) {
|
||||
|
||||
private var globalActionsDialog: GlobalActionsDialogLite? = null
|
||||
@@ -100,7 +95,9 @@ internal class FooterActionsController @Inject constructor(
|
||||
view.findViewById(R.id.security_footers_container)
|
||||
private val powerMenuLite: View = view.findViewById(R.id.pm_lite)
|
||||
private val multiUserSwitchController = multiUserSwitchControllerFactory.create(view)
|
||||
private val securityFootersSeparator = View(context).apply {
|
||||
|
||||
@VisibleForTesting
|
||||
internal val securityFootersSeparator = View(context).apply {
|
||||
visibility = View.GONE
|
||||
}
|
||||
|
||||
@@ -171,48 +168,30 @@ internal class FooterActionsController @Inject constructor(
|
||||
}
|
||||
settingsButton.setOnClickListener(onClickListener)
|
||||
multiUserSetting.isListening = true
|
||||
if (featureFlags.isEnabled(Flags.NEW_FOOTER)) {
|
||||
val securityFooter = securityFooterController.view as DualHeightHorizontalLinearLayout
|
||||
securityFootersContainer?.addView(securityFooter)
|
||||
val separatorWidth = resources.getDimensionPixelSize(R.dimen.new_qs_footer_action_inset)
|
||||
securityFootersContainer?.addView(securityFootersSeparator, separatorWidth, 1)
|
||||
reformatForNewFooter(securityFooter)
|
||||
val fgsFooter = fgsManagerFooterController.view
|
||||
securityFootersContainer?.addView(fgsFooter)
|
||||
(fgsFooter.layoutParams as LinearLayout.LayoutParams).apply {
|
||||
width = 0
|
||||
weight = 1f
|
||||
}
|
||||
|
||||
val visibilityListener =
|
||||
VisibilityChangedDispatcher.OnVisibilityChangedListener { visibility ->
|
||||
if (visibility == View.GONE) {
|
||||
securityFootersSeparator.visibility = View.GONE
|
||||
} else if (securityFooter.visibility == View.VISIBLE &&
|
||||
fgsFooter.visibility == View.VISIBLE) {
|
||||
securityFootersSeparator.visibility = View.VISIBLE
|
||||
} else {
|
||||
securityFootersSeparator.visibility = View.GONE
|
||||
}
|
||||
fgsManagerFooterController
|
||||
.setCollapsed(securityFooter.visibility == View.VISIBLE)
|
||||
val securityFooter = securityFooterController.view
|
||||
securityFootersContainer?.addView(securityFooter)
|
||||
val separatorWidth = resources.getDimensionPixelSize(R.dimen.qs_footer_action_inset)
|
||||
securityFootersContainer?.addView(securityFootersSeparator, separatorWidth, 1)
|
||||
|
||||
val fgsFooter = fgsManagerFooterController.view
|
||||
securityFootersContainer?.addView(fgsFooter)
|
||||
|
||||
val visibilityListener =
|
||||
VisibilityChangedDispatcher.OnVisibilityChangedListener { visibility ->
|
||||
if (securityFooter.visibility == View.VISIBLE &&
|
||||
fgsFooter.visibility == View.VISIBLE) {
|
||||
securityFootersSeparator.visibility = View.VISIBLE
|
||||
} else {
|
||||
securityFootersSeparator.visibility = View.GONE
|
||||
}
|
||||
securityFooterController.setOnVisibilityChangedListener(visibilityListener)
|
||||
fgsManagerFooterController.setOnVisibilityChangedListener(visibilityListener)
|
||||
}
|
||||
updateView()
|
||||
}
|
||||
fgsManagerFooterController
|
||||
.setCollapsed(securityFooter.visibility == View.VISIBLE)
|
||||
}
|
||||
securityFooterController.setOnVisibilityChangedListener(visibilityListener)
|
||||
fgsManagerFooterController.setOnVisibilityChangedListener(visibilityListener)
|
||||
|
||||
private fun reformatForNewFooter(view: DualHeightHorizontalLinearLayout) {
|
||||
// This is only necessary while things are flagged as the view could be attached in two
|
||||
// different locations.
|
||||
(view.layoutParams as LinearLayout.LayoutParams).apply {
|
||||
bottomMargin = 0
|
||||
width = 0
|
||||
weight = 1f
|
||||
marginEnd = resources.getDimensionPixelSize(R.dimen.new_qs_footer_action_inset)
|
||||
}
|
||||
view.alwaysSingleLine = true
|
||||
updateView()
|
||||
}
|
||||
|
||||
private fun updateView() {
|
||||
@@ -237,10 +216,9 @@ internal class FooterActionsController @Inject constructor(
|
||||
} else {
|
||||
userInfoController.removeCallback(onUserInfoChangedListener)
|
||||
}
|
||||
if (featureFlags.isEnabled(Flags.NEW_FOOTER)) {
|
||||
fgsManagerFooterController.setListening(listening)
|
||||
securityFooterController.setListening(listening)
|
||||
}
|
||||
|
||||
fgsManagerFooterController.setListening(listening)
|
||||
securityFooterController.setListening(listening)
|
||||
}
|
||||
|
||||
fun disable(state2: Int) {
|
||||
|
||||
@@ -81,8 +81,6 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
|
||||
private final QSPanelController mQsPanelController;
|
||||
private final QuickQSPanelController mQuickQSPanelController;
|
||||
private final QuickStatusBarHeader mQuickStatusBarHeader;
|
||||
private final QSFgsManagerFooter mFgsManagerFooter;
|
||||
private final QSSecurityFooter mSecurityFooter;
|
||||
private final QS mQs;
|
||||
|
||||
@Nullable
|
||||
@@ -105,7 +103,7 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
|
||||
private TouchAnimator mNonfirstPageAlphaAnimator;
|
||||
// TranslatesY the QS Tile layout using QS.getHeightDiff()
|
||||
private TouchAnimator mQSTileLayoutTranslatorAnimator;
|
||||
// This animates fading of SecurityFooter and media divider
|
||||
// This animates fading of media player
|
||||
private TouchAnimator mAllPagesDelayedAnimator;
|
||||
// Animator for brightness slider(s)
|
||||
@Nullable
|
||||
@@ -146,7 +144,6 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
|
||||
public QSAnimator(QS qs, QuickQSPanel quickPanel, QuickStatusBarHeader quickStatusBarHeader,
|
||||
QSPanelController qsPanelController,
|
||||
QuickQSPanelController quickQSPanelController, QSTileHost qsTileHost,
|
||||
QSFgsManagerFooter fgsManagerFooter, QSSecurityFooter securityFooter,
|
||||
@Main Executor executor, TunerService tunerService,
|
||||
QSExpansionPathInterpolator qsExpansionPathInterpolator) {
|
||||
mQs = qs;
|
||||
@@ -154,8 +151,6 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
|
||||
mQsPanelController = qsPanelController;
|
||||
mQuickQSPanelController = quickQSPanelController;
|
||||
mQuickStatusBarHeader = quickStatusBarHeader;
|
||||
mFgsManagerFooter = fgsManagerFooter;
|
||||
mSecurityFooter = securityFooter;
|
||||
mHost = qsTileHost;
|
||||
mExecutor = executor;
|
||||
mTunerService = tunerService;
|
||||
@@ -472,10 +467,8 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
|
||||
.setListener(this)
|
||||
.build();
|
||||
|
||||
// Fade in the security footer and the divider as we reach the final position
|
||||
// Fade in the media player as we reach the final position
|
||||
Builder builder = new Builder().setStartDelay(EXPANDED_TILE_DELAY);
|
||||
builder.addFloat(mFgsManagerFooter.getView(), "alpha", 0, 1);
|
||||
builder.addFloat(mSecurityFooter.getView(), "alpha", 0, 1);
|
||||
if (mQsPanelController.shouldUseHorizontalLayout()
|
||||
&& mQsPanelController.mMediaHost.hostView != null) {
|
||||
builder.addFloat(mQsPanelController.mMediaHost.hostView, "alpha", 0, 1);
|
||||
@@ -484,8 +477,6 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
|
||||
mQsPanelController.mMediaHost.hostView.setAlpha(1.0f);
|
||||
}
|
||||
mAllPagesDelayedAnimator = builder.build();
|
||||
mAllViews.add(mFgsManagerFooter.getView());
|
||||
mAllViews.add(mSecurityFooter.getView());
|
||||
translationYBuilder.setInterpolator(mQSExpansionPathInterpolator.getYInterpolator());
|
||||
qqsTranslationYBuilder.setInterpolator(mQSExpansionPathInterpolator.getYInterpolator());
|
||||
translationXBuilder.setInterpolator(mQSExpansionPathInterpolator.getXInterpolator());
|
||||
|
||||
@@ -138,12 +138,8 @@ public class QSContainerImpl extends FrameLayout implements Dumpable {
|
||||
}
|
||||
|
||||
void updateResources(QSPanelController qsPanelController,
|
||||
QuickStatusBarHeaderController quickStatusBarHeaderController,
|
||||
boolean newFooter) {
|
||||
int bottomPadding = 0;
|
||||
if (newFooter) {
|
||||
bottomPadding = getResources().getDimensionPixelSize(R.dimen.qs_panel_padding_bottom);
|
||||
}
|
||||
QuickStatusBarHeaderController quickStatusBarHeaderController) {
|
||||
int bottomPadding = getResources().getDimensionPixelSize(R.dimen.qs_panel_padding_bottom);
|
||||
mQSPanelContainer.setPaddingRelative(
|
||||
mQSPanelContainer.getPaddingStart(),
|
||||
QSUtils.getQsHeaderSystemIconsAreaHeight(mContext),
|
||||
|
||||
@@ -18,8 +18,6 @@ package com.android.systemui.qs;
|
||||
|
||||
import android.content.res.Configuration;
|
||||
|
||||
import com.android.systemui.flags.FeatureFlags;
|
||||
import com.android.systemui.flags.Flags;
|
||||
import com.android.systemui.qs.dagger.QSScope;
|
||||
import com.android.systemui.statusbar.policy.ConfigurationController;
|
||||
import com.android.systemui.util.ViewController;
|
||||
@@ -32,26 +30,23 @@ public class QSContainerImplController extends ViewController<QSContainerImpl> {
|
||||
private final QSPanelController mQsPanelController;
|
||||
private final QuickStatusBarHeaderController mQuickStatusBarHeaderController;
|
||||
private final ConfigurationController mConfigurationController;
|
||||
private final boolean mNewFooter;
|
||||
|
||||
private final ConfigurationController.ConfigurationListener mConfigurationListener =
|
||||
new ConfigurationController.ConfigurationListener() {
|
||||
@Override
|
||||
public void onConfigChanged(Configuration newConfig) {
|
||||
mView.updateResources(mQsPanelController, mQuickStatusBarHeaderController, mNewFooter);
|
||||
mView.updateResources(mQsPanelController, mQuickStatusBarHeaderController);
|
||||
}
|
||||
};
|
||||
|
||||
@Inject
|
||||
QSContainerImplController(QSContainerImpl view, QSPanelController qsPanelController,
|
||||
QuickStatusBarHeaderController quickStatusBarHeaderController,
|
||||
ConfigurationController configurationController,
|
||||
FeatureFlags featureFlags) {
|
||||
ConfigurationController configurationController) {
|
||||
super(view);
|
||||
mQsPanelController = qsPanelController;
|
||||
mQuickStatusBarHeaderController = quickStatusBarHeaderController;
|
||||
mConfigurationController = configurationController;
|
||||
mNewFooter = featureFlags.isEnabled(Flags.NEW_FOOTER);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -65,7 +60,7 @@ public class QSContainerImplController extends ViewController<QSContainerImpl> {
|
||||
|
||||
@Override
|
||||
protected void onViewAttached() {
|
||||
mView.updateResources(mQsPanelController, mQuickStatusBarHeaderController, mNewFooter);
|
||||
mView.updateResources(mQsPanelController, mQuickStatusBarHeaderController);
|
||||
mConfigurationController.addCallback(mConfigurationListener);
|
||||
}
|
||||
|
||||
|
||||
@@ -211,7 +211,6 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
|
||||
}
|
||||
});
|
||||
mHeader = view.findViewById(R.id.header);
|
||||
mQSPanelController.setHeaderContainer(view.findViewById(R.id.header_text_container));
|
||||
mFooter = qsFragmentComponent.getQSFooter();
|
||||
|
||||
mQSContainerImplController = qsFragmentComponent.getQSContainerImplController();
|
||||
|
||||
@@ -75,7 +75,6 @@ public class QSPanel extends LinearLayout implements Tunable {
|
||||
@Nullable
|
||||
protected BrightnessSliderController mToggleSliderController;
|
||||
|
||||
private final H mHandler = new H();
|
||||
/** Whether or not the QS media player feature is enabled. */
|
||||
protected boolean mUsingMediaPlayer;
|
||||
|
||||
@@ -86,16 +85,9 @@ public class QSPanel extends LinearLayout implements Tunable {
|
||||
private final List<OnConfigurationChangedListener> mOnConfigurationChangedListeners =
|
||||
new ArrayList<>();
|
||||
|
||||
@Nullable
|
||||
protected View mFgsManagerFooter;
|
||||
@Nullable
|
||||
protected View mSecurityFooter;
|
||||
|
||||
@Nullable
|
||||
protected View mFooter;
|
||||
|
||||
@Nullable
|
||||
private ViewGroup mHeaderContainer;
|
||||
@Nullable
|
||||
private PageIndicator mFooterPageIndicator;
|
||||
private int mContentMarginStart;
|
||||
@@ -112,7 +104,6 @@ public class QSPanel extends LinearLayout implements Tunable {
|
||||
private float mSquishinessFraction = 1f;
|
||||
private final ArrayMap<View, Integer> mChildrenLayoutTop = new ArrayMap<>();
|
||||
private final Rect mClippingRect = new Rect();
|
||||
private boolean mUseNewFooter = false;
|
||||
private ViewGroup mMediaHostView;
|
||||
private boolean mShouldMoveMediaOnExpansion = true;
|
||||
|
||||
@@ -156,10 +147,6 @@ public class QSPanel extends LinearLayout implements Tunable {
|
||||
}
|
||||
}
|
||||
|
||||
void setUseNewFooter(boolean useNewFooter) {
|
||||
mUseNewFooter = useNewFooter;
|
||||
}
|
||||
|
||||
protected void setHorizontalContentContainerClipping() {
|
||||
mHorizontalContentContainer.setClipChildren(true);
|
||||
mHorizontalContentContainer.setClipToPadding(false);
|
||||
@@ -444,27 +431,6 @@ public class QSPanel extends LinearLayout implements Tunable {
|
||||
}
|
||||
}
|
||||
|
||||
/** Switch the security footer between top and bottom of QS depending on orientation. */
|
||||
public void switchSecurityFooter(boolean shouldUseSplitNotificationShade) {
|
||||
if (mSecurityFooter == null) return;
|
||||
|
||||
if (!shouldUseSplitNotificationShade
|
||||
&& mContext.getResources().getConfiguration().orientation
|
||||
== Configuration.ORIENTATION_LANDSCAPE && mHeaderContainer != null) {
|
||||
// Adding the security view to the header, that enables us to avoid scrolling
|
||||
switchToParent(mSecurityFooter, mHeaderContainer, 0);
|
||||
} else {
|
||||
// Add after the footer
|
||||
int index;
|
||||
if (mFgsManagerFooter != null) {
|
||||
index = indexOfChild(mFgsManagerFooter);
|
||||
} else {
|
||||
index = indexOfChild(mFooter);
|
||||
}
|
||||
switchToParent(mSecurityFooter, this, index + 1);
|
||||
}
|
||||
}
|
||||
|
||||
private void switchToParent(View child, ViewGroup parent, int index) {
|
||||
switchToParent(child, parent, index, getDumpableTag());
|
||||
}
|
||||
@@ -609,38 +575,10 @@ public class QSPanel extends LinearLayout implements Tunable {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the header container of quick settings.
|
||||
*/
|
||||
public void setHeaderContainer(@NonNull ViewGroup headerContainer) {
|
||||
mHeaderContainer = headerContainer;
|
||||
}
|
||||
|
||||
public boolean isListening() {
|
||||
return mListening;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the security footer view and switch it into the right place
|
||||
* @param view the view in question
|
||||
* @param shouldUseSplitNotificationShade if QS is in split shade mode
|
||||
*/
|
||||
public void setSecurityFooter(View view, boolean shouldUseSplitNotificationShade) {
|
||||
mSecurityFooter = view;
|
||||
switchSecurityFooter(shouldUseSplitNotificationShade);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the fgs manager footer view and switch it into the right place
|
||||
* @param view the view in question
|
||||
*/
|
||||
public void setFgsManagerFooter(View view) {
|
||||
mFgsManagerFooter = view;
|
||||
// Add after the footer
|
||||
int index = indexOfChild(mFooter);
|
||||
switchToParent(mFgsManagerFooter, this, index + 1);
|
||||
}
|
||||
|
||||
protected void setPageMargin(int pageMargin) {
|
||||
if (mTileLayout instanceof PagedTileLayout) {
|
||||
((PagedTileLayout) mTileLayout).setPageMargin(pageMargin);
|
||||
|
||||
@@ -21,18 +21,14 @@ import static com.android.systemui.media.dagger.MediaModule.QS_PANEL;
|
||||
import static com.android.systemui.qs.QSPanel.QS_SHOW_BRIGHTNESS;
|
||||
import static com.android.systemui.qs.dagger.QSFragmentModule.QS_USING_MEDIA_PLAYER;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.content.res.Configuration;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.android.internal.logging.MetricsLogger;
|
||||
import com.android.internal.logging.UiEventLogger;
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
import com.android.systemui.dump.DumpManager;
|
||||
import com.android.systemui.flags.FeatureFlags;
|
||||
import com.android.systemui.flags.Flags;
|
||||
import com.android.systemui.media.MediaHierarchyManager;
|
||||
import com.android.systemui.media.MediaHost;
|
||||
import com.android.systemui.media.MediaHostState;
|
||||
@@ -56,8 +52,6 @@ import javax.inject.Named;
|
||||
@QSScope
|
||||
public class QSPanelController extends QSPanelControllerBase<QSPanel> {
|
||||
|
||||
private final QSFgsManagerFooter mQSFgsManagerFooter;
|
||||
private final QSSecurityFooter mQsSecurityFooter;
|
||||
private final TunerService mTunerService;
|
||||
private final QSCustomizerController mQsCustomizerController;
|
||||
private final QSTileRevealController.Factory mQsTileRevealControllerFactory;
|
||||
@@ -65,7 +59,6 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
|
||||
private final BrightnessController mBrightnessController;
|
||||
private final BrightnessSliderController mBrightnessSliderController;
|
||||
private final BrightnessMirrorHandler mBrightnessMirrorHandler;
|
||||
private final FeatureFlags mFeatureFlags;
|
||||
private final StatusBarKeyguardViewManager mStatusBarKeyguardViewManager;
|
||||
|
||||
private boolean mGridContentVisible = true;
|
||||
@@ -75,11 +68,9 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
|
||||
@Override
|
||||
public void onConfigurationChange(Configuration newConfig) {
|
||||
mView.updateResources();
|
||||
mQsSecurityFooter.onConfigurationChanged();
|
||||
if (mView.isListening()) {
|
||||
refreshAllTiles();
|
||||
}
|
||||
mView.switchSecurityFooter(mShouldUseSplitNotificationShade);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -94,8 +85,7 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
|
||||
};
|
||||
|
||||
@Inject
|
||||
QSPanelController(QSPanel view, QSFgsManagerFooter qsFgsManagerFooter,
|
||||
QSSecurityFooter qsSecurityFooter, TunerService tunerService,
|
||||
QSPanelController(QSPanel view, TunerService tunerService,
|
||||
QSTileHost qstileHost, QSCustomizerController qsCustomizerController,
|
||||
@Named(QS_USING_MEDIA_PLAYER) boolean usingMediaPlayer,
|
||||
@Named(QS_PANEL) MediaHost mediaHost,
|
||||
@@ -103,12 +93,10 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
|
||||
DumpManager dumpManager, MetricsLogger metricsLogger, UiEventLogger uiEventLogger,
|
||||
QSLogger qsLogger, BrightnessController.Factory brightnessControllerFactory,
|
||||
BrightnessSliderController.Factory brightnessSliderFactory,
|
||||
FalsingManager falsingManager, FeatureFlags featureFlags,
|
||||
FalsingManager falsingManager,
|
||||
StatusBarKeyguardViewManager statusBarKeyguardViewManager) {
|
||||
super(view, qstileHost, qsCustomizerController, usingMediaPlayer, mediaHost,
|
||||
metricsLogger, uiEventLogger, qsLogger, dumpManager);
|
||||
mQSFgsManagerFooter = qsFgsManagerFooter;
|
||||
mQsSecurityFooter = qsSecurityFooter;
|
||||
mTunerService = tunerService;
|
||||
mQsCustomizerController = qsCustomizerController;
|
||||
mQsTileRevealControllerFactory = qsTileRevealControllerFactory;
|
||||
@@ -119,9 +107,7 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
|
||||
|
||||
mBrightnessController = brightnessControllerFactory.create(mBrightnessSliderController);
|
||||
mBrightnessMirrorHandler = new BrightnessMirrorHandler(mBrightnessController);
|
||||
mFeatureFlags = featureFlags;
|
||||
mStatusBarKeyguardViewManager = statusBarKeyguardViewManager;
|
||||
view.setUseNewFooter(featureFlags.isEnabled(Flags.NEW_FOOTER));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -132,7 +118,6 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
|
||||
mMediaHost.init(MediaHierarchyManager.LOCATION_QS);
|
||||
mQsCustomizerController.init();
|
||||
mBrightnessSliderController.init();
|
||||
mQSFgsManagerFooter.init();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -147,10 +132,6 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
|
||||
refreshAllTiles();
|
||||
}
|
||||
mView.addOnConfigurationChangedListener(mOnConfigurationChangedListener);
|
||||
if (!mFeatureFlags.isEnabled(Flags.NEW_FOOTER)) {
|
||||
mView.setSecurityFooter(mQsSecurityFooter.getView(), mShouldUseSplitNotificationShade);
|
||||
mView.setFgsManagerFooter(mQSFgsManagerFooter.getView());
|
||||
}
|
||||
switchTileLayout(true);
|
||||
mBrightnessMirrorHandler.onQsPanelAttached();
|
||||
|
||||
@@ -172,13 +153,6 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
|
||||
super.onViewDetached();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the header container of quick settings.
|
||||
*/
|
||||
public void setHeaderContainer(@NonNull ViewGroup headerContainer) {
|
||||
mView.setHeaderContainer(headerContainer);
|
||||
}
|
||||
|
||||
/** */
|
||||
public void setVisibility(int visibility) {
|
||||
mView.setVisibility(visibility);
|
||||
@@ -191,11 +165,6 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
|
||||
refreshAllTiles();
|
||||
}
|
||||
|
||||
if (!mFeatureFlags.isEnabled(Flags.NEW_FOOTER)) {
|
||||
mQSFgsManagerFooter.setListening(listening);
|
||||
mQsSecurityFooter.setListening(listening);
|
||||
}
|
||||
|
||||
// Set the listening as soon as the QS fragment starts listening regardless of the
|
||||
//expansion, so it will update the current brightness before the slider is visible.
|
||||
if (listening) {
|
||||
@@ -224,8 +193,6 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
|
||||
public void refreshAllTiles() {
|
||||
mBrightnessController.checkRestrictionAndSetEnabled();
|
||||
super.refreshAllTiles();
|
||||
mQSFgsManagerFooter.refreshState();
|
||||
mQsSecurityFooter.refreshState();
|
||||
}
|
||||
|
||||
/** Start customizing the Quick Settings. */
|
||||
|
||||
@@ -70,7 +70,6 @@ public class QuickStatusBarHeader extends FrameLayout {
|
||||
private View mDateView;
|
||||
// DateView next to clock. Visible on QQS
|
||||
private VariableDateView mClockDateView;
|
||||
private View mSecurityHeaderView;
|
||||
private View mStatusIconsView;
|
||||
private View mContainer;
|
||||
|
||||
@@ -137,7 +136,6 @@ public class QuickStatusBarHeader extends FrameLayout {
|
||||
mPrivacyChip = findViewById(R.id.privacy_chip);
|
||||
mDateView = findViewById(R.id.date);
|
||||
mClockDateView = findViewById(R.id.date_clock);
|
||||
mSecurityHeaderView = findViewById(R.id.header_text_container);
|
||||
mClockIconsSeparator = findViewById(R.id.separator);
|
||||
mRightLayout = findViewById(R.id.rightLayout);
|
||||
mDateContainer = findViewById(R.id.date_container);
|
||||
@@ -152,8 +150,6 @@ public class QuickStatusBarHeader extends FrameLayout {
|
||||
updateResources();
|
||||
Configuration config = mContext.getResources().getConfiguration();
|
||||
setDatePrivacyContainersWidth(config.orientation == Configuration.ORIENTATION_LANDSCAPE);
|
||||
setSecurityHeaderContainerVisibility(
|
||||
config.orientation == Configuration.ORIENTATION_LANDSCAPE);
|
||||
|
||||
// QS will always show the estimate, and BatteryMeterView handles the case where
|
||||
// it's unavailable or charging
|
||||
@@ -207,8 +203,6 @@ public class QuickStatusBarHeader extends FrameLayout {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
updateResources();
|
||||
setDatePrivacyContainersWidth(newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE);
|
||||
setSecurityHeaderContainerVisibility(
|
||||
newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -229,10 +223,6 @@ public class QuickStatusBarHeader extends FrameLayout {
|
||||
mPrivacyContainer.setLayoutParams(lp);
|
||||
}
|
||||
|
||||
private void setSecurityHeaderContainerVisibility(boolean landscape) {
|
||||
mSecurityHeaderView.setVisibility(landscape ? VISIBLE : GONE);
|
||||
}
|
||||
|
||||
private void updateBatteryMode() {
|
||||
if (mConfigShowBatteryEstimate && !mHasCenterCutout) {
|
||||
mBatteryRemainingIcon.setPercentShowMode(BatteryMeterView.MODE_ESTIMATE);
|
||||
@@ -337,7 +327,6 @@ public class QuickStatusBarHeader extends FrameLayout {
|
||||
return;
|
||||
}
|
||||
TouchAnimator.Builder builder = new TouchAnimator.Builder()
|
||||
.addFloat(mSecurityHeaderView, "alpha", 0, 1)
|
||||
// These views appear on expanding down
|
||||
.addFloat(mDateView, "alpha", 0, 0, 1)
|
||||
.addFloat(mClockDateView, "alpha", 1, 0, 0)
|
||||
|
||||
@@ -22,13 +22,10 @@ import static com.android.systemui.util.Utils.useQsMediaPlayer;
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewStub;
|
||||
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.battery.BatteryMeterView;
|
||||
import com.android.systemui.dagger.qualifiers.RootView;
|
||||
import com.android.systemui.flags.FeatureFlags;
|
||||
import com.android.systemui.flags.Flags;
|
||||
import com.android.systemui.plugins.qs.QS;
|
||||
import com.android.systemui.privacy.OngoingPrivacyChip;
|
||||
import com.android.systemui.qs.FooterActionsView;
|
||||
@@ -128,15 +125,7 @@ public interface QSFragmentModule {
|
||||
* This will replace a ViewStub either in {@link QSFooterView} or in {@link QSContainerImpl}.
|
||||
*/
|
||||
@Provides
|
||||
static FooterActionsView providesQSFooterActionsView(@RootView View view,
|
||||
FeatureFlags featureFlags) {
|
||||
ViewStub stub;
|
||||
if (featureFlags.isEnabled(Flags.NEW_FOOTER)) {
|
||||
stub = view.requireViewById(R.id.container_stub);
|
||||
} else {
|
||||
stub = view.requireViewById(R.id.footer_stub);
|
||||
}
|
||||
stub.inflate();
|
||||
static FooterActionsView providesQSFooterActionsView(@RootView View view) {
|
||||
return view.findViewById(R.id.qs_footer_actions);
|
||||
}
|
||||
|
||||
@@ -161,9 +150,10 @@ public interface QSFragmentModule {
|
||||
@Named(QS_SECURITY_FOOTER_VIEW)
|
||||
static View providesQSSecurityFooterView(
|
||||
@QSThemedContext LayoutInflater layoutInflater,
|
||||
QSPanel qsPanel
|
||||
FooterActionsView footerActionsView
|
||||
) {
|
||||
return layoutInflater.inflate(R.layout.quick_settings_security_footer, qsPanel, false);
|
||||
return layoutInflater.inflate(R.layout.quick_settings_security_footer, footerActionsView,
|
||||
false);
|
||||
}
|
||||
|
||||
/** */
|
||||
@@ -200,8 +190,8 @@ public interface QSFragmentModule {
|
||||
@Named(QS_FGS_MANAGER_FOOTER_VIEW)
|
||||
static View providesQSFgsManagerFooterView(
|
||||
@QSThemedContext LayoutInflater layoutInflater,
|
||||
QSPanel qsPanel
|
||||
FooterActionsView footerActionsView
|
||||
) {
|
||||
return layoutInflater.inflate(R.layout.fgs_footer, qsPanel, false);
|
||||
return layoutInflater.inflate(R.layout.fgs_footer, footerActionsView, false);
|
||||
}
|
||||
}
|
||||
@@ -168,14 +168,7 @@ class NotificationsQSContainerController @Inject constructor(
|
||||
private fun updateBottomSpacing() {
|
||||
val (containerPadding, notificationsMargin) = calculateBottomSpacing()
|
||||
var qsScrollPaddingBottom = 0
|
||||
val newFooter = featureFlags.isEnabled(Flags.NEW_FOOTER)
|
||||
if (!newFooter && !(splitShadeEnabled || isQSCustomizing || isQSDetailShowing ||
|
||||
isGestureNavigation || taskbarVisible)) {
|
||||
// no taskbar, portrait, navigation buttons enabled:
|
||||
// padding is needed so QS can scroll up over bottom insets - to reach the point when
|
||||
// the whole QS is above bottom insets
|
||||
qsScrollPaddingBottom = bottomStableInsets
|
||||
} else if (newFooter && !(isQSCustomizing || isQSDetailShowing)) {
|
||||
if (!(isQSCustomizing || isQSDetailShowing)) {
|
||||
// With the new footer, we also want this padding in the bottom in these cases
|
||||
qsScrollPaddingBottom = if (splitShadeEnabled) {
|
||||
notificationsMargin - scrimShadeBottomMargin
|
||||
@@ -185,11 +178,7 @@ class NotificationsQSContainerController @Inject constructor(
|
||||
}
|
||||
mView.setPadding(0, 0, 0, containerPadding)
|
||||
mView.setNotificationsMarginBottom(notificationsMargin)
|
||||
if (newFooter) {
|
||||
mView.setQSContainerPaddingBottom(qsScrollPaddingBottom)
|
||||
} else {
|
||||
mView.setQSScrollPaddingBottom(qsScrollPaddingBottom)
|
||||
}
|
||||
mView.setQSContainerPaddingBottom(qsScrollPaddingBottom)
|
||||
}
|
||||
|
||||
private fun calculateBottomSpacing(): Pair<Int, Int> {
|
||||
|
||||
@@ -103,16 +103,6 @@ public class NotificationsQuickSettingsContainer extends ConstraintLayout
|
||||
mStackScroller.setLayoutParams(params);
|
||||
}
|
||||
|
||||
public void setQSScrollPaddingBottom(int paddingBottom) {
|
||||
if (mQSScrollView != null) {
|
||||
mQSScrollView.setPaddingRelative(
|
||||
mQSScrollView.getPaddingLeft(),
|
||||
mQSScrollView.getPaddingTop(),
|
||||
mQSScrollView.getPaddingRight(),
|
||||
paddingBottom);
|
||||
}
|
||||
}
|
||||
|
||||
public void setQSContainerPaddingBottom(int paddingBottom) {
|
||||
if (mQSContainer != null) {
|
||||
mQSContainer.setPadding(
|
||||
|
||||
@@ -1,183 +0,0 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package com.android.systemui.util
|
||||
|
||||
import android.content.Context
|
||||
import android.content.res.Configuration
|
||||
import android.util.AttributeSet
|
||||
import android.util.DisplayMetrics
|
||||
import android.util.TypedValue
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import com.android.systemui.R
|
||||
|
||||
/**
|
||||
* Horizontal [LinearLayout] to contain some text.
|
||||
*
|
||||
* The height of this container can alternate between two different heights, depending on whether
|
||||
* the text takes one line or more.
|
||||
*
|
||||
* When the text takes multiple lines, it will use the values in the regular attributes (`padding`,
|
||||
* `layout_height`). The single line behavior must be set in XML.
|
||||
*
|
||||
* XML attributes for single line behavior:
|
||||
* * `systemui:textViewId`: set the id for the [TextView] that determines the height of the
|
||||
* container
|
||||
* * `systemui:singleLineHeight`: sets the height of the view when the text takes up only one line.
|
||||
* By default, it will use [getMinimumHeight].
|
||||
* * `systemui:singleLineVerticalPadding`: sets the padding (top and bottom) when then text takes up
|
||||
* only one line. By default, it is 0.
|
||||
*
|
||||
* All dimensions are updated when configuration changes.
|
||||
*/
|
||||
class DualHeightHorizontalLinearLayout @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttrs: Int = 0,
|
||||
defStyleRes: Int = 0
|
||||
) : LinearLayout(context, attrs, defStyleAttrs, defStyleRes) {
|
||||
|
||||
private val singleLineHeightValue: TypedValue?
|
||||
private var singleLineHeightPx = 0
|
||||
|
||||
private val singleLineVerticalPaddingValue: TypedValue?
|
||||
private var singleLineVerticalPaddingPx = 0
|
||||
|
||||
private val textViewId: Int
|
||||
private var textView: TextView? = null
|
||||
|
||||
private val displayMetrics: DisplayMetrics
|
||||
get() = context.resources.displayMetrics
|
||||
|
||||
private var initialPadding = mPaddingTop // All vertical padding is the same
|
||||
|
||||
private var originalMaxLines = 1
|
||||
var alwaysSingleLine: Boolean = false
|
||||
set(value) {
|
||||
field = value
|
||||
if (field) {
|
||||
textView?.setSingleLine()
|
||||
} else {
|
||||
textView?.maxLines = originalMaxLines
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
if (orientation != HORIZONTAL) {
|
||||
throw IllegalStateException("This view should always have horizontal orientation")
|
||||
}
|
||||
|
||||
val ta = context.obtainStyledAttributes(
|
||||
attrs,
|
||||
R.styleable.DualHeightHorizontalLinearLayout, defStyleAttrs, defStyleRes
|
||||
)
|
||||
|
||||
val tempHeight = TypedValue()
|
||||
singleLineHeightValue = if (
|
||||
ta.hasValue(R.styleable.DualHeightHorizontalLinearLayout_singleLineHeight)
|
||||
) {
|
||||
ta.getValue(R.styleable.DualHeightHorizontalLinearLayout_singleLineHeight, tempHeight)
|
||||
tempHeight
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
||||
val tempPadding = TypedValue()
|
||||
singleLineVerticalPaddingValue = if (
|
||||
ta.hasValue(R.styleable.DualHeightHorizontalLinearLayout_singleLineVerticalPadding)
|
||||
) {
|
||||
ta.getValue(
|
||||
R.styleable.DualHeightHorizontalLinearLayout_singleLineVerticalPadding,
|
||||
tempPadding
|
||||
)
|
||||
tempPadding
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
||||
textViewId = ta.getResourceId(R.styleable.DualHeightHorizontalLinearLayout_textViewId, 0)
|
||||
|
||||
ta.recycle()
|
||||
}
|
||||
|
||||
init {
|
||||
updateResources()
|
||||
}
|
||||
|
||||
override fun setPadding(left: Int, top: Int, right: Int, bottom: Int) {
|
||||
super.setPadding(left, top, right, bottom)
|
||||
initialPadding = top
|
||||
}
|
||||
|
||||
override fun setPaddingRelative(start: Int, top: Int, end: Int, bottom: Int) {
|
||||
super.setPaddingRelative(start, top, end, bottom)
|
||||
initialPadding = top
|
||||
}
|
||||
|
||||
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec)
|
||||
textView?.let { tv ->
|
||||
if (tv.lineCount < 2 || alwaysSingleLine) {
|
||||
setMeasuredDimension(measuredWidth, singleLineHeightPx)
|
||||
mPaddingBottom = 0
|
||||
mPaddingTop = 0
|
||||
} else {
|
||||
mPaddingBottom = initialPadding
|
||||
mPaddingTop = initialPadding
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFinishInflate() {
|
||||
super.onFinishInflate()
|
||||
textView = findViewById<TextView>(textViewId)?.also {
|
||||
originalMaxLines = it.maxLines
|
||||
}
|
||||
}
|
||||
|
||||
override fun onConfigurationChanged(newConfig: Configuration?) {
|
||||
super.onConfigurationChanged(newConfig)
|
||||
updateResources()
|
||||
}
|
||||
|
||||
override fun setOrientation(orientation: Int) {
|
||||
if (orientation == VERTICAL) {
|
||||
throw IllegalStateException("This view should always have horizontal orientation")
|
||||
}
|
||||
super.setOrientation(orientation)
|
||||
}
|
||||
|
||||
private fun updateResources() {
|
||||
updateDimensionValue(singleLineHeightValue, minimumHeight, ::singleLineHeightPx::set)
|
||||
updateDimensionValue(singleLineVerticalPaddingValue, 0, ::singleLineVerticalPaddingPx::set)
|
||||
}
|
||||
|
||||
private inline fun updateDimensionValue(
|
||||
tv: TypedValue?,
|
||||
defaultValue: Int,
|
||||
propertySetter: (Int) -> Unit
|
||||
) {
|
||||
val value = tv?.let {
|
||||
if (it.resourceId != 0) {
|
||||
context.resources.getDimensionPixelSize(it.resourceId)
|
||||
} else {
|
||||
it.getDimension(displayMetrics).toInt()
|
||||
}
|
||||
} ?: defaultValue
|
||||
propertySetter(value)
|
||||
}
|
||||
}
|
||||
@@ -8,20 +8,20 @@ import android.testing.TestableLooper
|
||||
import android.testing.ViewUtils
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.test.filters.SmallTest
|
||||
import com.android.internal.logging.MetricsLogger
|
||||
import com.android.internal.logging.UiEventLogger
|
||||
import com.android.internal.logging.testing.FakeMetricsLogger
|
||||
import com.android.systemui.R
|
||||
import com.android.systemui.classifier.FalsingManagerFake
|
||||
import com.android.systemui.flags.FeatureFlags
|
||||
import com.android.systemui.flags.Flags
|
||||
import com.android.systemui.globalactions.GlobalActionsDialogLite
|
||||
import com.android.systemui.plugins.ActivityStarter
|
||||
import com.android.systemui.settings.UserTracker
|
||||
import com.android.systemui.statusbar.phone.MultiUserSwitchController
|
||||
import com.android.systemui.statusbar.policy.DeviceProvisionedController
|
||||
import com.android.systemui.statusbar.policy.UserInfoController
|
||||
import com.android.systemui.util.mockito.capture
|
||||
import com.android.systemui.util.settings.FakeSettings
|
||||
import com.android.systemui.utils.leaks.LeakCheckedTest
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
@@ -29,10 +29,14 @@ import org.junit.After
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.ArgumentCaptor
|
||||
import org.mockito.ArgumentMatchers.any
|
||||
import org.mockito.ArgumentMatchers.anyBoolean
|
||||
import org.mockito.Captor
|
||||
import org.mockito.Mock
|
||||
import org.mockito.Mockito
|
||||
import org.mockito.Mockito.atLeastOnce
|
||||
import org.mockito.Mockito.clearInvocations
|
||||
import org.mockito.Mockito.never
|
||||
import org.mockito.Mockito.reset
|
||||
import org.mockito.Mockito.verify
|
||||
@@ -65,11 +69,12 @@ class FooterActionsControllerTest : LeakCheckedTest() {
|
||||
@Mock
|
||||
private lateinit var uiEventLogger: UiEventLogger
|
||||
@Mock
|
||||
private lateinit var featureFlags: FeatureFlags
|
||||
@Mock
|
||||
private lateinit var securityFooterController: QSSecurityFooter
|
||||
@Mock
|
||||
private lateinit var fgsManagerController: QSFgsManagerFooter
|
||||
@Captor
|
||||
private lateinit var visibilityChangedCaptor:
|
||||
ArgumentCaptor<VisibilityChangedDispatcher.OnVisibilityChangedListener>
|
||||
|
||||
private lateinit var controller: FooterActionsController
|
||||
|
||||
@@ -78,6 +83,8 @@ class FooterActionsControllerTest : LeakCheckedTest() {
|
||||
private val falsingManager: FalsingManagerFake = FalsingManagerFake()
|
||||
private lateinit var testableLooper: TestableLooper
|
||||
private lateinit var fakeSettings: FakeSettings
|
||||
private lateinit var securityFooter: View
|
||||
private lateinit var fgsFooter: View
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
@@ -87,9 +94,14 @@ class FooterActionsControllerTest : LeakCheckedTest() {
|
||||
|
||||
whenever(multiUserSwitchControllerFactory.create(any()))
|
||||
.thenReturn(multiUserSwitchController)
|
||||
whenever(featureFlags.isEnabled(Flags.NEW_FOOTER)).thenReturn(false)
|
||||
whenever(globalActionsDialogProvider.get()).thenReturn(globalActionsDialog)
|
||||
|
||||
securityFooter = View(mContext)
|
||||
fgsFooter = View(mContext)
|
||||
|
||||
whenever(securityFooterController.view).thenReturn(securityFooter)
|
||||
whenever(fgsManagerController.view).thenReturn(fgsFooter)
|
||||
|
||||
view = inflateView()
|
||||
|
||||
controller = constructFooterActionsController(view)
|
||||
@@ -106,6 +118,13 @@ class FooterActionsControllerTest : LeakCheckedTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testInitializesControllers() {
|
||||
verify(multiUserSwitchController).init()
|
||||
verify(fgsManagerController).init()
|
||||
verify(securityFooterController).init()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testLogPowerMenuClick() {
|
||||
controller.visible = true
|
||||
@@ -182,6 +201,10 @@ class FooterActionsControllerTest : LeakCheckedTest() {
|
||||
@Test
|
||||
fun testCleanUpGAD() {
|
||||
reset(globalActionsDialogProvider)
|
||||
// We are creating a new controller, so detach the views from it
|
||||
(securityFooter.parent as ViewGroup).removeView(securityFooter)
|
||||
(fgsFooter.parent as ViewGroup).removeView(fgsFooter)
|
||||
|
||||
whenever(globalActionsDialogProvider.get()).thenReturn(globalActionsDialog)
|
||||
val view = inflateView()
|
||||
controller = constructFooterActionsController(view)
|
||||
@@ -198,6 +221,80 @@ class FooterActionsControllerTest : LeakCheckedTest() {
|
||||
verify(globalActionsDialog).destroy()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testSeparatorVisibility_noneVisible_gone() {
|
||||
verify(securityFooterController)
|
||||
.setOnVisibilityChangedListener(capture(visibilityChangedCaptor))
|
||||
val listener = visibilityChangedCaptor.value
|
||||
val separator = controller.securityFootersSeparator
|
||||
|
||||
setVisibilities(securityFooterVisible = false, fgsFooterVisible = false, listener)
|
||||
assertThat(separator.visibility).isEqualTo(View.GONE)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testSeparatorVisibility_onlySecurityFooterVisible_gone() {
|
||||
verify(securityFooterController)
|
||||
.setOnVisibilityChangedListener(capture(visibilityChangedCaptor))
|
||||
val listener = visibilityChangedCaptor.value
|
||||
val separator = controller.securityFootersSeparator
|
||||
|
||||
setVisibilities(securityFooterVisible = true, fgsFooterVisible = false, listener)
|
||||
assertThat(separator.visibility).isEqualTo(View.GONE)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testSeparatorVisibility_onlyFgsFooterVisible_gone() {
|
||||
verify(securityFooterController)
|
||||
.setOnVisibilityChangedListener(capture(visibilityChangedCaptor))
|
||||
val listener = visibilityChangedCaptor.value
|
||||
val separator = controller.securityFootersSeparator
|
||||
|
||||
setVisibilities(securityFooterVisible = false, fgsFooterVisible = true, listener)
|
||||
assertThat(separator.visibility).isEqualTo(View.GONE)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testSeparatorVisibility_bothVisible_visible() {
|
||||
verify(securityFooterController)
|
||||
.setOnVisibilityChangedListener(capture(visibilityChangedCaptor))
|
||||
val listener = visibilityChangedCaptor.value
|
||||
val separator = controller.securityFootersSeparator
|
||||
|
||||
setVisibilities(securityFooterVisible = true, fgsFooterVisible = true, listener)
|
||||
assertThat(separator.visibility).isEqualTo(View.VISIBLE)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testFgsFooterCollapsed() {
|
||||
verify(securityFooterController)
|
||||
.setOnVisibilityChangedListener(capture(visibilityChangedCaptor))
|
||||
val listener = visibilityChangedCaptor.value
|
||||
|
||||
val booleanCaptor = ArgumentCaptor.forClass(Boolean::class.java)
|
||||
|
||||
clearInvocations(fgsManagerController)
|
||||
setVisibilities(securityFooterVisible = false, fgsFooterVisible = true, listener)
|
||||
verify(fgsManagerController, atLeastOnce()).setCollapsed(capture(booleanCaptor))
|
||||
assertThat(booleanCaptor.allValues.last()).isFalse()
|
||||
|
||||
clearInvocations(fgsManagerController)
|
||||
setVisibilities(securityFooterVisible = true, fgsFooterVisible = true, listener)
|
||||
verify(fgsManagerController, atLeastOnce()).setCollapsed(capture(booleanCaptor))
|
||||
assertThat(booleanCaptor.allValues.last()).isTrue()
|
||||
}
|
||||
|
||||
private fun setVisibilities(
|
||||
securityFooterVisible: Boolean,
|
||||
fgsFooterVisible: Boolean,
|
||||
listener: VisibilityChangedDispatcher.OnVisibilityChangedListener
|
||||
) {
|
||||
securityFooter.visibility = if (securityFooterVisible) View.VISIBLE else View.GONE
|
||||
listener.onVisibilityChanged(securityFooter.visibility)
|
||||
fgsFooter.visibility = if (fgsFooterVisible) View.VISIBLE else View.GONE
|
||||
listener.onVisibilityChanged(fgsFooter.visibility)
|
||||
}
|
||||
|
||||
private fun inflateView(): FooterActionsView {
|
||||
return LayoutInflater.from(context)
|
||||
.inflate(R.layout.footer_actions, null) as FooterActionsView
|
||||
@@ -208,6 +305,6 @@ class FooterActionsControllerTest : LeakCheckedTest() {
|
||||
activityStarter, userManager, userTracker, userInfoController,
|
||||
deviceProvisionedController, securityFooterController, fgsManagerController,
|
||||
falsingManager, metricsLogger, globalActionsDialogProvider, uiEventLogger,
|
||||
showPMLiteButton = true, fakeSettings, Handler(testableLooper.looper), featureFlags)
|
||||
showPMLiteButton = true, fakeSettings, Handler(testableLooper.looper))
|
||||
}
|
||||
}
|
||||
@@ -59,22 +59,14 @@ class QSContainerImplTest : SysuiTestCase() {
|
||||
fun testContainerBottomPadding() {
|
||||
qsContainer.updateResources(
|
||||
qsPanelController,
|
||||
quickStatusBarHeaderController,
|
||||
/* newFooter */ false
|
||||
)
|
||||
verify(qsPanelContainer).setPaddingRelative(anyInt(), anyInt(), anyInt(), eq(0))
|
||||
|
||||
qsContainer.updateResources(
|
||||
qsPanelController,
|
||||
quickStatusBarHeaderController,
|
||||
/* newFooter */ true
|
||||
quickStatusBarHeaderController
|
||||
)
|
||||
verify(qsPanelContainer)
|
||||
.setPaddingRelative(
|
||||
anyInt(),
|
||||
anyInt(),
|
||||
anyInt(),
|
||||
eq(mContext.resources.getDimensionPixelSize(R.dimen.new_footer_height))
|
||||
eq(mContext.resources.getDimensionPixelSize(R.dimen.footer_actions_height))
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,6 @@ import com.android.internal.logging.MetricsLogger
|
||||
import com.android.internal.logging.UiEventLogger
|
||||
import com.android.systemui.SysuiTestCase
|
||||
import com.android.systemui.dump.DumpManager
|
||||
import com.android.systemui.flags.FeatureFlags
|
||||
import com.android.systemui.media.MediaHost
|
||||
import com.android.systemui.media.MediaHostState
|
||||
import com.android.systemui.plugins.FalsingManager
|
||||
@@ -35,8 +34,6 @@ import org.mockito.Mockito.`when` as whenever
|
||||
class QSPanelControllerTest : SysuiTestCase() {
|
||||
|
||||
@Mock private lateinit var qsPanel: QSPanel
|
||||
@Mock private lateinit var qsFgsManagerFooter: QSFgsManagerFooter
|
||||
@Mock private lateinit var qsSecurityFooter: QSSecurityFooter
|
||||
@Mock private lateinit var tunerService: TunerService
|
||||
@Mock private lateinit var qsTileHost: QSTileHost
|
||||
@Mock private lateinit var qsCustomizerController: QSCustomizerController
|
||||
@@ -50,7 +47,6 @@ class QSPanelControllerTest : SysuiTestCase() {
|
||||
@Mock private lateinit var brightnessSlider: BrightnessSliderController
|
||||
@Mock private lateinit var brightnessSliderFactory: BrightnessSliderController.Factory
|
||||
@Mock private lateinit var falsingManager: FalsingManager
|
||||
@Mock private lateinit var featureFlags: FeatureFlags
|
||||
@Mock private lateinit var mediaHost: MediaHost
|
||||
@Mock private lateinit var tile: QSTile
|
||||
@Mock private lateinit var otherTile: QSTile
|
||||
@@ -69,8 +65,6 @@ class QSPanelControllerTest : SysuiTestCase() {
|
||||
|
||||
controller = QSPanelController(
|
||||
qsPanel,
|
||||
qsFgsManagerFooter,
|
||||
qsSecurityFooter,
|
||||
tunerService,
|
||||
qsTileHost,
|
||||
qsCustomizerController,
|
||||
@@ -84,7 +78,6 @@ class QSPanelControllerTest : SysuiTestCase() {
|
||||
brightnessControllerFactory,
|
||||
brightnessSliderFactory,
|
||||
falsingManager,
|
||||
featureFlags,
|
||||
statusBarKeyguardViewManager
|
||||
)
|
||||
}
|
||||
|
||||
@@ -13,9 +13,6 @@
|
||||
*/
|
||||
package com.android.systemui.qs
|
||||
|
||||
import android.content.res.Configuration
|
||||
import android.content.res.Configuration.ORIENTATION_LANDSCAPE
|
||||
import android.content.res.Configuration.ORIENTATION_PORTRAIT
|
||||
import android.testing.AndroidTestingRunner
|
||||
import android.testing.TestableLooper
|
||||
import android.testing.TestableLooper.RunWithLooper
|
||||
@@ -59,8 +56,6 @@ class QSPanelTest : SysuiTestCase() {
|
||||
mFooter = LinearLayout(mContext).apply { id = R.id.qs_footer }
|
||||
mQsPanel.addView(mFooter)
|
||||
mQsPanel.onFinishInflate()
|
||||
mQsPanel.setSecurityFooter(View(mContext), false)
|
||||
mQsPanel.setHeaderContainer(LinearLayout(mContext))
|
||||
// Provides a parent with non-zero size for QSPanel
|
||||
mParentView = FrameLayout(mContext).apply {
|
||||
addView(mQsPanel)
|
||||
@@ -68,49 +63,6 @@ class QSPanelTest : SysuiTestCase() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testSecurityFooter_appearsOnBottomOnSplitShade() {
|
||||
mQsPanel.onConfigurationChanged(getNewOrientationConfig(ORIENTATION_LANDSCAPE))
|
||||
mQsPanel.switchSecurityFooter(true)
|
||||
|
||||
mTestableLooper.runWithLooper {
|
||||
mQsPanel.isExpanded = true
|
||||
}
|
||||
|
||||
// After mFooter
|
||||
assertThat(mQsPanel.indexOfChild(mQsPanel.mSecurityFooter)).isEqualTo(
|
||||
mQsPanel.indexOfChild(mFooter) + 1
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testSecurityFooter_appearsOnBottomIfPortrait() {
|
||||
mQsPanel.onConfigurationChanged(getNewOrientationConfig(ORIENTATION_PORTRAIT))
|
||||
mQsPanel.switchSecurityFooter(false)
|
||||
|
||||
mTestableLooper.runWithLooper {
|
||||
mQsPanel.isExpanded = true
|
||||
}
|
||||
|
||||
// After mFooter
|
||||
assertThat(mQsPanel.indexOfChild(mQsPanel.mSecurityFooter)).isEqualTo(
|
||||
mQsPanel.indexOfChild(mFooter) + 1
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testSecurityFooter_appearsOnTopIfSmallScreenAndLandscape() {
|
||||
mQsPanel.onConfigurationChanged(getNewOrientationConfig(ORIENTATION_LANDSCAPE))
|
||||
mQsPanel.switchSecurityFooter(false)
|
||||
|
||||
mTestableLooper.runWithLooper {
|
||||
mQsPanel.isExpanded = true
|
||||
}
|
||||
|
||||
// -1 means that it is part of the mHeaderContainer
|
||||
assertThat(mQsPanel.indexOfChild(mQsPanel.mSecurityFooter)).isEqualTo(-1)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testHasCollapseAccessibilityAction() {
|
||||
val info = AccessibilityNodeInfo(mQsPanel)
|
||||
@@ -128,7 +80,4 @@ class QSPanelTest : SysuiTestCase() {
|
||||
mQsPanel.performAccessibilityAction(AccessibilityNodeInfo.ACTION_COLLAPSE, null)
|
||||
verify(mockRunnable).run()
|
||||
}
|
||||
|
||||
private fun getNewOrientationConfig(@Configuration.Orientation newOrientation: Int) =
|
||||
context.resources.configuration.apply { orientation = newOrientation }
|
||||
}
|
||||
|
||||
@@ -2,11 +2,9 @@ package com.android.systemui.qs
|
||||
|
||||
import android.testing.AndroidTestingRunner
|
||||
import android.testing.TestableLooper
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.accessibility.AccessibilityNodeInfo
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.LinearLayout
|
||||
import androidx.test.filters.SmallTest
|
||||
import com.android.systemui.SysuiTestCase
|
||||
import com.google.common.truth.Truth
|
||||
@@ -37,8 +35,6 @@ class QuickQSPanelTest : SysuiTestCase() {
|
||||
quickQSPanel.initialize()
|
||||
|
||||
quickQSPanel.onFinishInflate()
|
||||
quickQSPanel.setSecurityFooter(View(mContext), false)
|
||||
quickQSPanel.setHeaderContainer(LinearLayout(mContext))
|
||||
// Provides a parent with non-zero size for QSPanel
|
||||
parentView = FrameLayout(mContext).apply {
|
||||
addView(quickQSPanel)
|
||||
|
||||
@@ -13,7 +13,6 @@ import androidx.test.filters.SmallTest
|
||||
import com.android.systemui.R
|
||||
import com.android.systemui.SysuiTestCase
|
||||
import com.android.systemui.flags.FeatureFlags
|
||||
import com.android.systemui.flags.Flags
|
||||
import com.android.systemui.navigationbar.NavigationModeController
|
||||
import com.android.systemui.navigationbar.NavigationModeController.ModeChangedListener
|
||||
import com.android.systemui.recents.OverviewProxyService
|
||||
@@ -114,25 +113,6 @@ class NotificationQSContainerControllerTest : SysuiTestCase() {
|
||||
@Test
|
||||
fun testTaskbarVisibleInSplitShade() {
|
||||
enableSplitShade()
|
||||
useNewFooter(false)
|
||||
|
||||
given(taskbarVisible = true,
|
||||
navigationMode = GESTURES_NAVIGATION,
|
||||
insets = windowInsets().withStableBottom())
|
||||
then(expectedContainerPadding = 0, // taskbar should disappear when shade is expanded
|
||||
expectedNotificationsMargin = NOTIFICATIONS_MARGIN)
|
||||
|
||||
given(taskbarVisible = true,
|
||||
navigationMode = BUTTONS_NAVIGATION,
|
||||
insets = windowInsets().withStableBottom())
|
||||
then(expectedContainerPadding = STABLE_INSET_BOTTOM,
|
||||
expectedNotificationsMargin = NOTIFICATIONS_MARGIN)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testTaskbarVisibleInSplitShade_newFooter() {
|
||||
enableSplitShade()
|
||||
useNewFooter(true)
|
||||
|
||||
given(taskbarVisible = true,
|
||||
navigationMode = GESTURES_NAVIGATION,
|
||||
@@ -153,25 +133,6 @@ class NotificationQSContainerControllerTest : SysuiTestCase() {
|
||||
fun testTaskbarNotVisibleInSplitShade() {
|
||||
// when taskbar is not visible, it means we're on the home screen
|
||||
enableSplitShade()
|
||||
useNewFooter(false)
|
||||
|
||||
given(taskbarVisible = false,
|
||||
navigationMode = GESTURES_NAVIGATION,
|
||||
insets = windowInsets().withStableBottom())
|
||||
then(expectedContainerPadding = 0)
|
||||
|
||||
given(taskbarVisible = false,
|
||||
navigationMode = BUTTONS_NAVIGATION,
|
||||
insets = windowInsets().withStableBottom())
|
||||
then(expectedContainerPadding = 0, // qs goes full height as it's not obscuring nav buttons
|
||||
expectedNotificationsMargin = STABLE_INSET_BOTTOM + NOTIFICATIONS_MARGIN)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testTaskbarNotVisibleInSplitShade_newFooter() {
|
||||
// when taskbar is not visible, it means we're on the home screen
|
||||
enableSplitShade()
|
||||
useNewFooter(true)
|
||||
|
||||
given(taskbarVisible = false,
|
||||
navigationMode = GESTURES_NAVIGATION,
|
||||
@@ -190,24 +151,6 @@ class NotificationQSContainerControllerTest : SysuiTestCase() {
|
||||
@Test
|
||||
fun testTaskbarNotVisibleInSplitShadeWithCutout() {
|
||||
enableSplitShade()
|
||||
useNewFooter(false)
|
||||
|
||||
given(taskbarVisible = false,
|
||||
navigationMode = GESTURES_NAVIGATION,
|
||||
insets = windowInsets().withCutout())
|
||||
then(expectedContainerPadding = CUTOUT_HEIGHT)
|
||||
|
||||
given(taskbarVisible = false,
|
||||
navigationMode = BUTTONS_NAVIGATION,
|
||||
insets = windowInsets().withCutout().withStableBottom())
|
||||
then(expectedContainerPadding = 0,
|
||||
expectedNotificationsMargin = STABLE_INSET_BOTTOM + NOTIFICATIONS_MARGIN)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testTaskbarNotVisibleInSplitShadeWithCutout_newFooter() {
|
||||
enableSplitShade()
|
||||
useNewFooter(true)
|
||||
|
||||
given(taskbarVisible = false,
|
||||
navigationMode = GESTURES_NAVIGATION,
|
||||
@@ -226,23 +169,6 @@ class NotificationQSContainerControllerTest : SysuiTestCase() {
|
||||
@Test
|
||||
fun testTaskbarVisibleInSinglePaneShade() {
|
||||
disableSplitShade()
|
||||
useNewFooter(false)
|
||||
|
||||
given(taskbarVisible = true,
|
||||
navigationMode = GESTURES_NAVIGATION,
|
||||
insets = windowInsets().withStableBottom())
|
||||
then(expectedContainerPadding = 0)
|
||||
|
||||
given(taskbarVisible = true,
|
||||
navigationMode = BUTTONS_NAVIGATION,
|
||||
insets = windowInsets().withStableBottom())
|
||||
then(expectedContainerPadding = STABLE_INSET_BOTTOM)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testTaskbarVisibleInSinglePaneShade_newFooter() {
|
||||
disableSplitShade()
|
||||
useNewFooter(true)
|
||||
|
||||
given(taskbarVisible = true,
|
||||
navigationMode = GESTURES_NAVIGATION,
|
||||
@@ -260,28 +186,6 @@ class NotificationQSContainerControllerTest : SysuiTestCase() {
|
||||
@Test
|
||||
fun testTaskbarNotVisibleInSinglePaneShade() {
|
||||
disableSplitShade()
|
||||
useNewFooter(false)
|
||||
|
||||
given(taskbarVisible = false,
|
||||
navigationMode = GESTURES_NAVIGATION,
|
||||
insets = emptyInsets())
|
||||
then(expectedContainerPadding = 0)
|
||||
|
||||
given(taskbarVisible = false,
|
||||
navigationMode = GESTURES_NAVIGATION,
|
||||
insets = windowInsets().withCutout().withStableBottom())
|
||||
then(expectedContainerPadding = CUTOUT_HEIGHT)
|
||||
|
||||
given(taskbarVisible = false,
|
||||
navigationMode = BUTTONS_NAVIGATION,
|
||||
insets = windowInsets().withStableBottom())
|
||||
then(expectedContainerPadding = 0, expectedQsPadding = STABLE_INSET_BOTTOM)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testTaskbarNotVisibleInSinglePaneShade_newFooter() {
|
||||
disableSplitShade()
|
||||
useNewFooter(true)
|
||||
|
||||
given(taskbarVisible = false,
|
||||
navigationMode = GESTURES_NAVIGATION,
|
||||
@@ -303,27 +207,6 @@ class NotificationQSContainerControllerTest : SysuiTestCase() {
|
||||
fun testCustomizingInSinglePaneShade() {
|
||||
disableSplitShade()
|
||||
controller.setCustomizerShowing(true)
|
||||
useNewFooter(false)
|
||||
|
||||
// always sets spacings to 0
|
||||
given(taskbarVisible = false,
|
||||
navigationMode = GESTURES_NAVIGATION,
|
||||
insets = windowInsets().withStableBottom())
|
||||
then(expectedContainerPadding = 0,
|
||||
expectedNotificationsMargin = 0)
|
||||
|
||||
given(taskbarVisible = false,
|
||||
navigationMode = BUTTONS_NAVIGATION,
|
||||
insets = emptyInsets())
|
||||
then(expectedContainerPadding = 0,
|
||||
expectedNotificationsMargin = 0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testCustomizingInSinglePaneShade_newFooter() {
|
||||
disableSplitShade()
|
||||
controller.setCustomizerShowing(true)
|
||||
useNewFooter(true)
|
||||
|
||||
// always sets spacings to 0
|
||||
given(taskbarVisible = false,
|
||||
@@ -343,27 +226,6 @@ class NotificationQSContainerControllerTest : SysuiTestCase() {
|
||||
fun testDetailShowingInSinglePaneShade() {
|
||||
disableSplitShade()
|
||||
controller.setDetailShowing(true)
|
||||
useNewFooter(false)
|
||||
|
||||
// always sets spacings to 0
|
||||
given(taskbarVisible = false,
|
||||
navigationMode = GESTURES_NAVIGATION,
|
||||
insets = windowInsets().withStableBottom())
|
||||
then(expectedContainerPadding = 0,
|
||||
expectedNotificationsMargin = 0)
|
||||
|
||||
given(taskbarVisible = false,
|
||||
navigationMode = BUTTONS_NAVIGATION,
|
||||
insets = emptyInsets())
|
||||
then(expectedContainerPadding = 0,
|
||||
expectedNotificationsMargin = 0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testDetailShowingInSinglePaneShade_newFooter() {
|
||||
disableSplitShade()
|
||||
controller.setDetailShowing(true)
|
||||
useNewFooter(true)
|
||||
|
||||
// always sets spacings to 0
|
||||
given(taskbarVisible = false,
|
||||
@@ -383,25 +245,6 @@ class NotificationQSContainerControllerTest : SysuiTestCase() {
|
||||
fun testDetailShowingInSplitShade() {
|
||||
enableSplitShade()
|
||||
controller.setDetailShowing(true)
|
||||
useNewFooter(false)
|
||||
|
||||
given(taskbarVisible = false,
|
||||
navigationMode = GESTURES_NAVIGATION,
|
||||
insets = windowInsets().withStableBottom())
|
||||
then(expectedContainerPadding = 0)
|
||||
|
||||
// should not influence spacing
|
||||
given(taskbarVisible = false,
|
||||
navigationMode = BUTTONS_NAVIGATION,
|
||||
insets = emptyInsets())
|
||||
then(expectedContainerPadding = 0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testDetailShowingInSplitShade_newFooter() {
|
||||
enableSplitShade()
|
||||
controller.setDetailShowing(true)
|
||||
useNewFooter(true)
|
||||
|
||||
given(taskbarVisible = false,
|
||||
navigationMode = GESTURES_NAVIGATION,
|
||||
@@ -531,7 +374,6 @@ class NotificationQSContainerControllerTest : SysuiTestCase() {
|
||||
@Test
|
||||
fun testWindowInsetDebounce() {
|
||||
disableSplitShade()
|
||||
useNewFooter(true)
|
||||
|
||||
given(taskbarVisible = false,
|
||||
navigationMode = GESTURES_NAVIGATION,
|
||||
@@ -596,13 +438,8 @@ class NotificationQSContainerControllerTest : SysuiTestCase() {
|
||||
verify(notificationsQSContainer)
|
||||
.setPadding(anyInt(), anyInt(), anyInt(), eq(expectedContainerPadding))
|
||||
verify(notificationsQSContainer).setNotificationsMarginBottom(expectedNotificationsMargin)
|
||||
val newFooter = featureFlags.isEnabled(Flags.NEW_FOOTER)
|
||||
if (newFooter) {
|
||||
verify(notificationsQSContainer)
|
||||
verify(notificationsQSContainer)
|
||||
.setQSContainerPaddingBottom(expectedQsPadding)
|
||||
} else {
|
||||
verify(notificationsQSContainer).setQSScrollPaddingBottom(expectedQsPadding)
|
||||
}
|
||||
Mockito.clearInvocations(notificationsQSContainer)
|
||||
}
|
||||
|
||||
@@ -620,10 +457,6 @@ class NotificationQSContainerControllerTest : SysuiTestCase() {
|
||||
return this
|
||||
}
|
||||
|
||||
private fun useNewFooter(useNewFooter: Boolean) {
|
||||
whenever(featureFlags.isEnabled(Flags.NEW_FOOTER)).thenReturn(useNewFooter)
|
||||
}
|
||||
|
||||
private fun getConstraintSetLayout(@IdRes id: Int): ConstraintSet.Layout {
|
||||
return constraintSetCaptor.value.getConstraint(id).layout
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user