Merge "Finish removing NEW_FOOTER flag" into tm-dev am: 28b4f74b80 am: 676f86c807
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17407522 Change-Id: I657a47caa79709bbf912a2c29d73ec559e54b8b6 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -16,8 +16,9 @@
|
|||||||
-->
|
-->
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
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_height="@dimen/qs_security_footer_single_line_height"
|
||||||
|
android:layout_weight="1"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
@@ -26,7 +27,7 @@
|
|||||||
android:id="@+id/fgs_text_container"
|
android:id="@+id/fgs_text_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="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:background="@drawable/qs_security_footer_background"
|
||||||
android:layout_gravity="end"
|
android:layout_gravity="end"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
@@ -86,7 +87,7 @@
|
|||||||
android:layout_height="12dp"
|
android:layout_height="12dp"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
android:layout_gravity="bottom|end"
|
android:layout_gravity="bottom|end"
|
||||||
android:src="@drawable/new_fgs_dot"
|
android:src="@drawable/fgs_dot"
|
||||||
android:contentDescription="@string/fgs_dot_content_description"
|
android:contentDescription="@string/fgs_dot_content_description"
|
||||||
/>
|
/>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?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");
|
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
** you may not use this file except in compliance with 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 -->
|
<!-- Action buttons for footer in QS/QQS, containing settings button, power off button etc -->
|
||||||
<com.android.systemui.qs.FooterActionsView
|
<com.android.systemui.qs.FooterActionsView
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
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_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:gravity="center_vertical"
|
||||||
android:layout_gravity="bottom"
|
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/qs_footer_action_inset_negative"
|
||||||
|
>
|
||||||
|
|
||||||
<com.android.systemui.statusbar.phone.MultiUserSwitch
|
<com.android.systemui.statusbar.phone.MultiUserSwitch
|
||||||
android:id="@+id/multi_user_switch"
|
android:id="@+id/multi_user_switch"
|
||||||
android:layout_width="0dp"
|
android:layout_width="@dimen/qs_footer_action_button_size"
|
||||||
android:layout_height="@dimen/qs_footer_action_button_size"
|
android:layout_height="@dimen/qs_footer_action_button_size"
|
||||||
android:layout_marginEnd="@dimen/qs_tile_margin_horizontal"
|
android:background="@drawable/qs_footer_action_circle"
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@drawable/qs_footer_action_chip_background"
|
|
||||||
android:focusable="true">
|
android:focusable="true">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/multi_user_avatar"
|
android:id="@+id/multi_user_avatar"
|
||||||
android:layout_width="@dimen/multi_user_avatar_expanded_size"
|
android:layout_width="@dimen/qs_footer_icon_size"
|
||||||
android:layout_height="@dimen/multi_user_avatar_expanded_size"
|
android:layout_height="@dimen/qs_footer_icon_size"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:scaleType="centerInside" />
|
android:scaleType="centerInside" />
|
||||||
</com.android.systemui.statusbar.phone.MultiUserSwitch>
|
</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
|
<com.android.systemui.statusbar.AlphaOptimizedFrameLayout
|
||||||
android:id="@+id/settings_button_container"
|
android:id="@+id/settings_button_container"
|
||||||
android:layout_width="0dp"
|
android:layout_width="@dimen/qs_footer_action_button_size"
|
||||||
android:layout_height="@dimen/qs_footer_action_button_size"
|
android:layout_height="@dimen/qs_footer_action_button_size"
|
||||||
android:background="@drawable/qs_footer_action_chip_background"
|
android:background="@drawable/qs_footer_action_circle"
|
||||||
android:layout_weight="1"
|
|
||||||
android:clipChildren="false"
|
android:clipChildren="false"
|
||||||
android:clipToPadding="false">
|
android:clipToPadding="false">
|
||||||
|
|
||||||
<com.android.systemui.statusbar.phone.SettingsButton
|
<com.android.systemui.statusbar.phone.SettingsButton
|
||||||
android:id="@+id/settings_button"
|
android:id="@+id/settings_button"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="@dimen/qs_footer_icon_size"
|
||||||
android:layout_height="@dimen/qs_footer_action_button_size"
|
android:layout_height="@dimen/qs_footer_icon_size"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
|
android:background="@android:color/transparent"
|
||||||
android:contentDescription="@string/accessibility_quick_settings_settings"
|
android:contentDescription="@string/accessibility_quick_settings_settings"
|
||||||
android:background="@drawable/qs_footer_action_chip_background_borderless"
|
|
||||||
android:padding="@dimen/qs_footer_icon_padding"
|
|
||||||
android:scaleType="centerInside"
|
android:scaleType="centerInside"
|
||||||
android:src="@drawable/ic_settings"
|
android:src="@drawable/ic_settings"
|
||||||
android:tint="?android:attr/textColorPrimary" />
|
android:tint="?android:attr/textColorPrimary" />
|
||||||
|
|
||||||
</com.android.systemui.statusbar.AlphaOptimizedFrameLayout>
|
</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>
|
</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.
|
~ limitations under the License.
|
||||||
-->
|
-->
|
||||||
<inset xmlns:android="http://schemas.android.com/apk/res/android"
|
<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
|
<ripple
|
||||||
android:color="?android:attr/colorControlHighlight">
|
android:color="?android:attr/colorControlHighlight">
|
||||||
<item android:id="@android:id/mask">
|
<item android:id="@android:id/mask">
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
~ limitations under the License.
|
~ limitations under the License.
|
||||||
-->
|
-->
|
||||||
<inset xmlns:android="http://schemas.android.com/apk/res/android"
|
<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
|
<ripple
|
||||||
android:color="?android:attr/colorControlHighlight">
|
android:color="?android:attr/colorControlHighlight">
|
||||||
<item android:id="@android:id/mask">
|
<item android:id="@android:id/mask">
|
||||||
|
|||||||
@@ -29,11 +29,6 @@
|
|||||||
android:clipChildren="false"
|
android:clipChildren="false"
|
||||||
android:clipToPadding="false">
|
android:clipToPadding="false">
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/qs_footer_height"
|
android:layout_height="@dimen/qs_footer_height"
|
||||||
@@ -80,14 +75,4 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</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>
|
</com.android.systemui.qs.QSFooterView>
|
||||||
|
|||||||
@@ -47,11 +47,10 @@
|
|||||||
|
|
||||||
<include layout="@layout/quick_status_bar_expanded_header" />
|
<include layout="@layout/quick_status_bar_expanded_header" />
|
||||||
|
|
||||||
<ViewStub
|
<include
|
||||||
android:id="@+id/container_stub"
|
layout="@layout/footer_actions"
|
||||||
android:inflatedId="@+id/qs_footer_actions"
|
android:id="@+id/qs_footer_actions"
|
||||||
android:layout="@layout/new_footer_actions"
|
android:layout_height="@dimen/footer_actions_height"
|
||||||
android:layout_height="@dimen/new_footer_height"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -14,19 +14,18 @@
|
|||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
<com.android.systemui.util.DualHeightHorizontalLinearLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:systemui="http://schemas.android.com/apk/res-auto"
|
android:layout_width="0dp"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="@dimen/qs_security_footer_single_line_height"
|
||||||
android:layout_height="@dimen/qs_security_footer_height"
|
android:layout_weight="1"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:padding="@dimen/qs_footer_padding"
|
android:orientation="horizontal"
|
||||||
|
android:paddingHorizontal="@dimen/qs_footer_padding"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:layout_gravity="center_vertical|center_horizontal"
|
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"
|
android:background="@drawable/qs_security_footer_background"
|
||||||
systemui:singleLineHeight="@dimen/qs_security_footer_single_line_height"
|
|
||||||
systemui:textViewId="@id/footer_text"
|
|
||||||
>
|
>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -43,7 +42,7 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:maxLines="@integer/qs_security_footer_maxLines"
|
android:singleLine="true"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:textAppearance="@style/TextAppearance.QS.SecurityFooter"
|
android:textAppearance="@style/TextAppearance.QS.SecurityFooter"
|
||||||
android:textColor="?android:attr/textColorSecondary"/>
|
android:textColor="?android:attr/textColorSecondary"/>
|
||||||
@@ -58,4 +57,4 @@
|
|||||||
android:autoMirrored="true"
|
android:autoMirrored="true"
|
||||||
android:tint="?android:attr/textColorSecondary" />
|
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
|
<!-- We want this to be centered (to align with notches). In order to do that, the following
|
||||||
has to hold (in portrait):
|
has to hold (in portrait):
|
||||||
* date_container and privacy_container must have the same width and weight
|
* date_container and privacy_container must have the same width and weight
|
||||||
* header_text_container must be gone
|
|
||||||
-->
|
-->
|
||||||
<android.widget.Space
|
<android.widget.Space
|
||||||
android:id="@+id/space"
|
android:id="@+id/space"
|
||||||
@@ -61,17 +60,6 @@
|
|||||||
android:layout_gravity="center_vertical|center_horizontal"
|
android:layout_gravity="center_vertical|center_horizontal"
|
||||||
android:visibility="gone" />
|
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
|
<FrameLayout
|
||||||
android:id="@+id/privacy_container"
|
android:id="@+id/privacy_container"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
|||||||
@@ -188,12 +188,6 @@
|
|||||||
<attr name="borderColor" format="color" />
|
<attr name="borderColor" format="color" />
|
||||||
</declare-styleable>
|
</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" />
|
<attr name="overlayButtonTextColor" format="color" />
|
||||||
|
|
||||||
<declare-styleable name="DreamOverlayDotImageView">
|
<declare-styleable name="DreamOverlayDotImageView">
|
||||||
|
|||||||
@@ -327,23 +327,20 @@
|
|||||||
car setting. -->
|
car setting. -->
|
||||||
<dimen name="car_qs_header_system_icons_area_height">54dp</dimen>
|
<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,
|
<!-- The height of the quick settings footer that holds the pagination dots and edit button -->
|
||||||
etc. -->
|
|
||||||
<dimen name="qs_footer_height">48dp</dimen>
|
<dimen name="qs_footer_height">48dp</dimen>
|
||||||
|
|
||||||
<!-- 40dp (circles) + 8dp (circle padding) + 8dp (top) + 4dp (bottom) -->
|
<!-- 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 -->
|
<!-- 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_button_size">48dp</dimen>
|
||||||
|
|
||||||
<dimen name="qs_footer_action_corner_radius">20dp</dimen>
|
<dimen name="qs_footer_action_corner_radius">20dp</dimen>
|
||||||
|
|
||||||
<!-- (48dp - 44dp) / 2 -->
|
|
||||||
<dimen name="qs_footer_action_inset">2dp</dimen>
|
|
||||||
<!-- (48dp - 40dp) / 2 -->
|
<!-- (48dp - 40dp) / 2 -->
|
||||||
<dimen name="new_qs_footer_action_inset">4dp</dimen>
|
<dimen name="qs_footer_action_inset">4dp</dimen>
|
||||||
<dimen name="new_qs_footer_action_inset_negative">-4dp</dimen>
|
<dimen name="qs_footer_action_inset_negative">-4dp</dimen>
|
||||||
|
|
||||||
<!-- Margins on each side of QS Footer -->
|
<!-- Margins on each side of QS Footer -->
|
||||||
<dimen name="qs_footer_margin">2dp</dimen>
|
<dimen name="qs_footer_margin">2dp</dimen>
|
||||||
@@ -495,7 +492,7 @@
|
|||||||
<dimen name="qs_panel_padding">16dp</dimen>
|
<dimen name="qs_panel_padding">16dp</dimen>
|
||||||
<dimen name="qs_dual_tile_padding_horizontal">6dp</dimen>
|
<dimen name="qs_dual_tile_padding_horizontal">6dp</dimen>
|
||||||
<dimen name="qs_panel_elevation">4dp</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_panel_padding_top">48dp</dimen>
|
||||||
|
|
||||||
<dimen name="qs_data_usage_text_size">14sp</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 =
|
public static final ResourceBooleanFlag QS_USER_DETAIL_SHORTCUT =
|
||||||
new ResourceBooleanFlag(503, R.bool.flag_lockscreen_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_FOOTER = new BooleanFlag(504, true);
|
||||||
|
|
||||||
public static final BooleanFlag NEW_HEADER = new BooleanFlag(505, false);
|
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.provider.Settings.Global.USER_SWITCHER_ENABLED
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.LinearLayout
|
|
||||||
import androidx.annotation.VisibleForTesting
|
import androidx.annotation.VisibleForTesting
|
||||||
import com.android.internal.jank.InteractionJankMonitor
|
import com.android.internal.jank.InteractionJankMonitor
|
||||||
import com.android.internal.logging.MetricsLogger
|
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.keyguard.KeyguardUpdateMonitor
|
||||||
import com.android.systemui.R
|
import com.android.systemui.R
|
||||||
import com.android.systemui.animation.ActivityLaunchAnimator
|
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.globalactions.GlobalActionsDialogLite
|
||||||
import com.android.systemui.plugins.ActivityStarter
|
import com.android.systemui.plugins.ActivityStarter
|
||||||
import com.android.systemui.plugins.FalsingManager
|
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.DeviceProvisionedController
|
||||||
import com.android.systemui.statusbar.policy.UserInfoController
|
import com.android.systemui.statusbar.policy.UserInfoController
|
||||||
import com.android.systemui.statusbar.policy.UserInfoController.OnUserInfoChangedListener
|
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.ViewController
|
||||||
import com.android.systemui.util.settings.GlobalSettings
|
import com.android.systemui.util.settings.GlobalSettings
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
@@ -74,8 +70,7 @@ internal class FooterActionsController @Inject constructor(
|
|||||||
private val uiEventLogger: UiEventLogger,
|
private val uiEventLogger: UiEventLogger,
|
||||||
@Named(PM_LITE_ENABLED) private val showPMLiteButton: Boolean,
|
@Named(PM_LITE_ENABLED) private val showPMLiteButton: Boolean,
|
||||||
private val globalSetting: GlobalSettings,
|
private val globalSetting: GlobalSettings,
|
||||||
private val handler: Handler,
|
private val handler: Handler
|
||||||
private val featureFlags: FeatureFlags
|
|
||||||
) : ViewController<FooterActionsView>(view) {
|
) : ViewController<FooterActionsView>(view) {
|
||||||
|
|
||||||
private var globalActionsDialog: GlobalActionsDialogLite? = null
|
private var globalActionsDialog: GlobalActionsDialogLite? = null
|
||||||
@@ -100,7 +95,9 @@ internal class FooterActionsController @Inject constructor(
|
|||||||
view.findViewById(R.id.security_footers_container)
|
view.findViewById(R.id.security_footers_container)
|
||||||
private val powerMenuLite: View = view.findViewById(R.id.pm_lite)
|
private val powerMenuLite: View = view.findViewById(R.id.pm_lite)
|
||||||
private val multiUserSwitchController = multiUserSwitchControllerFactory.create(view)
|
private val multiUserSwitchController = multiUserSwitchControllerFactory.create(view)
|
||||||
private val securityFootersSeparator = View(context).apply {
|
|
||||||
|
@VisibleForTesting
|
||||||
|
internal val securityFootersSeparator = View(context).apply {
|
||||||
visibility = View.GONE
|
visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,24 +168,18 @@ internal class FooterActionsController @Inject constructor(
|
|||||||
}
|
}
|
||||||
settingsButton.setOnClickListener(onClickListener)
|
settingsButton.setOnClickListener(onClickListener)
|
||||||
multiUserSetting.isListening = true
|
multiUserSetting.isListening = true
|
||||||
if (featureFlags.isEnabled(Flags.NEW_FOOTER)) {
|
|
||||||
val securityFooter = securityFooterController.view as DualHeightHorizontalLinearLayout
|
val securityFooter = securityFooterController.view
|
||||||
securityFootersContainer?.addView(securityFooter)
|
securityFootersContainer?.addView(securityFooter)
|
||||||
val separatorWidth = resources.getDimensionPixelSize(R.dimen.new_qs_footer_action_inset)
|
val separatorWidth = resources.getDimensionPixelSize(R.dimen.qs_footer_action_inset)
|
||||||
securityFootersContainer?.addView(securityFootersSeparator, separatorWidth, 1)
|
securityFootersContainer?.addView(securityFootersSeparator, separatorWidth, 1)
|
||||||
reformatForNewFooter(securityFooter)
|
|
||||||
val fgsFooter = fgsManagerFooterController.view
|
val fgsFooter = fgsManagerFooterController.view
|
||||||
securityFootersContainer?.addView(fgsFooter)
|
securityFootersContainer?.addView(fgsFooter)
|
||||||
(fgsFooter.layoutParams as LinearLayout.LayoutParams).apply {
|
|
||||||
width = 0
|
|
||||||
weight = 1f
|
|
||||||
}
|
|
||||||
|
|
||||||
val visibilityListener =
|
val visibilityListener =
|
||||||
VisibilityChangedDispatcher.OnVisibilityChangedListener { visibility ->
|
VisibilityChangedDispatcher.OnVisibilityChangedListener { visibility ->
|
||||||
if (visibility == View.GONE) {
|
if (securityFooter.visibility == View.VISIBLE &&
|
||||||
securityFootersSeparator.visibility = View.GONE
|
|
||||||
} else if (securityFooter.visibility == View.VISIBLE &&
|
|
||||||
fgsFooter.visibility == View.VISIBLE) {
|
fgsFooter.visibility == View.VISIBLE) {
|
||||||
securityFootersSeparator.visibility = View.VISIBLE
|
securityFootersSeparator.visibility = View.VISIBLE
|
||||||
} else {
|
} else {
|
||||||
@@ -199,20 +190,8 @@ internal class FooterActionsController @Inject constructor(
|
|||||||
}
|
}
|
||||||
securityFooterController.setOnVisibilityChangedListener(visibilityListener)
|
securityFooterController.setOnVisibilityChangedListener(visibilityListener)
|
||||||
fgsManagerFooterController.setOnVisibilityChangedListener(visibilityListener)
|
fgsManagerFooterController.setOnVisibilityChangedListener(visibilityListener)
|
||||||
}
|
|
||||||
updateView()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun reformatForNewFooter(view: DualHeightHorizontalLinearLayout) {
|
updateView()
|
||||||
// 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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateView() {
|
private fun updateView() {
|
||||||
@@ -237,11 +216,10 @@ internal class FooterActionsController @Inject constructor(
|
|||||||
} else {
|
} else {
|
||||||
userInfoController.removeCallback(onUserInfoChangedListener)
|
userInfoController.removeCallback(onUserInfoChangedListener)
|
||||||
}
|
}
|
||||||
if (featureFlags.isEnabled(Flags.NEW_FOOTER)) {
|
|
||||||
fgsManagerFooterController.setListening(listening)
|
fgsManagerFooterController.setListening(listening)
|
||||||
securityFooterController.setListening(listening)
|
securityFooterController.setListening(listening)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fun disable(state2: Int) {
|
fun disable(state2: Int) {
|
||||||
mView.disable(state2, multiUserSwitchController.isMultiUserEnabled)
|
mView.disable(state2, multiUserSwitchController.isMultiUserEnabled)
|
||||||
|
|||||||
@@ -81,8 +81,6 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
|
|||||||
private final QSPanelController mQsPanelController;
|
private final QSPanelController mQsPanelController;
|
||||||
private final QuickQSPanelController mQuickQSPanelController;
|
private final QuickQSPanelController mQuickQSPanelController;
|
||||||
private final QuickStatusBarHeader mQuickStatusBarHeader;
|
private final QuickStatusBarHeader mQuickStatusBarHeader;
|
||||||
private final QSFgsManagerFooter mFgsManagerFooter;
|
|
||||||
private final QSSecurityFooter mSecurityFooter;
|
|
||||||
private final QS mQs;
|
private final QS mQs;
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@@ -105,7 +103,7 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
|
|||||||
private TouchAnimator mNonfirstPageAlphaAnimator;
|
private TouchAnimator mNonfirstPageAlphaAnimator;
|
||||||
// TranslatesY the QS Tile layout using QS.getHeightDiff()
|
// TranslatesY the QS Tile layout using QS.getHeightDiff()
|
||||||
private TouchAnimator mQSTileLayoutTranslatorAnimator;
|
private TouchAnimator mQSTileLayoutTranslatorAnimator;
|
||||||
// This animates fading of SecurityFooter and media divider
|
// This animates fading of media player
|
||||||
private TouchAnimator mAllPagesDelayedAnimator;
|
private TouchAnimator mAllPagesDelayedAnimator;
|
||||||
// Animator for brightness slider(s)
|
// Animator for brightness slider(s)
|
||||||
@Nullable
|
@Nullable
|
||||||
@@ -146,7 +144,6 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
|
|||||||
public QSAnimator(QS qs, QuickQSPanel quickPanel, QuickStatusBarHeader quickStatusBarHeader,
|
public QSAnimator(QS qs, QuickQSPanel quickPanel, QuickStatusBarHeader quickStatusBarHeader,
|
||||||
QSPanelController qsPanelController,
|
QSPanelController qsPanelController,
|
||||||
QuickQSPanelController quickQSPanelController, QSTileHost qsTileHost,
|
QuickQSPanelController quickQSPanelController, QSTileHost qsTileHost,
|
||||||
QSFgsManagerFooter fgsManagerFooter, QSSecurityFooter securityFooter,
|
|
||||||
@Main Executor executor, TunerService tunerService,
|
@Main Executor executor, TunerService tunerService,
|
||||||
QSExpansionPathInterpolator qsExpansionPathInterpolator) {
|
QSExpansionPathInterpolator qsExpansionPathInterpolator) {
|
||||||
mQs = qs;
|
mQs = qs;
|
||||||
@@ -154,8 +151,6 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
|
|||||||
mQsPanelController = qsPanelController;
|
mQsPanelController = qsPanelController;
|
||||||
mQuickQSPanelController = quickQSPanelController;
|
mQuickQSPanelController = quickQSPanelController;
|
||||||
mQuickStatusBarHeader = quickStatusBarHeader;
|
mQuickStatusBarHeader = quickStatusBarHeader;
|
||||||
mFgsManagerFooter = fgsManagerFooter;
|
|
||||||
mSecurityFooter = securityFooter;
|
|
||||||
mHost = qsTileHost;
|
mHost = qsTileHost;
|
||||||
mExecutor = executor;
|
mExecutor = executor;
|
||||||
mTunerService = tunerService;
|
mTunerService = tunerService;
|
||||||
@@ -472,10 +467,8 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
|
|||||||
.setListener(this)
|
.setListener(this)
|
||||||
.build();
|
.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 builder = new Builder().setStartDelay(EXPANDED_TILE_DELAY);
|
||||||
builder.addFloat(mFgsManagerFooter.getView(), "alpha", 0, 1);
|
|
||||||
builder.addFloat(mSecurityFooter.getView(), "alpha", 0, 1);
|
|
||||||
if (mQsPanelController.shouldUseHorizontalLayout()
|
if (mQsPanelController.shouldUseHorizontalLayout()
|
||||||
&& mQsPanelController.mMediaHost.hostView != null) {
|
&& mQsPanelController.mMediaHost.hostView != null) {
|
||||||
builder.addFloat(mQsPanelController.mMediaHost.hostView, "alpha", 0, 1);
|
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);
|
mQsPanelController.mMediaHost.hostView.setAlpha(1.0f);
|
||||||
}
|
}
|
||||||
mAllPagesDelayedAnimator = builder.build();
|
mAllPagesDelayedAnimator = builder.build();
|
||||||
mAllViews.add(mFgsManagerFooter.getView());
|
|
||||||
mAllViews.add(mSecurityFooter.getView());
|
|
||||||
translationYBuilder.setInterpolator(mQSExpansionPathInterpolator.getYInterpolator());
|
translationYBuilder.setInterpolator(mQSExpansionPathInterpolator.getYInterpolator());
|
||||||
qqsTranslationYBuilder.setInterpolator(mQSExpansionPathInterpolator.getYInterpolator());
|
qqsTranslationYBuilder.setInterpolator(mQSExpansionPathInterpolator.getYInterpolator());
|
||||||
translationXBuilder.setInterpolator(mQSExpansionPathInterpolator.getXInterpolator());
|
translationXBuilder.setInterpolator(mQSExpansionPathInterpolator.getXInterpolator());
|
||||||
|
|||||||
@@ -138,12 +138,8 @@ public class QSContainerImpl extends FrameLayout implements Dumpable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void updateResources(QSPanelController qsPanelController,
|
void updateResources(QSPanelController qsPanelController,
|
||||||
QuickStatusBarHeaderController quickStatusBarHeaderController,
|
QuickStatusBarHeaderController quickStatusBarHeaderController) {
|
||||||
boolean newFooter) {
|
int bottomPadding = getResources().getDimensionPixelSize(R.dimen.qs_panel_padding_bottom);
|
||||||
int bottomPadding = 0;
|
|
||||||
if (newFooter) {
|
|
||||||
bottomPadding = getResources().getDimensionPixelSize(R.dimen.qs_panel_padding_bottom);
|
|
||||||
}
|
|
||||||
mQSPanelContainer.setPaddingRelative(
|
mQSPanelContainer.setPaddingRelative(
|
||||||
mQSPanelContainer.getPaddingStart(),
|
mQSPanelContainer.getPaddingStart(),
|
||||||
QSUtils.getQsHeaderSystemIconsAreaHeight(mContext),
|
QSUtils.getQsHeaderSystemIconsAreaHeight(mContext),
|
||||||
|
|||||||
@@ -18,8 +18,6 @@ package com.android.systemui.qs;
|
|||||||
|
|
||||||
import android.content.res.Configuration;
|
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.qs.dagger.QSScope;
|
||||||
import com.android.systemui.statusbar.policy.ConfigurationController;
|
import com.android.systemui.statusbar.policy.ConfigurationController;
|
||||||
import com.android.systemui.util.ViewController;
|
import com.android.systemui.util.ViewController;
|
||||||
@@ -32,26 +30,23 @@ public class QSContainerImplController extends ViewController<QSContainerImpl> {
|
|||||||
private final QSPanelController mQsPanelController;
|
private final QSPanelController mQsPanelController;
|
||||||
private final QuickStatusBarHeaderController mQuickStatusBarHeaderController;
|
private final QuickStatusBarHeaderController mQuickStatusBarHeaderController;
|
||||||
private final ConfigurationController mConfigurationController;
|
private final ConfigurationController mConfigurationController;
|
||||||
private final boolean mNewFooter;
|
|
||||||
|
|
||||||
private final ConfigurationController.ConfigurationListener mConfigurationListener =
|
private final ConfigurationController.ConfigurationListener mConfigurationListener =
|
||||||
new ConfigurationController.ConfigurationListener() {
|
new ConfigurationController.ConfigurationListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onConfigChanged(Configuration newConfig) {
|
public void onConfigChanged(Configuration newConfig) {
|
||||||
mView.updateResources(mQsPanelController, mQuickStatusBarHeaderController, mNewFooter);
|
mView.updateResources(mQsPanelController, mQuickStatusBarHeaderController);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
QSContainerImplController(QSContainerImpl view, QSPanelController qsPanelController,
|
QSContainerImplController(QSContainerImpl view, QSPanelController qsPanelController,
|
||||||
QuickStatusBarHeaderController quickStatusBarHeaderController,
|
QuickStatusBarHeaderController quickStatusBarHeaderController,
|
||||||
ConfigurationController configurationController,
|
ConfigurationController configurationController) {
|
||||||
FeatureFlags featureFlags) {
|
|
||||||
super(view);
|
super(view);
|
||||||
mQsPanelController = qsPanelController;
|
mQsPanelController = qsPanelController;
|
||||||
mQuickStatusBarHeaderController = quickStatusBarHeaderController;
|
mQuickStatusBarHeaderController = quickStatusBarHeaderController;
|
||||||
mConfigurationController = configurationController;
|
mConfigurationController = configurationController;
|
||||||
mNewFooter = featureFlags.isEnabled(Flags.NEW_FOOTER);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -65,7 +60,7 @@ public class QSContainerImplController extends ViewController<QSContainerImpl> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onViewAttached() {
|
protected void onViewAttached() {
|
||||||
mView.updateResources(mQsPanelController, mQuickStatusBarHeaderController, mNewFooter);
|
mView.updateResources(mQsPanelController, mQuickStatusBarHeaderController);
|
||||||
mConfigurationController.addCallback(mConfigurationListener);
|
mConfigurationController.addCallback(mConfigurationListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -211,7 +211,6 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
mHeader = view.findViewById(R.id.header);
|
mHeader = view.findViewById(R.id.header);
|
||||||
mQSPanelController.setHeaderContainer(view.findViewById(R.id.header_text_container));
|
|
||||||
mFooter = qsFragmentComponent.getQSFooter();
|
mFooter = qsFragmentComponent.getQSFooter();
|
||||||
|
|
||||||
mQSContainerImplController = qsFragmentComponent.getQSContainerImplController();
|
mQSContainerImplController = qsFragmentComponent.getQSContainerImplController();
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ public class QSPanel extends LinearLayout implements Tunable {
|
|||||||
@Nullable
|
@Nullable
|
||||||
protected BrightnessSliderController mToggleSliderController;
|
protected BrightnessSliderController mToggleSliderController;
|
||||||
|
|
||||||
private final H mHandler = new H();
|
|
||||||
/** Whether or not the QS media player feature is enabled. */
|
/** Whether or not the QS media player feature is enabled. */
|
||||||
protected boolean mUsingMediaPlayer;
|
protected boolean mUsingMediaPlayer;
|
||||||
|
|
||||||
@@ -86,16 +85,9 @@ public class QSPanel extends LinearLayout implements Tunable {
|
|||||||
private final List<OnConfigurationChangedListener> mOnConfigurationChangedListeners =
|
private final List<OnConfigurationChangedListener> mOnConfigurationChangedListeners =
|
||||||
new ArrayList<>();
|
new ArrayList<>();
|
||||||
|
|
||||||
@Nullable
|
|
||||||
protected View mFgsManagerFooter;
|
|
||||||
@Nullable
|
|
||||||
protected View mSecurityFooter;
|
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
protected View mFooter;
|
protected View mFooter;
|
||||||
|
|
||||||
@Nullable
|
|
||||||
private ViewGroup mHeaderContainer;
|
|
||||||
@Nullable
|
@Nullable
|
||||||
private PageIndicator mFooterPageIndicator;
|
private PageIndicator mFooterPageIndicator;
|
||||||
private int mContentMarginStart;
|
private int mContentMarginStart;
|
||||||
@@ -112,7 +104,6 @@ public class QSPanel extends LinearLayout implements Tunable {
|
|||||||
private float mSquishinessFraction = 1f;
|
private float mSquishinessFraction = 1f;
|
||||||
private final ArrayMap<View, Integer> mChildrenLayoutTop = new ArrayMap<>();
|
private final ArrayMap<View, Integer> mChildrenLayoutTop = new ArrayMap<>();
|
||||||
private final Rect mClippingRect = new Rect();
|
private final Rect mClippingRect = new Rect();
|
||||||
private boolean mUseNewFooter = false;
|
|
||||||
private ViewGroup mMediaHostView;
|
private ViewGroup mMediaHostView;
|
||||||
private boolean mShouldMoveMediaOnExpansion = true;
|
private boolean mShouldMoveMediaOnExpansion = true;
|
||||||
|
|
||||||
@@ -156,10 +147,6 @@ public class QSPanel extends LinearLayout implements Tunable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void setUseNewFooter(boolean useNewFooter) {
|
|
||||||
mUseNewFooter = useNewFooter;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void setHorizontalContentContainerClipping() {
|
protected void setHorizontalContentContainerClipping() {
|
||||||
mHorizontalContentContainer.setClipChildren(true);
|
mHorizontalContentContainer.setClipChildren(true);
|
||||||
mHorizontalContentContainer.setClipToPadding(false);
|
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) {
|
private void switchToParent(View child, ViewGroup parent, int index) {
|
||||||
switchToParent(child, parent, index, getDumpableTag());
|
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() {
|
public boolean isListening() {
|
||||||
return mListening;
|
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) {
|
protected void setPageMargin(int pageMargin) {
|
||||||
if (mTileLayout instanceof PagedTileLayout) {
|
if (mTileLayout instanceof PagedTileLayout) {
|
||||||
((PagedTileLayout) mTileLayout).setPageMargin(pageMargin);
|
((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.QSPanel.QS_SHOW_BRIGHTNESS;
|
||||||
import static com.android.systemui.qs.dagger.QSFragmentModule.QS_USING_MEDIA_PLAYER;
|
import static com.android.systemui.qs.dagger.QSFragmentModule.QS_USING_MEDIA_PLAYER;
|
||||||
|
|
||||||
import android.annotation.NonNull;
|
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
|
||||||
|
|
||||||
import com.android.internal.logging.MetricsLogger;
|
import com.android.internal.logging.MetricsLogger;
|
||||||
import com.android.internal.logging.UiEventLogger;
|
import com.android.internal.logging.UiEventLogger;
|
||||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||||
import com.android.systemui.dump.DumpManager;
|
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.MediaHierarchyManager;
|
||||||
import com.android.systemui.media.MediaHost;
|
import com.android.systemui.media.MediaHost;
|
||||||
import com.android.systemui.media.MediaHostState;
|
import com.android.systemui.media.MediaHostState;
|
||||||
@@ -56,8 +52,6 @@ import javax.inject.Named;
|
|||||||
@QSScope
|
@QSScope
|
||||||
public class QSPanelController extends QSPanelControllerBase<QSPanel> {
|
public class QSPanelController extends QSPanelControllerBase<QSPanel> {
|
||||||
|
|
||||||
private final QSFgsManagerFooter mQSFgsManagerFooter;
|
|
||||||
private final QSSecurityFooter mQsSecurityFooter;
|
|
||||||
private final TunerService mTunerService;
|
private final TunerService mTunerService;
|
||||||
private final QSCustomizerController mQsCustomizerController;
|
private final QSCustomizerController mQsCustomizerController;
|
||||||
private final QSTileRevealController.Factory mQsTileRevealControllerFactory;
|
private final QSTileRevealController.Factory mQsTileRevealControllerFactory;
|
||||||
@@ -65,7 +59,6 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
|
|||||||
private final BrightnessController mBrightnessController;
|
private final BrightnessController mBrightnessController;
|
||||||
private final BrightnessSliderController mBrightnessSliderController;
|
private final BrightnessSliderController mBrightnessSliderController;
|
||||||
private final BrightnessMirrorHandler mBrightnessMirrorHandler;
|
private final BrightnessMirrorHandler mBrightnessMirrorHandler;
|
||||||
private final FeatureFlags mFeatureFlags;
|
|
||||||
private final StatusBarKeyguardViewManager mStatusBarKeyguardViewManager;
|
private final StatusBarKeyguardViewManager mStatusBarKeyguardViewManager;
|
||||||
|
|
||||||
private boolean mGridContentVisible = true;
|
private boolean mGridContentVisible = true;
|
||||||
@@ -75,11 +68,9 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
|
|||||||
@Override
|
@Override
|
||||||
public void onConfigurationChange(Configuration newConfig) {
|
public void onConfigurationChange(Configuration newConfig) {
|
||||||
mView.updateResources();
|
mView.updateResources();
|
||||||
mQsSecurityFooter.onConfigurationChanged();
|
|
||||||
if (mView.isListening()) {
|
if (mView.isListening()) {
|
||||||
refreshAllTiles();
|
refreshAllTiles();
|
||||||
}
|
}
|
||||||
mView.switchSecurityFooter(mShouldUseSplitNotificationShade);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -94,8 +85,7 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
QSPanelController(QSPanel view, QSFgsManagerFooter qsFgsManagerFooter,
|
QSPanelController(QSPanel view, TunerService tunerService,
|
||||||
QSSecurityFooter qsSecurityFooter, TunerService tunerService,
|
|
||||||
QSTileHost qstileHost, QSCustomizerController qsCustomizerController,
|
QSTileHost qstileHost, QSCustomizerController qsCustomizerController,
|
||||||
@Named(QS_USING_MEDIA_PLAYER) boolean usingMediaPlayer,
|
@Named(QS_USING_MEDIA_PLAYER) boolean usingMediaPlayer,
|
||||||
@Named(QS_PANEL) MediaHost mediaHost,
|
@Named(QS_PANEL) MediaHost mediaHost,
|
||||||
@@ -103,12 +93,10 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
|
|||||||
DumpManager dumpManager, MetricsLogger metricsLogger, UiEventLogger uiEventLogger,
|
DumpManager dumpManager, MetricsLogger metricsLogger, UiEventLogger uiEventLogger,
|
||||||
QSLogger qsLogger, BrightnessController.Factory brightnessControllerFactory,
|
QSLogger qsLogger, BrightnessController.Factory brightnessControllerFactory,
|
||||||
BrightnessSliderController.Factory brightnessSliderFactory,
|
BrightnessSliderController.Factory brightnessSliderFactory,
|
||||||
FalsingManager falsingManager, FeatureFlags featureFlags,
|
FalsingManager falsingManager,
|
||||||
StatusBarKeyguardViewManager statusBarKeyguardViewManager) {
|
StatusBarKeyguardViewManager statusBarKeyguardViewManager) {
|
||||||
super(view, qstileHost, qsCustomizerController, usingMediaPlayer, mediaHost,
|
super(view, qstileHost, qsCustomizerController, usingMediaPlayer, mediaHost,
|
||||||
metricsLogger, uiEventLogger, qsLogger, dumpManager);
|
metricsLogger, uiEventLogger, qsLogger, dumpManager);
|
||||||
mQSFgsManagerFooter = qsFgsManagerFooter;
|
|
||||||
mQsSecurityFooter = qsSecurityFooter;
|
|
||||||
mTunerService = tunerService;
|
mTunerService = tunerService;
|
||||||
mQsCustomizerController = qsCustomizerController;
|
mQsCustomizerController = qsCustomizerController;
|
||||||
mQsTileRevealControllerFactory = qsTileRevealControllerFactory;
|
mQsTileRevealControllerFactory = qsTileRevealControllerFactory;
|
||||||
@@ -119,9 +107,7 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
|
|||||||
|
|
||||||
mBrightnessController = brightnessControllerFactory.create(mBrightnessSliderController);
|
mBrightnessController = brightnessControllerFactory.create(mBrightnessSliderController);
|
||||||
mBrightnessMirrorHandler = new BrightnessMirrorHandler(mBrightnessController);
|
mBrightnessMirrorHandler = new BrightnessMirrorHandler(mBrightnessController);
|
||||||
mFeatureFlags = featureFlags;
|
|
||||||
mStatusBarKeyguardViewManager = statusBarKeyguardViewManager;
|
mStatusBarKeyguardViewManager = statusBarKeyguardViewManager;
|
||||||
view.setUseNewFooter(featureFlags.isEnabled(Flags.NEW_FOOTER));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -132,7 +118,6 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
|
|||||||
mMediaHost.init(MediaHierarchyManager.LOCATION_QS);
|
mMediaHost.init(MediaHierarchyManager.LOCATION_QS);
|
||||||
mQsCustomizerController.init();
|
mQsCustomizerController.init();
|
||||||
mBrightnessSliderController.init();
|
mBrightnessSliderController.init();
|
||||||
mQSFgsManagerFooter.init();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -147,10 +132,6 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
|
|||||||
refreshAllTiles();
|
refreshAllTiles();
|
||||||
}
|
}
|
||||||
mView.addOnConfigurationChangedListener(mOnConfigurationChangedListener);
|
mView.addOnConfigurationChangedListener(mOnConfigurationChangedListener);
|
||||||
if (!mFeatureFlags.isEnabled(Flags.NEW_FOOTER)) {
|
|
||||||
mView.setSecurityFooter(mQsSecurityFooter.getView(), mShouldUseSplitNotificationShade);
|
|
||||||
mView.setFgsManagerFooter(mQSFgsManagerFooter.getView());
|
|
||||||
}
|
|
||||||
switchTileLayout(true);
|
switchTileLayout(true);
|
||||||
mBrightnessMirrorHandler.onQsPanelAttached();
|
mBrightnessMirrorHandler.onQsPanelAttached();
|
||||||
|
|
||||||
@@ -172,13 +153,6 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
|
|||||||
super.onViewDetached();
|
super.onViewDetached();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the header container of quick settings.
|
|
||||||
*/
|
|
||||||
public void setHeaderContainer(@NonNull ViewGroup headerContainer) {
|
|
||||||
mView.setHeaderContainer(headerContainer);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** */
|
/** */
|
||||||
public void setVisibility(int visibility) {
|
public void setVisibility(int visibility) {
|
||||||
mView.setVisibility(visibility);
|
mView.setVisibility(visibility);
|
||||||
@@ -191,11 +165,6 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
|
|||||||
refreshAllTiles();
|
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
|
// 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.
|
//expansion, so it will update the current brightness before the slider is visible.
|
||||||
if (listening) {
|
if (listening) {
|
||||||
@@ -224,8 +193,6 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
|
|||||||
public void refreshAllTiles() {
|
public void refreshAllTiles() {
|
||||||
mBrightnessController.checkRestrictionAndSetEnabled();
|
mBrightnessController.checkRestrictionAndSetEnabled();
|
||||||
super.refreshAllTiles();
|
super.refreshAllTiles();
|
||||||
mQSFgsManagerFooter.refreshState();
|
|
||||||
mQsSecurityFooter.refreshState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Start customizing the Quick Settings. */
|
/** Start customizing the Quick Settings. */
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ public class QuickStatusBarHeader extends FrameLayout {
|
|||||||
private View mDateView;
|
private View mDateView;
|
||||||
// DateView next to clock. Visible on QQS
|
// DateView next to clock. Visible on QQS
|
||||||
private VariableDateView mClockDateView;
|
private VariableDateView mClockDateView;
|
||||||
private View mSecurityHeaderView;
|
|
||||||
private View mStatusIconsView;
|
private View mStatusIconsView;
|
||||||
private View mContainer;
|
private View mContainer;
|
||||||
|
|
||||||
@@ -137,7 +136,6 @@ public class QuickStatusBarHeader extends FrameLayout {
|
|||||||
mPrivacyChip = findViewById(R.id.privacy_chip);
|
mPrivacyChip = findViewById(R.id.privacy_chip);
|
||||||
mDateView = findViewById(R.id.date);
|
mDateView = findViewById(R.id.date);
|
||||||
mClockDateView = findViewById(R.id.date_clock);
|
mClockDateView = findViewById(R.id.date_clock);
|
||||||
mSecurityHeaderView = findViewById(R.id.header_text_container);
|
|
||||||
mClockIconsSeparator = findViewById(R.id.separator);
|
mClockIconsSeparator = findViewById(R.id.separator);
|
||||||
mRightLayout = findViewById(R.id.rightLayout);
|
mRightLayout = findViewById(R.id.rightLayout);
|
||||||
mDateContainer = findViewById(R.id.date_container);
|
mDateContainer = findViewById(R.id.date_container);
|
||||||
@@ -152,8 +150,6 @@ public class QuickStatusBarHeader extends FrameLayout {
|
|||||||
updateResources();
|
updateResources();
|
||||||
Configuration config = mContext.getResources().getConfiguration();
|
Configuration config = mContext.getResources().getConfiguration();
|
||||||
setDatePrivacyContainersWidth(config.orientation == Configuration.ORIENTATION_LANDSCAPE);
|
setDatePrivacyContainersWidth(config.orientation == Configuration.ORIENTATION_LANDSCAPE);
|
||||||
setSecurityHeaderContainerVisibility(
|
|
||||||
config.orientation == Configuration.ORIENTATION_LANDSCAPE);
|
|
||||||
|
|
||||||
// QS will always show the estimate, and BatteryMeterView handles the case where
|
// QS will always show the estimate, and BatteryMeterView handles the case where
|
||||||
// it's unavailable or charging
|
// it's unavailable or charging
|
||||||
@@ -207,8 +203,6 @@ public class QuickStatusBarHeader extends FrameLayout {
|
|||||||
super.onConfigurationChanged(newConfig);
|
super.onConfigurationChanged(newConfig);
|
||||||
updateResources();
|
updateResources();
|
||||||
setDatePrivacyContainersWidth(newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE);
|
setDatePrivacyContainersWidth(newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE);
|
||||||
setSecurityHeaderContainerVisibility(
|
|
||||||
newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -229,10 +223,6 @@ public class QuickStatusBarHeader extends FrameLayout {
|
|||||||
mPrivacyContainer.setLayoutParams(lp);
|
mPrivacyContainer.setLayoutParams(lp);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setSecurityHeaderContainerVisibility(boolean landscape) {
|
|
||||||
mSecurityHeaderView.setVisibility(landscape ? VISIBLE : GONE);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateBatteryMode() {
|
private void updateBatteryMode() {
|
||||||
if (mConfigShowBatteryEstimate && !mHasCenterCutout) {
|
if (mConfigShowBatteryEstimate && !mHasCenterCutout) {
|
||||||
mBatteryRemainingIcon.setPercentShowMode(BatteryMeterView.MODE_ESTIMATE);
|
mBatteryRemainingIcon.setPercentShowMode(BatteryMeterView.MODE_ESTIMATE);
|
||||||
@@ -337,7 +327,6 @@ public class QuickStatusBarHeader extends FrameLayout {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
TouchAnimator.Builder builder = new TouchAnimator.Builder()
|
TouchAnimator.Builder builder = new TouchAnimator.Builder()
|
||||||
.addFloat(mSecurityHeaderView, "alpha", 0, 1)
|
|
||||||
// These views appear on expanding down
|
// These views appear on expanding down
|
||||||
.addFloat(mDateView, "alpha", 0, 0, 1)
|
.addFloat(mDateView, "alpha", 0, 0, 1)
|
||||||
.addFloat(mClockDateView, "alpha", 1, 0, 0)
|
.addFloat(mClockDateView, "alpha", 1, 0, 0)
|
||||||
|
|||||||
@@ -22,13 +22,10 @@ import static com.android.systemui.util.Utils.useQsMediaPlayer;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewStub;
|
|
||||||
|
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
import com.android.systemui.battery.BatteryMeterView;
|
import com.android.systemui.battery.BatteryMeterView;
|
||||||
import com.android.systemui.dagger.qualifiers.RootView;
|
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.plugins.qs.QS;
|
||||||
import com.android.systemui.privacy.OngoingPrivacyChip;
|
import com.android.systemui.privacy.OngoingPrivacyChip;
|
||||||
import com.android.systemui.qs.FooterActionsView;
|
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}.
|
* This will replace a ViewStub either in {@link QSFooterView} or in {@link QSContainerImpl}.
|
||||||
*/
|
*/
|
||||||
@Provides
|
@Provides
|
||||||
static FooterActionsView providesQSFooterActionsView(@RootView View view,
|
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();
|
|
||||||
return view.findViewById(R.id.qs_footer_actions);
|
return view.findViewById(R.id.qs_footer_actions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,9 +150,10 @@ public interface QSFragmentModule {
|
|||||||
@Named(QS_SECURITY_FOOTER_VIEW)
|
@Named(QS_SECURITY_FOOTER_VIEW)
|
||||||
static View providesQSSecurityFooterView(
|
static View providesQSSecurityFooterView(
|
||||||
@QSThemedContext LayoutInflater layoutInflater,
|
@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)
|
@Named(QS_FGS_MANAGER_FOOTER_VIEW)
|
||||||
static View providesQSFgsManagerFooterView(
|
static View providesQSFgsManagerFooterView(
|
||||||
@QSThemedContext LayoutInflater layoutInflater,
|
@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() {
|
private fun updateBottomSpacing() {
|
||||||
val (containerPadding, notificationsMargin) = calculateBottomSpacing()
|
val (containerPadding, notificationsMargin) = calculateBottomSpacing()
|
||||||
var qsScrollPaddingBottom = 0
|
var qsScrollPaddingBottom = 0
|
||||||
val newFooter = featureFlags.isEnabled(Flags.NEW_FOOTER)
|
if (!(isQSCustomizing || isQSDetailShowing)) {
|
||||||
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)) {
|
|
||||||
// With the new footer, we also want this padding in the bottom in these cases
|
// With the new footer, we also want this padding in the bottom in these cases
|
||||||
qsScrollPaddingBottom = if (splitShadeEnabled) {
|
qsScrollPaddingBottom = if (splitShadeEnabled) {
|
||||||
notificationsMargin - scrimShadeBottomMargin
|
notificationsMargin - scrimShadeBottomMargin
|
||||||
@@ -185,11 +178,7 @@ class NotificationsQSContainerController @Inject constructor(
|
|||||||
}
|
}
|
||||||
mView.setPadding(0, 0, 0, containerPadding)
|
mView.setPadding(0, 0, 0, containerPadding)
|
||||||
mView.setNotificationsMarginBottom(notificationsMargin)
|
mView.setNotificationsMarginBottom(notificationsMargin)
|
||||||
if (newFooter) {
|
|
||||||
mView.setQSContainerPaddingBottom(qsScrollPaddingBottom)
|
mView.setQSContainerPaddingBottom(qsScrollPaddingBottom)
|
||||||
} else {
|
|
||||||
mView.setQSScrollPaddingBottom(qsScrollPaddingBottom)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun calculateBottomSpacing(): Pair<Int, Int> {
|
private fun calculateBottomSpacing(): Pair<Int, Int> {
|
||||||
|
|||||||
@@ -103,16 +103,6 @@ public class NotificationsQuickSettingsContainer extends ConstraintLayout
|
|||||||
mStackScroller.setLayoutParams(params);
|
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) {
|
public void setQSContainerPaddingBottom(int paddingBottom) {
|
||||||
if (mQSContainer != null) {
|
if (mQSContainer != null) {
|
||||||
mQSContainer.setPadding(
|
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.testing.ViewUtils
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
import androidx.test.filters.SmallTest
|
import androidx.test.filters.SmallTest
|
||||||
import com.android.internal.logging.MetricsLogger
|
import com.android.internal.logging.MetricsLogger
|
||||||
import com.android.internal.logging.UiEventLogger
|
import com.android.internal.logging.UiEventLogger
|
||||||
import com.android.internal.logging.testing.FakeMetricsLogger
|
import com.android.internal.logging.testing.FakeMetricsLogger
|
||||||
import com.android.systemui.R
|
import com.android.systemui.R
|
||||||
import com.android.systemui.classifier.FalsingManagerFake
|
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.globalactions.GlobalActionsDialogLite
|
||||||
import com.android.systemui.plugins.ActivityStarter
|
import com.android.systemui.plugins.ActivityStarter
|
||||||
import com.android.systemui.settings.UserTracker
|
import com.android.systemui.settings.UserTracker
|
||||||
import com.android.systemui.statusbar.phone.MultiUserSwitchController
|
import com.android.systemui.statusbar.phone.MultiUserSwitchController
|
||||||
import com.android.systemui.statusbar.policy.DeviceProvisionedController
|
import com.android.systemui.statusbar.policy.DeviceProvisionedController
|
||||||
import com.android.systemui.statusbar.policy.UserInfoController
|
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.util.settings.FakeSettings
|
||||||
import com.android.systemui.utils.leaks.LeakCheckedTest
|
import com.android.systemui.utils.leaks.LeakCheckedTest
|
||||||
import com.google.common.truth.Truth.assertThat
|
import com.google.common.truth.Truth.assertThat
|
||||||
@@ -29,10 +29,14 @@ import org.junit.After
|
|||||||
import org.junit.Before
|
import org.junit.Before
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.junit.runner.RunWith
|
import org.junit.runner.RunWith
|
||||||
|
import org.mockito.ArgumentCaptor
|
||||||
import org.mockito.ArgumentMatchers.any
|
import org.mockito.ArgumentMatchers.any
|
||||||
import org.mockito.ArgumentMatchers.anyBoolean
|
import org.mockito.ArgumentMatchers.anyBoolean
|
||||||
|
import org.mockito.Captor
|
||||||
import org.mockito.Mock
|
import org.mockito.Mock
|
||||||
import org.mockito.Mockito
|
import org.mockito.Mockito
|
||||||
|
import org.mockito.Mockito.atLeastOnce
|
||||||
|
import org.mockito.Mockito.clearInvocations
|
||||||
import org.mockito.Mockito.never
|
import org.mockito.Mockito.never
|
||||||
import org.mockito.Mockito.reset
|
import org.mockito.Mockito.reset
|
||||||
import org.mockito.Mockito.verify
|
import org.mockito.Mockito.verify
|
||||||
@@ -65,11 +69,12 @@ class FooterActionsControllerTest : LeakCheckedTest() {
|
|||||||
@Mock
|
@Mock
|
||||||
private lateinit var uiEventLogger: UiEventLogger
|
private lateinit var uiEventLogger: UiEventLogger
|
||||||
@Mock
|
@Mock
|
||||||
private lateinit var featureFlags: FeatureFlags
|
|
||||||
@Mock
|
|
||||||
private lateinit var securityFooterController: QSSecurityFooter
|
private lateinit var securityFooterController: QSSecurityFooter
|
||||||
@Mock
|
@Mock
|
||||||
private lateinit var fgsManagerController: QSFgsManagerFooter
|
private lateinit var fgsManagerController: QSFgsManagerFooter
|
||||||
|
@Captor
|
||||||
|
private lateinit var visibilityChangedCaptor:
|
||||||
|
ArgumentCaptor<VisibilityChangedDispatcher.OnVisibilityChangedListener>
|
||||||
|
|
||||||
private lateinit var controller: FooterActionsController
|
private lateinit var controller: FooterActionsController
|
||||||
|
|
||||||
@@ -78,6 +83,8 @@ class FooterActionsControllerTest : LeakCheckedTest() {
|
|||||||
private val falsingManager: FalsingManagerFake = FalsingManagerFake()
|
private val falsingManager: FalsingManagerFake = FalsingManagerFake()
|
||||||
private lateinit var testableLooper: TestableLooper
|
private lateinit var testableLooper: TestableLooper
|
||||||
private lateinit var fakeSettings: FakeSettings
|
private lateinit var fakeSettings: FakeSettings
|
||||||
|
private lateinit var securityFooter: View
|
||||||
|
private lateinit var fgsFooter: View
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
fun setUp() {
|
fun setUp() {
|
||||||
@@ -87,9 +94,14 @@ class FooterActionsControllerTest : LeakCheckedTest() {
|
|||||||
|
|
||||||
whenever(multiUserSwitchControllerFactory.create(any()))
|
whenever(multiUserSwitchControllerFactory.create(any()))
|
||||||
.thenReturn(multiUserSwitchController)
|
.thenReturn(multiUserSwitchController)
|
||||||
whenever(featureFlags.isEnabled(Flags.NEW_FOOTER)).thenReturn(false)
|
|
||||||
whenever(globalActionsDialogProvider.get()).thenReturn(globalActionsDialog)
|
whenever(globalActionsDialogProvider.get()).thenReturn(globalActionsDialog)
|
||||||
|
|
||||||
|
securityFooter = View(mContext)
|
||||||
|
fgsFooter = View(mContext)
|
||||||
|
|
||||||
|
whenever(securityFooterController.view).thenReturn(securityFooter)
|
||||||
|
whenever(fgsManagerController.view).thenReturn(fgsFooter)
|
||||||
|
|
||||||
view = inflateView()
|
view = inflateView()
|
||||||
|
|
||||||
controller = constructFooterActionsController(view)
|
controller = constructFooterActionsController(view)
|
||||||
@@ -106,6 +118,13 @@ class FooterActionsControllerTest : LeakCheckedTest() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun testInitializesControllers() {
|
||||||
|
verify(multiUserSwitchController).init()
|
||||||
|
verify(fgsManagerController).init()
|
||||||
|
verify(securityFooterController).init()
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testLogPowerMenuClick() {
|
fun testLogPowerMenuClick() {
|
||||||
controller.visible = true
|
controller.visible = true
|
||||||
@@ -182,6 +201,10 @@ class FooterActionsControllerTest : LeakCheckedTest() {
|
|||||||
@Test
|
@Test
|
||||||
fun testCleanUpGAD() {
|
fun testCleanUpGAD() {
|
||||||
reset(globalActionsDialogProvider)
|
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)
|
whenever(globalActionsDialogProvider.get()).thenReturn(globalActionsDialog)
|
||||||
val view = inflateView()
|
val view = inflateView()
|
||||||
controller = constructFooterActionsController(view)
|
controller = constructFooterActionsController(view)
|
||||||
@@ -198,6 +221,80 @@ class FooterActionsControllerTest : LeakCheckedTest() {
|
|||||||
verify(globalActionsDialog).destroy()
|
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 {
|
private fun inflateView(): FooterActionsView {
|
||||||
return LayoutInflater.from(context)
|
return LayoutInflater.from(context)
|
||||||
.inflate(R.layout.footer_actions, null) as FooterActionsView
|
.inflate(R.layout.footer_actions, null) as FooterActionsView
|
||||||
@@ -208,6 +305,6 @@ class FooterActionsControllerTest : LeakCheckedTest() {
|
|||||||
activityStarter, userManager, userTracker, userInfoController,
|
activityStarter, userManager, userTracker, userInfoController,
|
||||||
deviceProvisionedController, securityFooterController, fgsManagerController,
|
deviceProvisionedController, securityFooterController, fgsManagerController,
|
||||||
falsingManager, metricsLogger, globalActionsDialogProvider, uiEventLogger,
|
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() {
|
fun testContainerBottomPadding() {
|
||||||
qsContainer.updateResources(
|
qsContainer.updateResources(
|
||||||
qsPanelController,
|
qsPanelController,
|
||||||
quickStatusBarHeaderController,
|
quickStatusBarHeaderController
|
||||||
/* newFooter */ false
|
|
||||||
)
|
|
||||||
verify(qsPanelContainer).setPaddingRelative(anyInt(), anyInt(), anyInt(), eq(0))
|
|
||||||
|
|
||||||
qsContainer.updateResources(
|
|
||||||
qsPanelController,
|
|
||||||
quickStatusBarHeaderController,
|
|
||||||
/* newFooter */ true
|
|
||||||
)
|
)
|
||||||
verify(qsPanelContainer)
|
verify(qsPanelContainer)
|
||||||
.setPaddingRelative(
|
.setPaddingRelative(
|
||||||
anyInt(),
|
anyInt(),
|
||||||
anyInt(),
|
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.internal.logging.UiEventLogger
|
||||||
import com.android.systemui.SysuiTestCase
|
import com.android.systemui.SysuiTestCase
|
||||||
import com.android.systemui.dump.DumpManager
|
import com.android.systemui.dump.DumpManager
|
||||||
import com.android.systemui.flags.FeatureFlags
|
|
||||||
import com.android.systemui.media.MediaHost
|
import com.android.systemui.media.MediaHost
|
||||||
import com.android.systemui.media.MediaHostState
|
import com.android.systemui.media.MediaHostState
|
||||||
import com.android.systemui.plugins.FalsingManager
|
import com.android.systemui.plugins.FalsingManager
|
||||||
@@ -35,8 +34,6 @@ import org.mockito.Mockito.`when` as whenever
|
|||||||
class QSPanelControllerTest : SysuiTestCase() {
|
class QSPanelControllerTest : SysuiTestCase() {
|
||||||
|
|
||||||
@Mock private lateinit var qsPanel: QSPanel
|
@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 tunerService: TunerService
|
||||||
@Mock private lateinit var qsTileHost: QSTileHost
|
@Mock private lateinit var qsTileHost: QSTileHost
|
||||||
@Mock private lateinit var qsCustomizerController: QSCustomizerController
|
@Mock private lateinit var qsCustomizerController: QSCustomizerController
|
||||||
@@ -50,7 +47,6 @@ class QSPanelControllerTest : SysuiTestCase() {
|
|||||||
@Mock private lateinit var brightnessSlider: BrightnessSliderController
|
@Mock private lateinit var brightnessSlider: BrightnessSliderController
|
||||||
@Mock private lateinit var brightnessSliderFactory: BrightnessSliderController.Factory
|
@Mock private lateinit var brightnessSliderFactory: BrightnessSliderController.Factory
|
||||||
@Mock private lateinit var falsingManager: FalsingManager
|
@Mock private lateinit var falsingManager: FalsingManager
|
||||||
@Mock private lateinit var featureFlags: FeatureFlags
|
|
||||||
@Mock private lateinit var mediaHost: MediaHost
|
@Mock private lateinit var mediaHost: MediaHost
|
||||||
@Mock private lateinit var tile: QSTile
|
@Mock private lateinit var tile: QSTile
|
||||||
@Mock private lateinit var otherTile: QSTile
|
@Mock private lateinit var otherTile: QSTile
|
||||||
@@ -69,8 +65,6 @@ class QSPanelControllerTest : SysuiTestCase() {
|
|||||||
|
|
||||||
controller = QSPanelController(
|
controller = QSPanelController(
|
||||||
qsPanel,
|
qsPanel,
|
||||||
qsFgsManagerFooter,
|
|
||||||
qsSecurityFooter,
|
|
||||||
tunerService,
|
tunerService,
|
||||||
qsTileHost,
|
qsTileHost,
|
||||||
qsCustomizerController,
|
qsCustomizerController,
|
||||||
@@ -84,7 +78,6 @@ class QSPanelControllerTest : SysuiTestCase() {
|
|||||||
brightnessControllerFactory,
|
brightnessControllerFactory,
|
||||||
brightnessSliderFactory,
|
brightnessSliderFactory,
|
||||||
falsingManager,
|
falsingManager,
|
||||||
featureFlags,
|
|
||||||
statusBarKeyguardViewManager
|
statusBarKeyguardViewManager
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,9 +13,6 @@
|
|||||||
*/
|
*/
|
||||||
package com.android.systemui.qs
|
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.AndroidTestingRunner
|
||||||
import android.testing.TestableLooper
|
import android.testing.TestableLooper
|
||||||
import android.testing.TestableLooper.RunWithLooper
|
import android.testing.TestableLooper.RunWithLooper
|
||||||
@@ -59,8 +56,6 @@ class QSPanelTest : SysuiTestCase() {
|
|||||||
mFooter = LinearLayout(mContext).apply { id = R.id.qs_footer }
|
mFooter = LinearLayout(mContext).apply { id = R.id.qs_footer }
|
||||||
mQsPanel.addView(mFooter)
|
mQsPanel.addView(mFooter)
|
||||||
mQsPanel.onFinishInflate()
|
mQsPanel.onFinishInflate()
|
||||||
mQsPanel.setSecurityFooter(View(mContext), false)
|
|
||||||
mQsPanel.setHeaderContainer(LinearLayout(mContext))
|
|
||||||
// Provides a parent with non-zero size for QSPanel
|
// Provides a parent with non-zero size for QSPanel
|
||||||
mParentView = FrameLayout(mContext).apply {
|
mParentView = FrameLayout(mContext).apply {
|
||||||
addView(mQsPanel)
|
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
|
@Test
|
||||||
fun testHasCollapseAccessibilityAction() {
|
fun testHasCollapseAccessibilityAction() {
|
||||||
val info = AccessibilityNodeInfo(mQsPanel)
|
val info = AccessibilityNodeInfo(mQsPanel)
|
||||||
@@ -128,7 +80,4 @@ class QSPanelTest : SysuiTestCase() {
|
|||||||
mQsPanel.performAccessibilityAction(AccessibilityNodeInfo.ACTION_COLLAPSE, null)
|
mQsPanel.performAccessibilityAction(AccessibilityNodeInfo.ACTION_COLLAPSE, null)
|
||||||
verify(mockRunnable).run()
|
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.AndroidTestingRunner
|
||||||
import android.testing.TestableLooper
|
import android.testing.TestableLooper
|
||||||
import android.view.View
|
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.view.accessibility.AccessibilityNodeInfo
|
import android.view.accessibility.AccessibilityNodeInfo
|
||||||
import android.widget.FrameLayout
|
import android.widget.FrameLayout
|
||||||
import android.widget.LinearLayout
|
|
||||||
import androidx.test.filters.SmallTest
|
import androidx.test.filters.SmallTest
|
||||||
import com.android.systemui.SysuiTestCase
|
import com.android.systemui.SysuiTestCase
|
||||||
import com.google.common.truth.Truth
|
import com.google.common.truth.Truth
|
||||||
@@ -37,8 +35,6 @@ class QuickQSPanelTest : SysuiTestCase() {
|
|||||||
quickQSPanel.initialize()
|
quickQSPanel.initialize()
|
||||||
|
|
||||||
quickQSPanel.onFinishInflate()
|
quickQSPanel.onFinishInflate()
|
||||||
quickQSPanel.setSecurityFooter(View(mContext), false)
|
|
||||||
quickQSPanel.setHeaderContainer(LinearLayout(mContext))
|
|
||||||
// Provides a parent with non-zero size for QSPanel
|
// Provides a parent with non-zero size for QSPanel
|
||||||
parentView = FrameLayout(mContext).apply {
|
parentView = FrameLayout(mContext).apply {
|
||||||
addView(quickQSPanel)
|
addView(quickQSPanel)
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import androidx.test.filters.SmallTest
|
|||||||
import com.android.systemui.R
|
import com.android.systemui.R
|
||||||
import com.android.systemui.SysuiTestCase
|
import com.android.systemui.SysuiTestCase
|
||||||
import com.android.systemui.flags.FeatureFlags
|
import com.android.systemui.flags.FeatureFlags
|
||||||
import com.android.systemui.flags.Flags
|
|
||||||
import com.android.systemui.navigationbar.NavigationModeController
|
import com.android.systemui.navigationbar.NavigationModeController
|
||||||
import com.android.systemui.navigationbar.NavigationModeController.ModeChangedListener
|
import com.android.systemui.navigationbar.NavigationModeController.ModeChangedListener
|
||||||
import com.android.systemui.recents.OverviewProxyService
|
import com.android.systemui.recents.OverviewProxyService
|
||||||
@@ -114,25 +113,6 @@ class NotificationQSContainerControllerTest : SysuiTestCase() {
|
|||||||
@Test
|
@Test
|
||||||
fun testTaskbarVisibleInSplitShade() {
|
fun testTaskbarVisibleInSplitShade() {
|
||||||
enableSplitShade()
|
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,
|
given(taskbarVisible = true,
|
||||||
navigationMode = GESTURES_NAVIGATION,
|
navigationMode = GESTURES_NAVIGATION,
|
||||||
@@ -153,25 +133,6 @@ class NotificationQSContainerControllerTest : SysuiTestCase() {
|
|||||||
fun testTaskbarNotVisibleInSplitShade() {
|
fun testTaskbarNotVisibleInSplitShade() {
|
||||||
// when taskbar is not visible, it means we're on the home screen
|
// when taskbar is not visible, it means we're on the home screen
|
||||||
enableSplitShade()
|
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,
|
given(taskbarVisible = false,
|
||||||
navigationMode = GESTURES_NAVIGATION,
|
navigationMode = GESTURES_NAVIGATION,
|
||||||
@@ -190,24 +151,6 @@ class NotificationQSContainerControllerTest : SysuiTestCase() {
|
|||||||
@Test
|
@Test
|
||||||
fun testTaskbarNotVisibleInSplitShadeWithCutout() {
|
fun testTaskbarNotVisibleInSplitShadeWithCutout() {
|
||||||
enableSplitShade()
|
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,
|
given(taskbarVisible = false,
|
||||||
navigationMode = GESTURES_NAVIGATION,
|
navigationMode = GESTURES_NAVIGATION,
|
||||||
@@ -226,23 +169,6 @@ class NotificationQSContainerControllerTest : SysuiTestCase() {
|
|||||||
@Test
|
@Test
|
||||||
fun testTaskbarVisibleInSinglePaneShade() {
|
fun testTaskbarVisibleInSinglePaneShade() {
|
||||||
disableSplitShade()
|
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,
|
given(taskbarVisible = true,
|
||||||
navigationMode = GESTURES_NAVIGATION,
|
navigationMode = GESTURES_NAVIGATION,
|
||||||
@@ -260,28 +186,6 @@ class NotificationQSContainerControllerTest : SysuiTestCase() {
|
|||||||
@Test
|
@Test
|
||||||
fun testTaskbarNotVisibleInSinglePaneShade() {
|
fun testTaskbarNotVisibleInSinglePaneShade() {
|
||||||
disableSplitShade()
|
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,
|
given(taskbarVisible = false,
|
||||||
navigationMode = GESTURES_NAVIGATION,
|
navigationMode = GESTURES_NAVIGATION,
|
||||||
@@ -303,27 +207,6 @@ class NotificationQSContainerControllerTest : SysuiTestCase() {
|
|||||||
fun testCustomizingInSinglePaneShade() {
|
fun testCustomizingInSinglePaneShade() {
|
||||||
disableSplitShade()
|
disableSplitShade()
|
||||||
controller.setCustomizerShowing(true)
|
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
|
// always sets spacings to 0
|
||||||
given(taskbarVisible = false,
|
given(taskbarVisible = false,
|
||||||
@@ -343,27 +226,6 @@ class NotificationQSContainerControllerTest : SysuiTestCase() {
|
|||||||
fun testDetailShowingInSinglePaneShade() {
|
fun testDetailShowingInSinglePaneShade() {
|
||||||
disableSplitShade()
|
disableSplitShade()
|
||||||
controller.setDetailShowing(true)
|
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
|
// always sets spacings to 0
|
||||||
given(taskbarVisible = false,
|
given(taskbarVisible = false,
|
||||||
@@ -383,25 +245,6 @@ class NotificationQSContainerControllerTest : SysuiTestCase() {
|
|||||||
fun testDetailShowingInSplitShade() {
|
fun testDetailShowingInSplitShade() {
|
||||||
enableSplitShade()
|
enableSplitShade()
|
||||||
controller.setDetailShowing(true)
|
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,
|
given(taskbarVisible = false,
|
||||||
navigationMode = GESTURES_NAVIGATION,
|
navigationMode = GESTURES_NAVIGATION,
|
||||||
@@ -531,7 +374,6 @@ class NotificationQSContainerControllerTest : SysuiTestCase() {
|
|||||||
@Test
|
@Test
|
||||||
fun testWindowInsetDebounce() {
|
fun testWindowInsetDebounce() {
|
||||||
disableSplitShade()
|
disableSplitShade()
|
||||||
useNewFooter(true)
|
|
||||||
|
|
||||||
given(taskbarVisible = false,
|
given(taskbarVisible = false,
|
||||||
navigationMode = GESTURES_NAVIGATION,
|
navigationMode = GESTURES_NAVIGATION,
|
||||||
@@ -596,13 +438,8 @@ class NotificationQSContainerControllerTest : SysuiTestCase() {
|
|||||||
verify(notificationsQSContainer)
|
verify(notificationsQSContainer)
|
||||||
.setPadding(anyInt(), anyInt(), anyInt(), eq(expectedContainerPadding))
|
.setPadding(anyInt(), anyInt(), anyInt(), eq(expectedContainerPadding))
|
||||||
verify(notificationsQSContainer).setNotificationsMarginBottom(expectedNotificationsMargin)
|
verify(notificationsQSContainer).setNotificationsMarginBottom(expectedNotificationsMargin)
|
||||||
val newFooter = featureFlags.isEnabled(Flags.NEW_FOOTER)
|
|
||||||
if (newFooter) {
|
|
||||||
verify(notificationsQSContainer)
|
verify(notificationsQSContainer)
|
||||||
.setQSContainerPaddingBottom(expectedQsPadding)
|
.setQSContainerPaddingBottom(expectedQsPadding)
|
||||||
} else {
|
|
||||||
verify(notificationsQSContainer).setQSScrollPaddingBottom(expectedQsPadding)
|
|
||||||
}
|
|
||||||
Mockito.clearInvocations(notificationsQSContainer)
|
Mockito.clearInvocations(notificationsQSContainer)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -620,10 +457,6 @@ class NotificationQSContainerControllerTest : SysuiTestCase() {
|
|||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun useNewFooter(useNewFooter: Boolean) {
|
|
||||||
whenever(featureFlags.isEnabled(Flags.NEW_FOOTER)).thenReturn(useNewFooter)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun getConstraintSetLayout(@IdRes id: Int): ConstraintSet.Layout {
|
private fun getConstraintSetLayout(@IdRes id: Int): ConstraintSet.Layout {
|
||||||
return constraintSetCaptor.value.getConstraint(id).layout
|
return constraintSetCaptor.value.getConstraint(id).layout
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user