Merge changes from topics "FK_remove_qs_flag", "FK_remove_qs_flag_2" into sc-dev

* changes:
  Remove QS flag
  Fold in QS overlay resources and set flag to true
This commit is contained in:
Fabian Kozynski
2021-04-15 13:21:59 +00:00
committed by Android (Google) Code Review
36 changed files with 183 additions and 718 deletions

View File

@@ -45,8 +45,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" android:layout_weight="1"
android:paddingLeft="@dimen/qs_tile_layout_margin_side"
android:paddingRight="@dimen/qs_tile_layout_margin_side"
android:paddingBottom="28dp" android:paddingBottom="28dp"
android:clipToPadding="false" android:clipToPadding="false"
android:scrollIndicators="top" android:scrollIndicators="top"

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
** Copyright 2012, The Android Open Source Project ** Copyright 2021, 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.
@@ -16,8 +16,7 @@
--> -->
<!-- Extends FrameLayout --> <!-- Extends FrameLayout -->
<com.android.systemui.qs.QSFooterView <com.android.systemui.qs.QSFooterView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/qs_footer" android:id="@+id/qs_footer"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/qs_footer_height" android:layout_height="@dimen/qs_footer_height"
@@ -32,41 +31,27 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="center_vertical" android:orientation="vertical">
android:gravity="end" >
<com.android.keyguard.AlphaOptimizedLinearLayout <LinearLayout
android:id="@+id/qs_footer_actions_edit_container" android:layout_width="match_parent"
android:layout_width="@integer/qs_footer_actions_width" android:layout_height="48dp"
android:layout_height="match_parent" android:layout_gravity="center_vertical">
android:layout_weight="@integer/qs_footer_actions_weight"
android:gravity="center_vertical|start" >
<com.android.systemui.statusbar.AlphaOptimizedImageView
android:id="@android:id/edit"
android:layout_width="@dimen/qs_footer_action_button_size"
android:layout_height="@dimen/qs_footer_action_button_size"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:clipToPadding="false"
android:contentDescription="@string/accessibility_quick_settings_edit"
android:focusable="true"
android:padding="@dimen/qs_footer_icon_padding"
android:src="@*android:drawable/ic_mode_edit"
android:tint="?android:attr/colorForeground"/>
<TextView <TextView
android:id="@+id/build" android:id="@+id/build"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:paddingStart="@dimen/qs_tile_margin_horizontal"
android:paddingEnd="4dp"
android:layout_weight="1"
android:clickable="true" android:clickable="true"
android:gravity="center_vertical"
android:focusable="true"
android:singleLine="true"
android:ellipsize="marquee" android:ellipsize="marquee"
android:focusable="true"
android:gravity="center_vertical"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.QS.Status" android:textAppearance="@style/TextAppearance.QS.Status"
android:layout_marginEnd="4dp" android:visibility="gone" />
android:visibility="gone"/>
</com.android.keyguard.AlphaOptimizedLinearLayout>
<com.android.systemui.qs.PageIndicator <com.android.systemui.qs.PageIndicator
android:id="@+id/footer_page_indicator" android:id="@+id/footer_page_indicator"
@@ -75,34 +60,41 @@
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:visibility="gone" /> android:visibility="gone" />
<com.android.keyguard.AlphaOptimizedLinearLayout <View
android:id="@+id/qs_footer_actions_container" android:layout_width="0dp"
android:layout_width="@integer/qs_footer_actions_width"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="@integer/qs_footer_actions_weight" android:layout_weight="1" />
android:gravity="center_vertical|end" >
</LinearLayout>
<LinearLayout
android:id="@+id/qs_footer_actions_container"
android:layout_width="match_parent"
android:layout_height="48dp"
android:gravity="center_vertical">
<com.android.systemui.statusbar.AlphaOptimizedImageView <com.android.systemui.statusbar.AlphaOptimizedImageView
android:id="@+id/pm_lite" android:id="@android:id/edit"
android:layout_width="@dimen/qs_footer_action_button_size" android:layout_width="0dp"
android:layout_height="@dimen/qs_footer_action_button_size" android:layout_height="@dimen/qs_footer_action_button_size"
android:background="?android:attr/selectableItemBackgroundBorderless" android:layout_marginEnd="@dimen/qs_tile_margin_horizontal"
android:layout_weight="1"
android:background="@drawable/qs_footer_action_chip_background"
android:clickable="true" android:clickable="true"
android:clipToPadding="false" android:clipToPadding="false"
android:contentDescription="@string/accessibility_quick_settings_power_menu" android:contentDescription="@string/accessibility_quick_settings_edit"
android:focusable="true" android:focusable="true"
android:padding="@dimen/qs_footer_icon_padding" android:padding="@dimen/qs_footer_icon_padding"
android:src="@*android:drawable/ic_lock_power_off" android:src="@*android:drawable/ic_mode_edit"
android:tint="?android:attr/colorForeground" android:tint="?android:attr/colorForeground" />
android:visibility="gone"
/>
<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="@dimen/qs_footer_action_button_size" android:layout_width="0dp"
android:layout_height="@dimen/qs_footer_action_button_size" android:layout_height="@dimen/qs_footer_action_button_size"
android:layout_alignParentEnd="true" android:layout_marginEnd="@dimen/qs_tile_margin_horizontal"
android:background="@drawable/ripple_drawable" android:layout_weight="1"
android:background="@drawable/qs_footer_action_chip_background"
android:focusable="true"> android:focusable="true">
<ImageView <ImageView
@@ -110,40 +102,58 @@
android:layout_width="@dimen/multi_user_avatar_expanded_size" android:layout_width="@dimen/multi_user_avatar_expanded_size"
android:layout_height="@dimen/multi_user_avatar_expanded_size" android:layout_height="@dimen/multi_user_avatar_expanded_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.AlphaOptimizedFrameLayout <com.android.systemui.statusbar.AlphaOptimizedFrameLayout
android:id="@+id/settings_button_container" android:id="@+id/settings_button_container"
android:layout_width="@dimen/qs_footer_action_button_size" android:layout_width="0dp"
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_chip_background"
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"
style="@android:style/Widget.Material.Button.Borderless"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="@dimen/qs_footer_action_button_size"
android:layout_gravity="center" android:layout_gravity="center"
android:padding="@dimen/qs_footer_icon_padding"
android:background="@drawable/ripple_drawable"
android:contentDescription="@string/accessibility_quick_settings_settings" android:contentDescription="@string/accessibility_quick_settings_settings"
android:src="@drawable/ic_settings" android:background="@drawable/qs_footer_action_chip_background_borderless"
android:padding="@dimen/qs_footer_icon_padding"
android:scaleType="centerInside" android:scaleType="centerInside"
android:tint="?android:attr/colorForeground"/> android:src="@drawable/ic_settings"
android:tint="?android:attr/colorForeground" />
<com.android.systemui.statusbar.AlphaOptimizedImageView <com.android.systemui.statusbar.AlphaOptimizedImageView
android:id="@+id/tuner_icon" android:id="@+id/tuner_icon"
android:layout_width="match_parent" android:layout_width="8dp"
android:layout_height="match_parent" android:layout_height="8dp"
android:paddingStart="36dp" android:layout_gravity="center_horizontal|bottom"
android:paddingEnd="4dp" android:layout_marginBottom="@dimen/qs_footer_icon_padding"
android:src="@drawable/tuner" android:src="@drawable/tuner"
android:tint="?android:attr/textColorTertiary" android:tint="?android:attr/textColorTertiary"
android:visibility="invisible"/> android:visibility="invisible" />
</com.android.systemui.statusbar.AlphaOptimizedFrameLayout> </com.android.systemui.statusbar.AlphaOptimizedFrameLayout>
</com.android.keyguard.AlphaOptimizedLinearLayout>
<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_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/colorForeground" />
</LinearLayout> </LinearLayout>
</LinearLayout>
</com.android.systemui.qs.QSFooterView> </com.android.systemui.qs.QSFooterView>

View File

@@ -1,159 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
** Copyright 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.
-->
<!-- Extends FrameLayout -->
<com.android.systemui.qs.QSFooterView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/qs_footer"
android:layout_width="match_parent"
android:layout_height="@dimen/qs_footer_height"
android:layout_marginStart="@dimen/qs_footer_margin"
android:layout_marginEnd="@dimen/qs_footer_margin"
android:background="@android:color/transparent"
android:baselineAligned="false"
android:clickable="false"
android:clipChildren="false"
android:clipToPadding="false">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_gravity="center_vertical">
<TextView
android:id="@+id/build"
android:layout_width="0dp"
android:layout_height="match_parent"
android:paddingStart="@dimen/qs_tile_margin_horizontal"
android:paddingEnd="4dp"
android:layout_weight="1"
android:clickable="true"
android:ellipsize="marquee"
android:focusable="true"
android:gravity="center_vertical"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.QS.Status"
android:visibility="gone" />
<com.android.systemui.qs.PageIndicator
android:id="@+id/footer_page_indicator"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:visibility="gone" />
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:id="@+id/qs_footer_actions_container"
android:layout_width="match_parent"
android:layout_height="48dp"
android:gravity="center_vertical">
<com.android.systemui.statusbar.AlphaOptimizedImageView
android:id="@android:id/edit"
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:contentDescription="@string/accessibility_quick_settings_edit"
android:focusable="true"
android:padding="@dimen/qs_footer_icon_padding"
android:src="@*android:drawable/ic_mode_edit"
android:tint="?android:attr/colorForeground" />
<com.android.systemui.statusbar.phone.MultiUserSwitch
android:id="@+id/multi_user_switch"
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:focusable="true">
<ImageView
android:id="@+id/multi_user_avatar"
android:layout_width="@dimen/multi_user_avatar_expanded_size"
android:layout_height="@dimen/multi_user_avatar_expanded_size"
android:layout_gravity="center"
android:scaleType="centerInside" />
</com.android.systemui.statusbar.phone.MultiUserSwitch>
<com.android.systemui.statusbar.AlphaOptimizedFrameLayout
android:id="@+id/settings_button_container"
android:layout_width="0dp"
android:layout_height="@dimen/qs_footer_action_button_size"
android:layout_marginEnd="@dimen/qs_tile_margin_horizontal"
android:background="@drawable/qs_footer_action_chip_background"
android:layout_weight="1"
android:clipChildren="false"
android:clipToPadding="false">
<com.android.systemui.statusbar.phone.SettingsButton
android:id="@+id/settings_button"
android:layout_width="match_parent"
android:layout_height="@dimen/qs_footer_action_button_size"
android:layout_gravity="center"
android:contentDescription="@string/accessibility_quick_settings_settings"
android:background="@drawable/qs_footer_action_chip_background_borderless"
android:padding="@dimen/qs_footer_icon_padding"
android:scaleType="centerInside"
android:src="@drawable/ic_settings"
android:tint="?android:attr/colorForeground" />
<com.android.systemui.statusbar.AlphaOptimizedImageView
android:id="@+id/tuner_icon"
android:layout_width="8dp"
android:layout_height="8dp"
android:layout_gravity="center_horizontal|bottom"
android:layout_marginBottom="@dimen/qs_footer_icon_padding"
android:src="@drawable/tuner"
android:tint="?android:attr/textColorTertiary"
android:visibility="invisible" />
</com.android.systemui.statusbar.AlphaOptimizedFrameLayout>
<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_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/colorForeground" />
</LinearLayout>
</LinearLayout>
</com.android.systemui.qs.QSFooterView>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright (C) 2015 The Android Open Source Project Copyright (C) 2020 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.
@@ -14,8 +14,7 @@
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.
--> -->
<view <com.android.systemui.qs.SideLabelTileLayout
class="com.android.systemui.qs.PagedTileLayout$TilePage"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tile_page" android:id="@+id/tile_page"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2020 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.
-->
<com.android.systemui.qs.SideLabelTileLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tile_page"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false"
android:clipToPadding="false" />

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright (C) 2015 The Android Open Source Project Copyright (C) 2020 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.
@@ -22,5 +22,4 @@
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" android:layout_weight="1"
android:clipChildren="true" android:clipChildren="true"
android:paddingBottom="@dimen/qs_paged_tile_layout_padding_bottom"> android:paddingBottom="@dimen/qs_paged_tile_layout_padding_bottom" />
</com.android.systemui.qs.PagedTileLayout>

View File

@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2020 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.
-->
<com.android.systemui.qs.PagedTileLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res-auto"
android:id="@+id/qs_pager"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:clipChildren="true"
android:paddingBottom="@dimen/qs_paged_tile_layout_padding_bottom"
systemui:sideLabels="true" />

View File

@@ -43,10 +43,7 @@
android:background="@android:color/transparent" android:background="@android:color/transparent"
android:focusable="true" android:focusable="true"
android:accessibilityTraversalBefore="@android:id/edit"> android:accessibilityTraversalBefore="@android:id/edit">
<ViewStub <include layout="@layout/qs_footer_impl" />
android:id="@+id/qs_footer_stub"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<include layout="@layout/qs_media_divider" <include layout="@layout/qs_media_divider"
android:id="@+id/divider"/> android:id="@+id/divider"/>
</com.android.systemui.qs.QSPanel> </com.android.systemui.qs.QSPanel>

View File

@@ -1,27 +0,0 @@
<!--
~ Copyright (C) 2020 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
-->
<resources>
<dimen name="qs_tile_height">106dp</dimen>
<dimen name="qs_tile_margin_vertical">24dp</dimen>
<!-- The height of the qs customize header. Should be
(qs_panel_padding_top (48dp) + brightness_mirror_height (48dp) + qs_tile_margin_top (18dp)) -
(Toolbar_minWidth (56dp) + qs_tile_margin_top_bottom (12dp))
-->
<dimen name="qs_customize_header_min_height">46dp</dimen>
<dimen name="qs_tile_margin_top">18dp</dimen>
</resources>

View File

@@ -20,12 +20,11 @@
<!-- These resources are around just to allow their values to be customized <!-- These resources are around just to allow their values to be customized
for different hardware and product builds. --> for different hardware and product builds. -->
<resources> <resources>
<!-- The maximum number of tiles in the QuickQSPanel -->
<integer name="quick_qs_panel_max_columns">6</integer>
<!-- The maximum number of rows in the QuickSettings --> <!-- The maximum number of rows in the QuickSettings -->
<integer name="quick_settings_max_rows">2</integer> <integer name="quick_settings_max_rows">2</integer>
<integer name="quick_settings_num_columns">4</integer>
<!-- The number of columns that the top level tiles span in the QuickSettings --> <!-- The number of columns that the top level tiles span in the QuickSettings -->
<integer name="quick_settings_user_time_settings_tile_span">2</integer> <integer name="quick_settings_user_time_settings_tile_span">2</integer>

View File

@@ -23,12 +23,16 @@
<dimen name="docked_divider_handle_height">16dp</dimen> <dimen name="docked_divider_handle_height">16dp</dimen>
<dimen name="qs_tile_margin_top">8dp</dimen> <dimen name="qs_tile_margin_top">8dp</dimen>
<dimen name="qs_tile_margin_vertical">0dp</dimen>
<!-- The height of the qs customize header. Should be
(qs_panel_padding_top (48dp) + brightness_mirror_height (48dp) + qs_tile_margin_top (8dp)) -
(Toolbar_minWidth (56dp) + qs_tile_margin_top_bottom (4dp))
-->
<dimen name="qs_customize_header_min_height">44dp</dimen>
<dimen name="battery_detail_graph_space_top">9dp</dimen> <dimen name="battery_detail_graph_space_top">9dp</dimen>
<dimen name="battery_detail_graph_space_bottom">9dp</dimen> <dimen name="battery_detail_graph_space_bottom">9dp</dimen>
<integer name="quick_settings_num_columns">4</integer>
<dimen name="qs_detail_margin_top">0dp</dimen> <dimen name="qs_detail_margin_top">0dp</dimen>
<dimen name="volume_tool_tip_right_margin">136dp</dimen> <dimen name="volume_tool_tip_right_margin">136dp</dimen>

View File

@@ -15,8 +15,6 @@
~ limitations under the License ~ limitations under the License
--> -->
<resources> <resources>
<integer name="quick_settings_num_columns">3</integer>
<!-- Max number of columns for quick controls area --> <!-- Max number of columns for quick controls area -->
<integer name="controls_max_columns">2</integer> <integer name="controls_max_columns">2</integer>

View File

@@ -1,48 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
* Copyright (c) 2012, 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.
*/
-->
<resources>
<dimen name="keyguard_clock_notifications_margin">36dp</dimen>
<dimen name="keyguard_indication_margin_bottom">80dp</dimen>
<!-- Screen pinning request width (just a little bit bigger than the three buttons here -->
<dimen name="screen_pinning_request_width">490dp</dimen>
<!-- Screen pinning request bottom button circle widths -->
<dimen name="screen_pinning_request_button_width">162dp</dimen>
<!-- Screen pinning request, controls padding on bigger screens, bigger nav bar -->
<dimen name="screen_pinning_request_frame_padding">39dp</dimen>
<!-- Screen pinning request side views to match nav bar
In sw600dp we want the buttons centered so this fills the space,
(screen_pinning_request_width - 3 * screen_pinning_request_button_width) / 2 -->
<dimen name="screen_pinning_request_side_width">2dp</dimen>
<dimen name="navigation_key_width">162dp</dimen>
<dimen name="navigation_key_padding">42dp</dimen>
<dimen name="battery_detail_graph_space_top">27dp</dimen>
<dimen name="battery_detail_graph_space_bottom">27dp</dimen>
<dimen name="qs_tile_margin_top">32dp</dimen>
<dimen name="qs_brightness_padding_top">6dp</dimen>
<dimen name="qs_detail_margin_top">28dp</dimen>
<!-- In split shade mode notifications should be aligned to QS header so the value should be
adjusted to qs header height and height of centered content inside of it:
(quick_qs_offset_height (48dp) - ongoing_appops_chip_height (24dp) ) / 2 -->
<dimen name="notifications_top_padding_split_shade">12dp</dimen>
</resources>

View File

@@ -1,24 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2016, 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.
*/
-->
<!-- These resources are around just to allow their values to be customized
for different hardware and product builds. -->
<resources>
<integer name="quick_settings_num_columns">6</integer>
</resources>

View File

@@ -16,6 +16,5 @@
--> -->
<resources> <resources>
<!-- Standard notification width + gravity --> <!-- Standard notification width + gravity -->
<dimen name="notification_panel_width">644dp</dimen> <dimen name="notification_panel_width">-1px</dimen> <!-- match_parent -->
</resources> </resources>

View File

@@ -176,10 +176,6 @@
<attr name="android:alpha" /> <attr name="android:alpha" />
</declare-styleable> </declare-styleable>
<declare-styleable name="PagedTileLayout">
<attr name="sideLabels" format="boolean"/>
</declare-styleable>
<declare-styleable name="CropView"> <declare-styleable name="CropView">
<attr name="handleThickness" /> <attr name="handleThickness" />
<attr name="handleColor" /> <attr name="handleColor" />

View File

@@ -86,13 +86,13 @@
<bool name="config_navigation_bar_enable_auto_dim_no_visible_wallpaper">true</bool> <bool name="config_navigation_bar_enable_auto_dim_no_visible_wallpaper">true</bool>
<!-- The maximum number of tiles in the QuickQSPanel --> <!-- The maximum number of tiles in the QuickQSPanel -->
<integer name="quick_qs_panel_max_columns">6</integer> <integer name="quick_qs_panel_max_columns">4</integer>
<!-- The number of columns in the QuickSettings --> <!-- The number of columns in the QuickSettings -->
<integer name="quick_settings_num_columns">3</integer> <integer name="quick_settings_num_columns">2</integer>
<!-- The number of rows in the QuickSettings --> <!-- The number of rows in the QuickSettings -->
<integer name="quick_settings_max_rows">3</integer> <integer name="quick_settings_max_rows">4</integer>
<!-- The number of columns that the top level tiles span in the QuickSettings --> <!-- The number of columns that the top level tiles span in the QuickSettings -->
<integer name="quick_settings_user_time_settings_tile_span">1</integer> <integer name="quick_settings_user_time_settings_tile_span">1</integer>

View File

@@ -407,10 +407,10 @@
<!-- The height of the quick settings footer that holds the user switcher, settings icon, <!-- The height of the quick settings footer that holds the user switcher, settings icon,
etc. --> etc. -->
<dimen name="qs_footer_height">48dp</dimen> <dimen name="qs_footer_height">96dp</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">@dimen/qs_footer_height</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>
@@ -529,25 +529,25 @@
<dimen name="pull_span_min">25dp</dimen> <dimen name="pull_span_min">25dp</dimen>
<dimen name="qs_corner_radius">14dp</dimen> <dimen name="qs_corner_radius">14dp</dimen>
<dimen name="qs_tile_height">96dp</dimen> <dimen name="qs_tile_height">88dp</dimen>
<!--notification_side_paddings + notification_content_margin_start - (qs_quick_tile_size - qs_tile_background_size) / 2 --> <!--notification_side_paddings + notification_content_margin_start - (qs_quick_tile_size - qs_tile_background_size) / 2 -->
<dimen name="qs_tile_layout_margin_side">18dp</dimen> <dimen name="qs_tile_layout_margin_side">18dp</dimen>
<dimen name="qs_tile_margin_horizontal">18dp</dimen> <dimen name="qs_tile_margin_horizontal">8dp</dimen>
<dimen name="qs_tile_margin_horizontal_two_line">2dp</dimen> <dimen name="qs_tile_margin_horizontal_two_line">2dp</dimen>
<dimen name="qs_tile_margin_vertical">2dp</dimen> <dimen name="qs_tile_margin_vertical">@dimen/qs_tile_margin_horizontal</dimen>
<dimen name="qs_tile_margin_top_bottom">12dp</dimen> <dimen name="qs_tile_margin_top_bottom">4dp</dimen>
<dimen name="qs_tile_margin_top_bottom_negative">-12dp</dimen> <dimen name="qs_tile_margin_top_bottom_negative">-4dp</dimen>
<!-- The height of the qs customize header. Should be <!-- The height of the qs customize header. Should be
(qs_panel_padding_top (48dp) + brightness_mirror_height (48dp) + qs_tile_margin_top (0dp)) - (qs_panel_padding_top (48dp) + brightness_mirror_height (48dp) + qs_tile_margin_top (18dp)) -
(Toolbar_minWidth (56dp) + qs_tile_margin_top_bottom (12dp)) (Toolbar_minWidth (56dp) + qs_tile_margin_top_bottom (4dp))
--> -->
<dimen name="qs_customize_header_min_height">28dp</dimen> <dimen name="qs_customize_header_min_height">54dp</dimen>
<dimen name="qs_tile_margin_top">0dp</dimen> <dimen name="qs_tile_margin_top">18dp</dimen>
<dimen name="qs_tile_icon_background_stroke_width">-1dp</dimen> <dimen name="qs_tile_icon_background_stroke_width">-1dp</dimen>
<dimen name="qs_tile_background_size">44dp</dimen> <dimen name="qs_tile_background_size">56dp</dimen>
<dimen name="qs_icon_size">20dp</dimen> <dimen name="qs_icon_size">20dp</dimen>
<dimen name="qs_label_container_margin">10dp</dimen> <dimen name="qs_label_container_margin">10dp</dimen>
<dimen name="qs_quick_tile_size">48dp</dimen> <dimen name="qs_quick_tile_size">60dp</dimen>
<dimen name="qs_quick_tile_padding">12dp</dimen> <dimen name="qs_quick_tile_padding">12dp</dimen>
<dimen name="qs_header_gear_translation">16dp</dimen> <dimen name="qs_header_gear_translation">16dp</dimen>
<dimen name="qs_header_tile_margin_bottom">18dp</dimen> <dimen name="qs_header_tile_margin_bottom">18dp</dimen>
@@ -557,9 +557,9 @@
Scaled @dimen/qs_page_indicator-width by .4f. Scaled @dimen/qs_page_indicator-width by .4f.
--> -->
<dimen name="qs_page_indicator_dot_width">6.4dp</dimen> <dimen name="qs_page_indicator_dot_width">6.4dp</dimen>
<dimen name="qs_tile_side_label_padding">6dp</dimen> <dimen name="qs_tile_side_label_padding">12dp</dimen>
<dimen name="qs_tile_icon_size">24dp</dimen> <dimen name="qs_tile_icon_size">24dp</dimen>
<dimen name="qs_tile_text_size">12sp</dimen> <dimen name="qs_tile_text_size">14sp</dimen>
<dimen name="qs_tile_divider_height">1dp</dimen> <dimen name="qs_tile_divider_height">1dp</dimen>
<dimen name="qs_panel_padding">16dp</dimen> <dimen name="qs_panel_padding">16dp</dimen>
<dimen name="qs_dual_tile_height">112dp</dimen> <dimen name="qs_dual_tile_height">112dp</dimen>
@@ -570,7 +570,7 @@
<dimen name="qs_tile_padding_bottom">16dp</dimen> <dimen name="qs_tile_padding_bottom">16dp</dimen>
<dimen name="qs_tile_spacing">4dp</dimen> <dimen name="qs_tile_spacing">4dp</dimen>
<dimen name="qs_panel_padding_bottom">0dp</dimen> <dimen name="qs_panel_padding_bottom">0dp</dimen>
<dimen name="qs_panel_padding_top">@dimen/qs_header_tooltip_height</dimen> <dimen name="qs_panel_padding_top">48dp</dimen>
<dimen name="qs_detail_header_height">56dp</dimen> <dimen name="qs_detail_header_height">56dp</dimen>
<dimen name="qs_detail_header_padding">0dp</dimen> <dimen name="qs_detail_header_padding">0dp</dimen>
<dimen name="qs_detail_image_width">56dp</dimen> <dimen name="qs_detail_image_width">56dp</dimen>
@@ -594,7 +594,6 @@
<dimen name="qs_detail_item_icon_width">32dp</dimen> <dimen name="qs_detail_item_icon_width">32dp</dimen>
<dimen name="qs_detail_item_icon_marginStart">0dp</dimen> <dimen name="qs_detail_item_icon_marginStart">0dp</dimen>
<dimen name="qs_detail_item_icon_marginEnd">20dp</dimen> <dimen name="qs_detail_item_icon_marginEnd">20dp</dimen>
<dimen name="qs_header_tooltip_height">48dp</dimen>
<dimen name="qs_header_alarm_icon_size">@dimen/status_bar_icon_drawing_size</dimen> <dimen name="qs_header_alarm_icon_size">@dimen/status_bar_icon_drawing_size</dimen>
<dimen name="qs_header_mobile_icon_size">@dimen/status_bar_icon_drawing_size</dimen> <dimen name="qs_header_mobile_icon_size">@dimen/status_bar_icon_drawing_size</dimen>
<dimen name="qs_header_alarm_text_margin_start">6dp</dimen> <dimen name="qs_header_alarm_text_margin_start">6dp</dimen>

View File

@@ -28,8 +28,6 @@
<!-- b/171917882 --> <!-- b/171917882 -->
<bool name="flag_notification_twocolumn">false</bool> <bool name="flag_notification_twocolumn">false</bool>
<bool name="flag_qs_labels">false</bool>
<!-- AOD/Lockscreen alternate layout --> <!-- AOD/Lockscreen alternate layout -->
<bool name="flag_keyguard_layout">false</bool> <bool name="flag_keyguard_layout">false</bool>

View File

@@ -2953,10 +2953,7 @@
[CHAR LIMIT=NONE] --> [CHAR LIMIT=NONE] -->
<string name="battery_state_unknown_notification_text">Tap for more information</string> <string name="battery_state_unknown_notification_text">Tap for more information</string>
<!-- No translation [CHAR LIMIT=0] --> <string name="qs_tile_label_fontFamily" translatable="false">@*android:string/config_headlineFontFamilyMedium</string>
<string name="qs_remove_labels" translatable="false"></string>
<string name="qs_tile_label_fontFamily" translatable="false">@*android:string/config_headlineFontFamily</string>
<!-- Secondary label for alarm tile when there is no next alarm information [CHAR LIMIT=20] --> <!-- Secondary label for alarm tile when there is no next alarm information [CHAR LIMIT=20] -->
<string name="qs_alarm_tile_no_alarm">No alarm set</string> <string name="qs_alarm_tile_no_alarm">No alarm set</string>

View File

@@ -8,7 +8,6 @@ import android.animation.PropertyValuesHolder;
import android.content.Context; import android.content.Context;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.content.res.Resources; import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Rect; import android.graphics.Rect;
import android.os.Bundle; import android.os.Bundle;
import android.util.AttributeSet; import android.util.AttributeSet;
@@ -71,8 +70,6 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
private int mMinRows = 1; private int mMinRows = 1;
private int mMaxColumns = TileLayout.NO_MAX_COLUMNS; private int mMaxColumns = TileLayout.NO_MAX_COLUMNS;
private final boolean mSideLabels;
public PagedTileLayout(Context context, AttributeSet attrs) { public PagedTileLayout(Context context, AttributeSet attrs) {
super(context, attrs); super(context, attrs);
mScroller = new Scroller(context, SCROLL_CUBIC); mScroller = new Scroller(context, SCROLL_CUBIC);
@@ -83,15 +80,10 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
mLayoutDirection = getLayoutDirection(); mLayoutDirection = getLayoutDirection();
mClippingRect = new Rect(); mClippingRect = new Rect();
TypedArray t = context.getTheme().obtainStyledAttributes( // Make sure there's a space between pages when scroling
attrs, R.styleable.PagedTileLayout, 0, 0);
mSideLabels = t.getBoolean(R.styleable.PagedTileLayout_sideLabels, false);
t.recycle();
if (mSideLabels) {
setPageMargin(context.getResources().getDimensionPixelOffset( setPageMargin(context.getResources().getDimensionPixelOffset(
R.dimen.qs_tile_margin_horizontal)); R.dimen.qs_tile_margin_horizontal));
} }
}
private int mLastMaxHeight = -1; private int mLastMaxHeight = -1;
public void saveInstanceState(Bundle outState) { public void saveInstanceState(Bundle outState) {
@@ -228,8 +220,7 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
private TileLayout createTileLayout() { private TileLayout createTileLayout() {
TileLayout page = (TileLayout) LayoutInflater.from(getContext()) TileLayout page = (TileLayout) LayoutInflater.from(getContext())
.inflate(mSideLabels ? R.layout.qs_paged_page_side_labels .inflate(R.layout.qs_paged_page, this, false);
: R.layout.qs_paged_page, this, false);
page.setMinRows(mMinRows); page.setMinRows(mMinRows);
page.setMaxColumns(mMaxColumns); page.setMaxColumns(mMaxColumns);
return page; return page;
@@ -345,9 +336,8 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
// Update bottom padding, useful for removing extra space once the panel page indicator is // Update bottom padding, useful for removing extra space once the panel page indicator is
// hidden. // hidden.
Resources res = getContext().getResources(); Resources res = getContext().getResources();
if (mSideLabels) {
setPageMargin(res.getDimensionPixelOffset(R.dimen.qs_tile_margin_horizontal)); setPageMargin(res.getDimensionPixelOffset(R.dimen.qs_tile_margin_horizontal));
}
setPadding(0, 0, 0, setPadding(0, 0, 0,
getContext().getResources().getDimensionPixelSize( getContext().getResources().getDimensionPixelSize(
R.dimen.qs_paged_tile_layout_padding_bottom)); R.dimen.qs_paged_tile_layout_padding_bottom));
@@ -550,18 +540,6 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
} }
}; };
public static class TilePage extends TileLayout {
public TilePage(Context context, AttributeSet attrs) {
super(context, attrs);
}
public boolean isFull() {
return mRecords.size() >= maxTiles();
}
}
private final PagerAdapter mAdapter = new PagerAdapter() { private final PagerAdapter mAdapter = new PagerAdapter() {
@Override @Override
public void destroyItem(ViewGroup container, int position, Object object) { public void destroyItem(ViewGroup container, int position, Object object) {

View File

@@ -33,7 +33,6 @@ import com.android.systemui.qs.TouchAnimator.Listener;
import com.android.systemui.qs.dagger.QSScope; import com.android.systemui.qs.dagger.QSScope;
import com.android.systemui.qs.tileimpl.HeightOverrideable; import com.android.systemui.qs.tileimpl.HeightOverrideable;
import com.android.systemui.statusbar.CrossFadeHelper; import com.android.systemui.statusbar.CrossFadeHelper;
import com.android.systemui.statusbar.FeatureFlags;
import com.android.systemui.tuner.TunerService; import com.android.systemui.tuner.TunerService;
import com.android.systemui.tuner.TunerService.Tunable; import com.android.systemui.tuner.TunerService.Tunable;
@@ -102,14 +101,13 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
private final Executor mExecutor; private final Executor mExecutor;
private final TunerService mTunerService; private final TunerService mTunerService;
private boolean mShowCollapsedOnKeyguard; private boolean mShowCollapsedOnKeyguard;
private final FeatureFlags mFeatureFlags;
@Inject @Inject
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,
QSSecurityFooter securityFooter, @Main Executor executor, TunerService tunerService, QSSecurityFooter securityFooter, @Main Executor executor, TunerService tunerService,
FeatureFlags featureFlags, QSExpansionPathInterpolator qsExpansionPathInterpolator) { QSExpansionPathInterpolator qsExpansionPathInterpolator) {
mQs = qs; mQs = qs;
mQuickQsPanel = quickPanel; mQuickQsPanel = quickPanel;
mQsPanelController = qsPanelController; mQsPanelController = qsPanelController;
@@ -119,7 +117,6 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
mHost = qsTileHost; mHost = qsTileHost;
mExecutor = executor; mExecutor = executor;
mTunerService = tunerService; mTunerService = tunerService;
mFeatureFlags = featureFlags;
mQSExpansionPathInterpolator = qsExpansionPathInterpolator; mQSExpansionPathInterpolator = qsExpansionPathInterpolator;
mHost.addCallback(this); mHost.addCallback(this);
mQsPanelController.addOnAttachStateChangeListener(this); mQsPanelController.addOnAttachStateChangeListener(this);
@@ -247,7 +244,6 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
+ mQs.getHeader().getPaddingBottom(); + mQs.getHeader().getPaddingBottom();
firstPageBuilder.addFloat(tileLayout, "translationY", heightDiff, 0); firstPageBuilder.addFloat(tileLayout, "translationY", heightDiff, 0);
boolean qsSideLabelsEnabled = mFeatureFlags.isQSLabelsEnabled();
int qqsTileHeight = 0; int qqsTileHeight = 0;
if (mQsPanelController.areThereTiles()) { if (mQsPanelController.areThereTiles()) {
@@ -275,22 +271,19 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
if (count < tileLayout.getNumVisibleTiles()) { if (count < tileLayout.getNumVisibleTiles()) {
getRelativePosition(loc1, quickTileView, view); getRelativePosition(loc1, quickTileView, view);
getRelativePosition(loc2, tileView, view); getRelativePosition(loc2, tileView, view);
int yOffset = qsSideLabelsEnabled int yOffset = loc2[1] - loc1[1];
? loc2[1] - loc1[1]
: mQuickStatusBarHeader.getOffsetTranslation();
// Move the quick tile right from its location to the new one. // Move the quick tile right from its location to the new one.
View v = qsSideLabelsEnabled ? quickTileView.getIcon() : quickTileView; View v = quickTileView.getIcon();
translationXBuilder.addFloat(v, "translationX", 0, xDiff); translationXBuilder.addFloat(v, "translationX", 0, xDiff);
translationYBuilder.addFloat(v, "translationY", 0, yDiff - yOffset); translationYBuilder.addFloat(v, "translationY", 0, yDiff - yOffset);
mAllViews.add(v); mAllViews.add(v);
// Move the real tile from the quick tile position to its final // Move the real tile from the quick tile position to its final
// location. // location.
v = qsSideLabelsEnabled ? tileIcon : tileView; v = tileIcon;
translationXBuilder.addFloat(v, "translationX", -xDiff, 0); translationXBuilder.addFloat(v, "translationX", -xDiff, 0);
translationYBuilder.addFloat(v, "translationY", -yDiff + yOffset, 0); translationYBuilder.addFloat(v, "translationY", -yDiff + yOffset, 0);
if (qsSideLabelsEnabled) {
// Offset the translation animation on the views // Offset the translation animation on the views
// (that goes from 0 to getOffsetTranslation) // (that goes from 0 to getOffsetTranslation)
int offsetWithQSBHTranslation = int offsetWithQSBHTranslation =
@@ -314,14 +307,10 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
getRelativePosition(loc2, qsLabelContainer, view); getRelativePosition(loc2, qsLabelContainer, view);
yDiff = loc2[1] - loc1[1] - yOffset; yDiff = loc2[1] - loc1[1] - yOffset;
translationYBuilder.addFloat(qqsLabelContainer, "translationY", 0, translationYBuilder.addFloat(qqsLabelContainer, "translationY", 0, yDiff);
yDiff); translationYBuilder.addFloat(qsLabelContainer, "translationY", -yDiff, 0);
translationYBuilder.addFloat(qsLabelContainer, "translationY", -yDiff,
0);
mAllViews.add(qqsLabelContainer); mAllViews.add(qqsLabelContainer);
mAllViews.add(qsLabelContainer); mAllViews.add(qsLabelContainer);
}
} else { // These tiles disappear when expanding } else { // These tiles disappear when expanding
firstPageBuilder.addFloat(quickTileView, "alpha", 1, 0); firstPageBuilder.addFloat(quickTileView, "alpha", 1, 0);
translationYBuilder.addFloat(quickTileView, "translationY", 0, yDiff); translationYBuilder.addFloat(quickTileView, "translationY", 0, yDiff);
@@ -333,11 +322,7 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
translationX); translationX);
} }
if (qsSideLabelsEnabled) {
mQuickQsViews.add(tileView); mQuickQsViews.add(tileView);
} else {
mQuickQsViews.add(tileView.getIconWithBackground());
}
mAllViews.add(tileView.getIcon()); mAllViews.add(tileView.getIcon());
mAllViews.add(quickTileView); mAllViews.add(quickTileView);
} else if (mFullRows && isIconInAnimatedRow(count)) { } else if (mFullRows && isIconInAnimatedRow(count)) {
@@ -345,10 +330,6 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
firstPageBuilder.addFloat(tileView, "translationY", -heightDiff, 0); firstPageBuilder.addFloat(tileView, "translationY", -heightDiff, 0);
mAllViews.add(tileIcon); mAllViews.add(tileIcon);
} else {
if (!qsSideLabelsEnabled) {
firstPageBuilder.addFloat(tileView, "alpha", 0, 1);
firstPageBuilder.addFloat(tileView, "translationY", -heightDiff, 0);
} else { } else {
// Pretend there's a corresponding QQS tile (for the position) that we are // Pretend there's a corresponding QQS tile (for the position) that we are
// expanding from. // expanding from.
@@ -367,7 +348,6 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
tileView.setClipChildren(true); tileView.setClipChildren(true);
tileView.setClipToPadding(true); tileView.setClipToPadding(true);
} }
}
mAllViews.add(tileView); mAllViews.add(tileView);
count++; count++;
@@ -392,7 +372,6 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
.build(); .build();
// Fade in the tiles/labels as we reach the final position. // Fade in the tiles/labels as we reach the final position.
Builder builder = new Builder() Builder builder = new Builder()
.setStartDelay(qsSideLabelsEnabled ? 0 : EXPANDED_TILE_DELAY)
.addFloat(tileLayout, "alpha", 0, 1); .addFloat(tileLayout, "alpha", 0, 1);
mFirstPageDelayedAnimator = builder.build(); mFirstPageDelayedAnimator = builder.build();
@@ -470,12 +449,7 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
// Returns true if the view is a possible page in PagedTileLayout // Returns true if the view is a possible page in PagedTileLayout
private boolean isAPage(View view) { private boolean isAPage(View view) {
if (view instanceof PagedTileLayout.TilePage) { return view.getClass().equals(SideLabelTileLayout.class);
return true;
} else if (view instanceof SideLabelTileLayout) {
return !(view instanceof QuickQSPanel.QQSSideLabelTileLayout);
}
return false;
} }
public void setPosition(float position) { public void setPosition(float position) {

View File

@@ -22,7 +22,6 @@ import android.content.Context;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.graphics.Point; import android.graphics.Point;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.util.Pair;
import android.view.View; import android.view.View;
import android.view.WindowInsets; import android.view.WindowInsets;
import android.widget.FrameLayout; import android.widget.FrameLayout;
@@ -296,9 +295,6 @@ public class QSContainerImpl extends FrameLayout {
if (view == mQSPanelContainer) { if (view == mQSPanelContainer) {
// QS panel lays out some of its content full width // QS panel lays out some of its content full width
qsPanelController.setContentMargins(mContentPadding, mContentPadding); qsPanelController.setContentMargins(mContentPadding, mContentPadding);
Pair<Integer, Integer> margins = qsPanelController.getVisualSideMargins();
// Apply paddings based on QSPanel
mQSCustomizer.setContentPaddings(margins.first, margins.second);
} else if (view == mHeader) { } else if (view == mHeader) {
// The header contains the QQS panel which needs to have special padding, to // The header contains the QQS panel which needs to have special padding, to
// visually align them. // visually align them.

View File

@@ -71,7 +71,6 @@ public class QSFooterView extends FrameLayout {
private float mExpansionAmount; private float mExpansionAmount;
protected View mEdit; protected View mEdit;
protected View mEditContainer;
private TouchAnimator mSettingsCogAnimator; private TouchAnimator mSettingsCogAnimator;
private View mActionsContainer; private View mActionsContainer;
@@ -107,7 +106,6 @@ public class QSFooterView extends FrameLayout {
mMultiUserAvatar = mMultiUserSwitch.findViewById(R.id.multi_user_avatar); mMultiUserAvatar = mMultiUserSwitch.findViewById(R.id.multi_user_avatar);
mActionsContainer = requireViewById(R.id.qs_footer_actions_container); mActionsContainer = requireViewById(R.id.qs_footer_actions_container);
mEditContainer = findViewById(R.id.qs_footer_actions_edit_container);
mBuildText = findViewById(R.id.build); mBuildText = findViewById(R.id.build);
mTunerIcon = requireViewById(R.id.tuner_icon); mTunerIcon = requireViewById(R.id.tuner_icon);
@@ -185,9 +183,6 @@ public class QSFooterView extends FrameLayout {
.addFloat(mPageIndicator, "alpha", 0, 1) .addFloat(mPageIndicator, "alpha", 0, 1)
.addFloat(mBuildText, "alpha", 0, 1) .addFloat(mBuildText, "alpha", 0, 1)
.setStartDelay(0.9f); .setStartDelay(0.9f);
if (mEditContainer != null) {
builder.addFloat(mEditContainer, "alpha", 0, 1);
}
return builder.build(); return builder.build();
} }
@@ -283,9 +278,6 @@ public class QSFooterView extends FrameLayout {
mTunerIcon.setVisibility(isTunerEnabled ? View.VISIBLE : View.INVISIBLE); mTunerIcon.setVisibility(isTunerEnabled ? View.VISIBLE : View.INVISIBLE);
final boolean isDemo = UserManager.isDeviceInDemoMode(mContext); final boolean isDemo = UserManager.isDeviceInDemoMode(mContext);
mMultiUserSwitch.setVisibility(showUserSwitcher() ? View.VISIBLE : View.GONE); mMultiUserSwitch.setVisibility(showUserSwitcher() ? View.VISIBLE : View.GONE);
if (mEditContainer != null) {
mEditContainer.setVisibility(isDemo || !mExpanded ? View.INVISIBLE : View.VISIBLE);
}
mSettingsButton.setVisibility(isDemo || !mExpanded ? View.INVISIBLE : View.VISIBLE); mSettingsButton.setVisibility(isDemo || !mExpanded ? View.INVISIBLE : View.VISIBLE);
mBuildText.setVisibility(mExpanded && mShouldShowBuildText ? View.VISIBLE : View.GONE); mBuildText.setVisibility(mExpanded && mShouldShowBuildText ? View.VISIBLE : View.GONE);

View File

@@ -27,12 +27,10 @@ import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.Message; import android.os.Message;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.util.Pair;
import android.view.Gravity; import android.view.Gravity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.ViewStub;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import com.android.internal.logging.UiEventLogger; import com.android.internal.logging.UiEventLogger;
@@ -72,8 +70,6 @@ public class QSPanel extends LinearLayout implements Tunable {
private final H mHandler = new H(); 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;
private int mVisualMarginStart;
private int mVisualMarginEnd;
protected boolean mExpanded; protected boolean mExpanded;
protected boolean mListening; protected boolean mListening;
@@ -96,7 +92,6 @@ public class QSPanel extends LinearLayout implements Tunable {
private PageIndicator mFooterPageIndicator; private PageIndicator mFooterPageIndicator;
private int mContentMarginStart; private int mContentMarginStart;
private int mContentMarginEnd; private int mContentMarginEnd;
private int mVisualTilePadding;
private boolean mUsingHorizontalLayout; private boolean mUsingHorizontalLayout;
private Record mDetailRecord; private Record mDetailRecord;
@@ -111,9 +106,7 @@ public class QSPanel extends LinearLayout implements Tunable {
protected QSTileLayout mTileLayout; protected QSTileLayout mTileLayout;
private int mLastOrientation = -1; private int mLastOrientation = -1;
private int mMediaTotalBottomMargin; private int mMediaTotalBottomMargin;
private int mFooterMarginStartHorizontal;
private Consumer<Boolean> mMediaVisibilityChangedListener; private Consumer<Boolean> mMediaVisibilityChangedListener;
protected boolean mSideLabels;
public QSPanel(Context context, AttributeSet attrs) { public QSPanel(Context context, AttributeSet attrs) {
super(context, attrs); super(context, attrs);
@@ -128,21 +121,7 @@ public class QSPanel extends LinearLayout implements Tunable {
} }
protected void inflateQSFooter(boolean newFooter) { void initialize() {
ViewStub stub = findViewById(R.id.qs_footer_stub);
if (stub != null) {
stub.setLayoutResource(
newFooter ? R.layout.qs_footer_impl_two_lines : R.layout.qs_footer_impl);
stub.inflate();
mFooter = findViewById(R.id.qs_footer);
}
}
void initialize(boolean sideLabels) {
mSideLabels = sideLabels;
inflateQSFooter(sideLabels);
mRegularTileLayout = createRegularTileLayout(); mRegularTileLayout = createRegularTileLayout();
mTileLayout = mRegularTileLayout; mTileLayout = mRegularTileLayout;
@@ -195,8 +174,7 @@ public class QSPanel extends LinearLayout implements Tunable {
public QSTileLayout createRegularTileLayout() { public QSTileLayout createRegularTileLayout() {
if (mRegularTileLayout == null) { if (mRegularTileLayout == null) {
mRegularTileLayout = (QSTileLayout) LayoutInflater.from(mContext) mRegularTileLayout = (QSTileLayout) LayoutInflater.from(mContext)
.inflate(mSideLabels ? R.layout.qs_paged_tile_layout_side_labels .inflate(R.layout.qs_paged_tile_layout, this, false);
: R.layout.qs_paged_tile_layout, this, false);
} }
return mRegularTileLayout; return mRegularTileLayout;
} }
@@ -311,11 +289,6 @@ public class QSPanel extends LinearLayout implements Tunable {
} }
public void updateResources() { public void updateResources() {
int tileSize = getResources().getDimensionPixelSize(R.dimen.qs_quick_tile_size);
int tileBg = getResources().getDimensionPixelSize(R.dimen.qs_tile_background_size);
mFooterMarginStartHorizontal = getResources().getDimensionPixelSize(
R.dimen.qs_footer_horizontal_margin);
mVisualTilePadding = mSideLabels ? 0 : (int) ((tileSize - tileBg) / 2.0f);
updatePadding(); updatePadding();
updatePageIndicator(); updatePageIndicator();
@@ -358,6 +331,7 @@ public class QSPanel extends LinearLayout implements Tunable {
@Override @Override
protected void onFinishInflate() { protected void onFinishInflate() {
super.onFinishInflate(); super.onFinishInflate();
mFooter = findViewById(R.id.qs_footer);
mDivider = findViewById(R.id.divider); mDivider = findViewById(R.id.divider);
} }
@@ -638,60 +612,10 @@ public class QSPanel extends LinearLayout implements Tunable {
// to the edge like the brightness slider // to the edge like the brightness slider
mContentMarginStart = startMargin; mContentMarginStart = startMargin;
mContentMarginEnd = endMargin; mContentMarginEnd = endMargin;
updateTileLayoutMargins(mContentMarginStart - mVisualTilePadding,
mContentMarginEnd - mVisualTilePadding);
updateMediaHostContentMargins(mediaHostView); updateMediaHostContentMargins(mediaHostView);
updateFooterMargin();
updateDividerMargin(); updateDividerMargin();
} }
private void updateFooterMargin() {
if (mFooter != null) {
int footerMargin = 0;
int indicatorMargin = 0;
if (mUsingHorizontalLayout && !mSideLabels) {
footerMargin = mFooterMarginStartHorizontal;
indicatorMargin = footerMargin - mVisualMarginEnd;
}
updateMargins(mFooter, footerMargin, 0);
// The page indicator isn't centered anymore because of the visual positioning.
// Let's fix it by adding some margin
if (mFooterPageIndicator != null) {
updateMargins(mFooterPageIndicator, 0, indicatorMargin);
}
}
}
/**
* Update the margins of all tile Layouts.
*
* @param visualMarginStart the visual start margin of the tile, adjusted for local insets
* to the tile. This can be set on a tileLayout
* @param visualMarginEnd the visual end margin of the tile, adjusted for local insets
* to the tile. This can be set on a tileLayout
*/
private void updateTileLayoutMargins(int visualMarginStart, int visualMarginEnd) {
mVisualMarginStart = visualMarginStart;
mVisualMarginEnd = visualMarginEnd;
updateTileLayoutMargins();
}
public Pair<Integer, Integer> getVisualSideMargins() {
if (mSideLabels) {
return new Pair(0, 0);
} else {
return new Pair(mVisualMarginStart, mUsingHorizontalLayout ? 0 : mVisualMarginEnd);
}
}
private void updateTileLayoutMargins() {
int marginEnd = mVisualMarginEnd;
if (mUsingHorizontalLayout || mSideLabels) {
marginEnd = 0;
}
updateMargins((View) mTileLayout, mSideLabels ? 0 : mVisualMarginStart, marginEnd);
}
private void updateDividerMargin() { private void updateDividerMargin() {
if (mDivider == null) return; if (mDivider == null) return;
updateMargins(mDivider, mContentMarginStart, mContentMarginEnd); updateMargins(mDivider, mContentMarginStart, mContentMarginEnd);
@@ -769,22 +693,13 @@ public class QSPanel extends LinearLayout implements Tunable {
newLayout.setListening(mListening, uiEventLogger); newLayout.setListening(mListening, uiEventLogger);
if (needsDynamicRowsAndColumns()) { if (needsDynamicRowsAndColumns()) {
newLayout.setMinRows(horizontal ? 2 : 1); newLayout.setMinRows(horizontal ? 2 : 1);
// Let's use 3 columns to match the current layout newLayout.setMaxColumns(horizontal ? 2 : 4);
int columns;
if (mSideLabels) {
columns = horizontal ? 2 : 4;
} else {
columns = horizontal ? 3 : TileLayout.NO_MAX_COLUMNS;
}
newLayout.setMaxColumns(columns);
} }
updateMargins(mediaHostView); updateMargins(mediaHostView);
} }
} }
private void updateMargins(ViewGroup mediaHostView) { private void updateMargins(ViewGroup mediaHostView) {
updateTileLayoutMargins();
updateFooterMargin();
updateDividerMargin(); updateDividerMargin();
updateMediaHostContentMargins(mediaHostView); updateMediaHostContentMargins(mediaHostView);
updateHorizontalLinearLayoutMargins(); updateHorizontalLinearLayoutMargins();

View File

@@ -22,7 +22,6 @@ import static com.android.systemui.qs.dagger.QSFragmentModule.QS_USING_MEDIA_PLA
import android.annotation.NonNull; import android.annotation.NonNull;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.util.Pair;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@@ -290,11 +289,6 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
mView.setContentMargins(startMargin, endMargin, mMediaHost.getHostView()); mView.setContentMargins(startMargin, endMargin, mMediaHost.getHostView());
} }
/** */
public Pair<Integer, Integer> getVisualSideMargins() {
return mView.getVisualSideMargins();
}
/** */ /** */
public void showDetailAdapter(DetailAdapter detailAdapter, int x, int y) { public void showDetailAdapter(DetailAdapter detailAdapter, int x, int y) {
mView.showDetailAdapter(true, detailAdapter, new int[]{x, y}); mView.showDetailAdapter(true, detailAdapter, new int[]{x, y});

View File

@@ -75,8 +75,6 @@ public abstract class QSPanelControllerBase<T extends QSPanel> extends ViewContr
private float mRevealExpansion; private float mRevealExpansion;
private final QSHost.Callback mQSHostCallback = this::setTiles; private final QSHost.Callback mQSHostCallback = this::setTiles;
protected boolean mShowLabels = true;
protected boolean mQSLabelFlag;
private final QSPanel.OnConfigurationChangedListener mOnConfigurationChangedListener = private final QSPanel.OnConfigurationChangedListener mOnConfigurationChangedListener =
new QSPanel.OnConfigurationChangedListener() { new QSPanel.OnConfigurationChangedListener() {
@@ -121,14 +119,13 @@ public abstract class QSPanelControllerBase<T extends QSPanel> extends ViewContr
mQSLogger = qsLogger; mQSLogger = qsLogger;
mDumpManager = dumpManager; mDumpManager = dumpManager;
mFeatureFlags = featureFlags; mFeatureFlags = featureFlags;
mQSLabelFlag = featureFlags.isQSLabelsEnabled();
mShouldUseSplitNotificationShade = mShouldUseSplitNotificationShade =
Utils.shouldUseSplitNotificationShade(mFeatureFlags, getResources()); Utils.shouldUseSplitNotificationShade(mFeatureFlags, getResources());
} }
@Override @Override
protected void onInit() { protected void onInit() {
mView.initialize(mQSLabelFlag); mView.initialize();
mQSLogger.logAllTilesChangeListening(mView.isListening(), mView.getDumpableTag(), ""); mQSLogger.logAllTilesChangeListening(mView.isListening(), mView.getDumpableTag(), "");
} }

View File

@@ -50,16 +50,11 @@ public class QuickQSPanel extends QSPanel {
} }
@Override @Override
void initialize(boolean sideLabels) { void initialize() {
super.initialize(sideLabels); super.initialize();
applyBottomMargin((View) mRegularTileLayout); applyBottomMargin((View) mRegularTileLayout);
} }
@Override
protected void inflateQSFooter(boolean newFooter) {
// No footer
}
private void applyBottomMargin(View view) { private void applyBottomMargin(View view) {
int margin = getResources().getDimensionPixelSize(R.dimen.qs_header_tile_margin_bottom); int margin = getResources().getDimensionPixelSize(R.dimen.qs_header_tile_margin_bottom);
MarginLayoutParams layoutParams = (MarginLayoutParams) view.getLayoutParams(); MarginLayoutParams layoutParams = (MarginLayoutParams) view.getLayoutParams();
@@ -74,22 +69,14 @@ public class QuickQSPanel extends QSPanel {
@Override @Override
public TileLayout createRegularTileLayout() { public TileLayout createRegularTileLayout() {
if (mSideLabels) {
return new QQSSideLabelTileLayout(mContext); return new QQSSideLabelTileLayout(mContext);
} else {
return new QuickQSPanel.HeaderTileLayout(mContext);
}
} }
@Override @Override
protected QSTileLayout createHorizontalTileLayout() { protected QSTileLayout createHorizontalTileLayout() {
if (mSideLabels) {
TileLayout t = createRegularTileLayout(); TileLayout t = createRegularTileLayout();
t.setMaxColumns(2); t.setMaxColumns(2);
return t; return t;
} else {
return new DoubleLineTileLayout(mContext);
}
} }
@Override @Override

View File

@@ -141,19 +141,6 @@ public class QSCustomizer extends LinearLayout {
} }
} }
/**
* Sets the padding for the RecyclerView. Also, updates the margin between the tiles in the
* {@link TileAdapter}.
*/
public void setContentPaddings(int paddingStart, int paddingEnd) {
mRecyclerView.setPaddingRelative(
paddingStart,
mRecyclerView.getPaddingTop(),
paddingEnd,
mRecyclerView.getPaddingBottom()
);
}
/** Hide the customizer. */ /** Hide the customizer. */
public void hide(boolean animate) { public void hide(boolean animate) {
if (isShown) { if (isShown) {

View File

@@ -14,8 +14,6 @@
package com.android.systemui.qs.customize; package com.android.systemui.qs.customize;
import static com.android.systemui.qs.dagger.QSFlagsModule.QS_LABELS_FLAG;
import android.content.ComponentName; import android.content.ComponentName;
import android.content.Context; import android.content.Context;
import android.content.res.Resources; import android.content.res.Resources;
@@ -61,7 +59,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import javax.inject.Inject; import javax.inject.Inject;
import javax.inject.Named;
/** */ /** */
@QSScope @QSScope
@@ -110,25 +107,21 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
private final AccessibilityDelegateCompat mAccessibilityDelegate; private final AccessibilityDelegateCompat mAccessibilityDelegate;
private RecyclerView mRecyclerView; private RecyclerView mRecyclerView;
private int mNumColumns; private int mNumColumns;
private final boolean mUseHorizontalTiles;
@Inject @Inject
public TileAdapter( public TileAdapter(
@QSThemedContext Context context, @QSThemedContext Context context,
QSTileHost qsHost, QSTileHost qsHost,
UiEventLogger uiEventLogger, UiEventLogger uiEventLogger) {
@Named(QS_LABELS_FLAG) boolean useHorizontalTiles
) {
mContext = context; mContext = context;
mHost = qsHost; mHost = qsHost;
mUiEventLogger = uiEventLogger; mUiEventLogger = uiEventLogger;
mItemTouchHelper = new ItemTouchHelper(mCallbacks); mItemTouchHelper = new ItemTouchHelper(mCallbacks);
mDecoration = new TileItemDecoration(context); mDecoration = new TileItemDecoration(context);
mMarginDecoration = new MarginTileDecoration(!useHorizontalTiles); mMarginDecoration = new MarginTileDecoration();
mMinNumTiles = context.getResources().getInteger(R.integer.quick_settings_min_num_tiles); mMinNumTiles = context.getResources().getInteger(R.integer.quick_settings_min_num_tiles);
mNumColumns = context.getResources().getInteger(NUM_COLUMNS_ID); mNumColumns = context.getResources().getInteger(NUM_COLUMNS_ID);
mAccessibilityDelegate = new TileAdapterDelegate(); mAccessibilityDelegate = new TileAdapterDelegate();
mUseHorizontalTiles = useHorizontalTiles;
mSizeLookup.setSpanIndexCacheEnabled(true); mSizeLookup.setSpanIndexCacheEnabled(true);
} }
@@ -287,9 +280,7 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
} }
FrameLayout frame = (FrameLayout) inflater.inflate(R.layout.qs_customize_tile_frame, parent, FrameLayout frame = (FrameLayout) inflater.inflate(R.layout.qs_customize_tile_frame, parent,
false); false);
View view = mUseHorizontalTiles View view = new CustomizeTileViewHorizontal(context, new QSIconViewImpl(context));
? new CustomizeTileViewHorizontal(context, new QSIconViewImpl(context))
: new CustomizeTileView(context, new QSIconViewImpl(context));
frame.addView(view); frame.addView(view);
return new Holder(frame); return new Holder(frame);
} }
@@ -715,11 +706,6 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
private static class MarginTileDecoration extends ItemDecoration { private static class MarginTileDecoration extends ItemDecoration {
private int mHalfMargin; private int mHalfMargin;
private final boolean mUseOutsideMargins;
private MarginTileDecoration(boolean useOutsideMargins) {
mUseOutsideMargins = useOutsideMargins;
}
public void setHalfMargin(int halfMargin) { public void setHalfMargin(int halfMargin) {
mHalfMargin = halfMargin; mHalfMargin = halfMargin;
@@ -738,9 +724,9 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
if (view instanceof TextView) { if (view instanceof TextView) {
super.getItemOffsets(outRect, view, parent, state); super.getItemOffsets(outRect, view, parent, state);
} else { } else {
if (mUseOutsideMargins || (column != 0 && column != lm.getSpanCount() - 1)) { if (column != 0 && column != lm.getSpanCount() - 1) {
// Using outside margins or in a column that's not leftmost or rightmost // In a column that's not leftmost or rightmost (half of the margin between
// (half of the margin between columns). // columns).
outRect.left = mHalfMargin; outRect.left = mHalfMargin;
outRect.right = mHalfMargin; outRect.right = mHalfMargin;
} else if (column == 0) { } else if (column == 0) {

View File

@@ -30,18 +30,11 @@ import dagger.Provides;
@Module @Module
public interface QSFlagsModule { public interface QSFlagsModule {
String QS_LABELS_FLAG = "qs_labels_flag";
String RBC_AVAILABLE = "rbc_available"; String RBC_AVAILABLE = "rbc_available";
String PM_LITE_ENABLED = "pm_lite"; String PM_LITE_ENABLED = "pm_lite";
String PM_LITE_SETTING = "sysui_pm_lite"; String PM_LITE_SETTING = "sysui_pm_lite";
@Provides
@SysUISingleton
@Named(QS_LABELS_FLAG)
static boolean provideQSFlag(FeatureFlags featureFlags) {
return featureFlags.isQSLabelsEnabled();
}
/** */ /** */
@Provides @Provides
@SysUISingleton @SysUISingleton

View File

@@ -14,8 +14,6 @@
package com.android.systemui.qs.tileimpl; package com.android.systemui.qs.tileimpl;
import static com.android.systemui.qs.dagger.QSFlagsModule.QS_LABELS_FLAG;
import android.content.Context; import android.content.Context;
import android.os.Build; import android.os.Build;
import android.util.Log; import android.util.Log;
@@ -56,7 +54,6 @@ import com.android.systemui.qs.tiles.WorkModeTile;
import com.android.systemui.util.leak.GarbageMonitor; import com.android.systemui.util.leak.GarbageMonitor;
import javax.inject.Inject; import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Provider; import javax.inject.Provider;
import dagger.Lazy; import dagger.Lazy;
@@ -97,12 +94,9 @@ public class QSFactoryImpl implements QSFactory {
private final Lazy<QSHost> mQsHostLazy; private final Lazy<QSHost> mQsHostLazy;
private final Provider<CustomTile.Builder> mCustomTileBuilderProvider; private final Provider<CustomTile.Builder> mCustomTileBuilderProvider;
private final boolean mSideLabels;
@Inject @Inject
public QSFactoryImpl( public QSFactoryImpl(
Lazy<QSHost> qsHostLazy, Lazy<QSHost> qsHostLazy,
@Named(QS_LABELS_FLAG) boolean useSideLabels,
Provider<CustomTile.Builder> customTileBuilderProvider, Provider<CustomTile.Builder> customTileBuilderProvider,
Provider<WifiTile> wifiTileProvider, Provider<WifiTile> wifiTileProvider,
Provider<InternetTile> internetTileProvider, Provider<InternetTile> internetTileProvider,
@@ -134,8 +128,6 @@ public class QSFactoryImpl implements QSFactory {
mQsHostLazy = qsHostLazy; mQsHostLazy = qsHostLazy;
mCustomTileBuilderProvider = customTileBuilderProvider; mCustomTileBuilderProvider = customTileBuilderProvider;
mSideLabels = useSideLabels;
mWifiTileProvider = wifiTileProvider; mWifiTileProvider = wifiTileProvider;
mInternetTileProvider = internetTileProvider; mInternetTileProvider = internetTileProvider;
mBluetoothTileProvider = bluetoothTileProvider; mBluetoothTileProvider = bluetoothTileProvider;
@@ -251,12 +243,6 @@ public class QSFactoryImpl implements QSFactory {
@Override @Override
public QSTileView createTileView(Context context, QSTile tile, boolean collapsedView) { public QSTileView createTileView(Context context, QSTile tile, boolean collapsedView) {
QSIconView icon = tile.createTileView(context); QSIconView icon = tile.createTileView(context);
if (mSideLabels) {
return new QSTileViewHorizontal(context, icon, collapsedView); return new QSTileViewHorizontal(context, icon, collapsedView);
} else if (collapsedView) {
return new QSTileBaseView(context, icon, collapsedView);
} else {
return new com.android.systemui.qs.tileimpl.QSTileView(context, icon);
}
} }
} }

View File

@@ -66,9 +66,9 @@ import com.android.systemui.plugins.qs.QSIconView;
import com.android.systemui.plugins.qs.QSTile; import com.android.systemui.plugins.qs.QSTile;
import com.android.systemui.plugins.qs.QSTile.State; import com.android.systemui.plugins.qs.QSTile.State;
import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.qs.PagedTileLayout.TilePage;
import com.android.systemui.qs.QSEvent; import com.android.systemui.qs.QSEvent;
import com.android.systemui.qs.QSHost; import com.android.systemui.qs.QSHost;
import com.android.systemui.qs.SideLabelTileLayout;
import com.android.systemui.qs.logging.QSLogger; import com.android.systemui.qs.logging.QSLogger;
import java.io.FileDescriptor; import java.io.FileDescriptor;
@@ -497,7 +497,7 @@ public abstract class QSTileImpl<TState extends State> implements QSTile, Lifecy
private void updateIsFullQs() { private void updateIsFullQs() {
for (Object listener : mListeners) { for (Object listener : mListeners) {
if (TilePage.class.equals(listener.getClass())) { if (SideLabelTileLayout.class.equals(listener.getClass())) {
mIsFullQs = 1; mIsFullQs = 1;
return; return;
} }

View File

@@ -53,11 +53,6 @@ public class FeatureFlags {
return mFlagReader.isEnabled(R.bool.flag_notification_twocolumn); return mFlagReader.isEnabled(R.bool.flag_notification_twocolumn);
} }
// Does not support runtime changes
public boolean isQSLabelsEnabled() {
return mFlagReader.isEnabled(R.bool.flag_qs_labels);
}
public boolean isKeyguardLayoutEnabled() { public boolean isKeyguardLayoutEnabled() {
return mFlagReader.isEnabled(R.bool.flag_keyguard_layout); return mFlagReader.isEnabled(R.bool.flag_keyguard_layout);
} }

View File

@@ -81,7 +81,7 @@ public class QSPanelTest extends SysuiTestCase {
mTestableLooper.runWithLooper(() -> { mTestableLooper.runWithLooper(() -> {
mQsPanel = new QSPanel(mContext, null); mQsPanel = new QSPanel(mContext, null);
mQsPanel.initialize(false); mQsPanel.initialize();
mQsPanel.onFinishInflate(); mQsPanel.onFinishInflate();
// Provides a parent with non-zero size for QSPanel // Provides a parent with non-zero size for QSPanel
mParentView = new FrameLayout(mContext); mParentView = new FrameLayout(mContext);

View File

@@ -49,7 +49,7 @@ public class TileAdapterTest extends SysuiTestCase {
MockitoAnnotations.initMocks(this); MockitoAnnotations.initMocks(this);
TestableLooper.get(this).runWithLooper(() -> mTileAdapter = TestableLooper.get(this).runWithLooper(() -> mTileAdapter =
new TileAdapter(mContext, mQSTileHost, new UiEventLoggerFake(), /* qsFlag */false)); new TileAdapter(mContext, mQSTileHost, new UiEventLoggerFake()));
} }
@Test @Test