Remove QS flag
Completely remove the flag and clean up old layouts and some old code. Test: manual Bug: 185250134 Change-Id: I539de8f3a80814b2e386d7ebbf7013d4f60ef67e
This commit is contained in:
@@ -45,8 +45,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:paddingLeft="@dimen/qs_tile_layout_margin_side"
|
||||
android:paddingRight="@dimen/qs_tile_layout_margin_side"
|
||||
android:paddingBottom="28dp"
|
||||
android:clipToPadding="false"
|
||||
android:scrollIndicators="top"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?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");
|
||||
** you may not use this file except in compliance with the License.
|
||||
@@ -16,8 +16,7 @@
|
||||
-->
|
||||
|
||||
<!-- Extends FrameLayout -->
|
||||
<com.android.systemui.qs.QSFooterView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<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"
|
||||
@@ -32,77 +31,70 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="end" >
|
||||
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.keyguard.AlphaOptimizedLinearLayout
|
||||
android:id="@+id/qs_footer_actions_edit_container"
|
||||
android:layout_width="@integer/qs_footer_actions_width"
|
||||
android:layout_height="match_parent"
|
||||
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_width="0dp"
|
||||
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: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
|
||||
android:id="@+id/build"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:focusable="true"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
android:textAppearance="@style/TextAppearance.QS.Status"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:visibility="gone"/>
|
||||
</com.android.keyguard.AlphaOptimizedLinearLayout>
|
||||
|
||||
<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" />
|
||||
|
||||
<com.android.keyguard.AlphaOptimizedLinearLayout
|
||||
android:id="@+id/qs_footer_actions_container"
|
||||
android:layout_width="@integer/qs_footer_actions_width"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="@integer/qs_footer_actions_weight"
|
||||
android:gravity="center_vertical|end" >
|
||||
|
||||
<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="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:clickable="true"
|
||||
android:clipToPadding="false"
|
||||
android:contentDescription="@string/accessibility_quick_settings_power_menu"
|
||||
android:focusable="true"
|
||||
android:padding="@dimen/qs_footer_icon_padding"
|
||||
android:src="@*android:drawable/ic_lock_power_off"
|
||||
android:tint="?android:attr/colorForeground"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
android:tint="?android:attr/colorForeground" />
|
||||
|
||||
<com.android.systemui.statusbar.phone.MultiUserSwitch
|
||||
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_alignParentEnd="true"
|
||||
android:background="@drawable/ripple_drawable"
|
||||
android:layout_marginEnd="@dimen/qs_tile_margin_horizontal"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/qs_footer_action_chip_background"
|
||||
android:focusable="true">
|
||||
|
||||
<ImageView
|
||||
@@ -110,40 +102,58 @@
|
||||
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"/>
|
||||
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_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"
|
||||
style="@android:style/Widget.Material.Button.Borderless"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="@dimen/qs_footer_action_button_size"
|
||||
android:layout_gravity="center"
|
||||
android:padding="@dimen/qs_footer_icon_padding"
|
||||
android:background="@drawable/ripple_drawable"
|
||||
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:tint="?android:attr/colorForeground"/>
|
||||
android:src="@drawable/ic_settings"
|
||||
android:tint="?android:attr/colorForeground" />
|
||||
|
||||
<com.android.systemui.statusbar.AlphaOptimizedImageView
|
||||
android:id="@+id/tuner_icon"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingStart="36dp"
|
||||
android:paddingEnd="4dp"
|
||||
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"/>
|
||||
android:visibility="invisible" />
|
||||
|
||||
</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>
|
||||
|
||||
</com.android.systemui.qs.QSFooterView>
|
||||
|
||||
@@ -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>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?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");
|
||||
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
|
||||
limitations under the License.
|
||||
-->
|
||||
<view
|
||||
class="com.android.systemui.qs.PagedTileLayout$TilePage"
|
||||
<com.android.systemui.qs.SideLabelTileLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/tile_page"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -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" />
|
||||
@@ -1,6 +1,6 @@
|
||||
<?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");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -22,5 +22,4 @@
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:clipChildren="true"
|
||||
android:paddingBottom="@dimen/qs_paged_tile_layout_padding_bottom">
|
||||
</com.android.systemui.qs.PagedTileLayout>
|
||||
android:paddingBottom="@dimen/qs_paged_tile_layout_padding_bottom" />
|
||||
|
||||
@@ -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" />
|
||||
@@ -43,10 +43,7 @@
|
||||
android:background="@android:color/transparent"
|
||||
android:focusable="true"
|
||||
android:accessibilityTraversalBefore="@android:id/edit">
|
||||
<ViewStub
|
||||
android:id="@+id/qs_footer_stub"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
<include layout="@layout/qs_footer_impl" />
|
||||
<include layout="@layout/qs_media_divider"
|
||||
android:id="@+id/divider"/>
|
||||
</com.android.systemui.qs.QSPanel>
|
||||
|
||||
@@ -176,10 +176,6 @@
|
||||
<attr name="android:alpha" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="PagedTileLayout">
|
||||
<attr name="sideLabels" format="boolean"/>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="CropView">
|
||||
<attr name="handleThickness" />
|
||||
<attr name="handleColor" />
|
||||
|
||||
@@ -28,8 +28,6 @@
|
||||
<!-- b/171917882 -->
|
||||
<bool name="flag_notification_twocolumn">false</bool>
|
||||
|
||||
<bool name="flag_qs_labels">true</bool>
|
||||
|
||||
<!-- AOD/Lockscreen alternate layout -->
|
||||
<bool name="flag_keyguard_layout">false</bool>
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import android.animation.PropertyValuesHolder;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
import android.util.AttributeSet;
|
||||
@@ -71,8 +70,6 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
|
||||
private int mMinRows = 1;
|
||||
private int mMaxColumns = TileLayout.NO_MAX_COLUMNS;
|
||||
|
||||
private final boolean mSideLabels;
|
||||
|
||||
public PagedTileLayout(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
mScroller = new Scroller(context, SCROLL_CUBIC);
|
||||
@@ -83,14 +80,9 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
|
||||
mLayoutDirection = getLayoutDirection();
|
||||
mClippingRect = new Rect();
|
||||
|
||||
TypedArray t = context.getTheme().obtainStyledAttributes(
|
||||
attrs, R.styleable.PagedTileLayout, 0, 0);
|
||||
mSideLabels = t.getBoolean(R.styleable.PagedTileLayout_sideLabels, false);
|
||||
t.recycle();
|
||||
if (mSideLabels) {
|
||||
setPageMargin(context.getResources().getDimensionPixelOffset(
|
||||
// Make sure there's a space between pages when scroling
|
||||
setPageMargin(context.getResources().getDimensionPixelOffset(
|
||||
R.dimen.qs_tile_margin_horizontal));
|
||||
}
|
||||
}
|
||||
private int mLastMaxHeight = -1;
|
||||
|
||||
@@ -228,8 +220,7 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
|
||||
|
||||
private TileLayout createTileLayout() {
|
||||
TileLayout page = (TileLayout) LayoutInflater.from(getContext())
|
||||
.inflate(mSideLabels ? R.layout.qs_paged_page_side_labels
|
||||
: R.layout.qs_paged_page, this, false);
|
||||
.inflate(R.layout.qs_paged_page, this, false);
|
||||
page.setMinRows(mMinRows);
|
||||
page.setMaxColumns(mMaxColumns);
|
||||
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
|
||||
// hidden.
|
||||
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,
|
||||
getContext().getResources().getDimensionPixelSize(
|
||||
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() {
|
||||
@Override
|
||||
public void destroyItem(ViewGroup container, int position, Object object) {
|
||||
|
||||
@@ -33,7 +33,6 @@ import com.android.systemui.qs.TouchAnimator.Listener;
|
||||
import com.android.systemui.qs.dagger.QSScope;
|
||||
import com.android.systemui.qs.tileimpl.HeightOverrideable;
|
||||
import com.android.systemui.statusbar.CrossFadeHelper;
|
||||
import com.android.systemui.statusbar.FeatureFlags;
|
||||
import com.android.systemui.tuner.TunerService;
|
||||
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 TunerService mTunerService;
|
||||
private boolean mShowCollapsedOnKeyguard;
|
||||
private final FeatureFlags mFeatureFlags;
|
||||
|
||||
@Inject
|
||||
public QSAnimator(QS qs, QuickQSPanel quickPanel, QuickStatusBarHeader quickStatusBarHeader,
|
||||
QSPanelController qsPanelController,
|
||||
QuickQSPanelController quickQSPanelController, QSTileHost qsTileHost,
|
||||
QSSecurityFooter securityFooter, @Main Executor executor, TunerService tunerService,
|
||||
FeatureFlags featureFlags, QSExpansionPathInterpolator qsExpansionPathInterpolator) {
|
||||
QSExpansionPathInterpolator qsExpansionPathInterpolator) {
|
||||
mQs = qs;
|
||||
mQuickQsPanel = quickPanel;
|
||||
mQsPanelController = qsPanelController;
|
||||
@@ -119,7 +117,6 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
|
||||
mHost = qsTileHost;
|
||||
mExecutor = executor;
|
||||
mTunerService = tunerService;
|
||||
mFeatureFlags = featureFlags;
|
||||
mQSExpansionPathInterpolator = qsExpansionPathInterpolator;
|
||||
mHost.addCallback(this);
|
||||
mQsPanelController.addOnAttachStateChangeListener(this);
|
||||
@@ -247,7 +244,6 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
|
||||
+ mQs.getHeader().getPaddingBottom();
|
||||
firstPageBuilder.addFloat(tileLayout, "translationY", heightDiff, 0);
|
||||
|
||||
boolean qsSideLabelsEnabled = mFeatureFlags.isQSLabelsEnabled();
|
||||
int qqsTileHeight = 0;
|
||||
|
||||
if (mQsPanelController.areThereTiles()) {
|
||||
@@ -275,22 +271,19 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
|
||||
if (count < tileLayout.getNumVisibleTiles()) {
|
||||
getRelativePosition(loc1, quickTileView, view);
|
||||
getRelativePosition(loc2, tileView, view);
|
||||
int yOffset = qsSideLabelsEnabled
|
||||
? loc2[1] - loc1[1]
|
||||
: mQuickStatusBarHeader.getOffsetTranslation();
|
||||
int yOffset = loc2[1] - loc1[1];
|
||||
// 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);
|
||||
translationYBuilder.addFloat(v, "translationY", 0, yDiff - yOffset);
|
||||
mAllViews.add(v);
|
||||
|
||||
// Move the real tile from the quick tile position to its final
|
||||
// location.
|
||||
v = qsSideLabelsEnabled ? tileIcon : tileView;
|
||||
v = tileIcon;
|
||||
translationXBuilder.addFloat(v, "translationX", -xDiff, 0);
|
||||
translationYBuilder.addFloat(v, "translationY", -yDiff + yOffset, 0);
|
||||
|
||||
if (qsSideLabelsEnabled) {
|
||||
// Offset the translation animation on the views
|
||||
// (that goes from 0 to getOffsetTranslation)
|
||||
int offsetWithQSBHTranslation =
|
||||
@@ -300,28 +293,24 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
|
||||
translationYBuilder.addFloat(tileView, "translationY",
|
||||
-offsetWithQSBHTranslation, 0);
|
||||
|
||||
if (mQQSTileHeightAnimator == null) {
|
||||
mQQSTileHeightAnimator = new HeightExpansionAnimator(this,
|
||||
quickTileView.getHeight(), tileView.getHeight());
|
||||
qqsTileHeight = quickTileView.getHeight();
|
||||
}
|
||||
|
||||
mQQSTileHeightAnimator.addView(quickTileView);
|
||||
View qqsLabelContainer = quickTileView.getLabelContainer();
|
||||
View qsLabelContainer = tileView.getLabelContainer();
|
||||
|
||||
getRelativePosition(loc1, qqsLabelContainer, view);
|
||||
getRelativePosition(loc2, qsLabelContainer, view);
|
||||
yDiff = loc2[1] - loc1[1] - yOffset;
|
||||
|
||||
translationYBuilder.addFloat(qqsLabelContainer, "translationY", 0,
|
||||
yDiff);
|
||||
translationYBuilder.addFloat(qsLabelContainer, "translationY", -yDiff,
|
||||
0);
|
||||
mAllViews.add(qqsLabelContainer);
|
||||
mAllViews.add(qsLabelContainer);
|
||||
if (mQQSTileHeightAnimator == null) {
|
||||
mQQSTileHeightAnimator = new HeightExpansionAnimator(this,
|
||||
quickTileView.getHeight(), tileView.getHeight());
|
||||
qqsTileHeight = quickTileView.getHeight();
|
||||
}
|
||||
|
||||
mQQSTileHeightAnimator.addView(quickTileView);
|
||||
View qqsLabelContainer = quickTileView.getLabelContainer();
|
||||
View qsLabelContainer = tileView.getLabelContainer();
|
||||
|
||||
getRelativePosition(loc1, qqsLabelContainer, view);
|
||||
getRelativePosition(loc2, qsLabelContainer, view);
|
||||
yDiff = loc2[1] - loc1[1] - yOffset;
|
||||
|
||||
translationYBuilder.addFloat(qqsLabelContainer, "translationY", 0, yDiff);
|
||||
translationYBuilder.addFloat(qsLabelContainer, "translationY", -yDiff, 0);
|
||||
mAllViews.add(qqsLabelContainer);
|
||||
mAllViews.add(qsLabelContainer);
|
||||
} else { // These tiles disappear when expanding
|
||||
firstPageBuilder.addFloat(quickTileView, "alpha", 1, 0);
|
||||
translationYBuilder.addFloat(quickTileView, "translationY", 0, yDiff);
|
||||
@@ -333,11 +322,7 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
|
||||
translationX);
|
||||
}
|
||||
|
||||
if (qsSideLabelsEnabled) {
|
||||
mQuickQsViews.add(tileView);
|
||||
} else {
|
||||
mQuickQsViews.add(tileView.getIconWithBackground());
|
||||
}
|
||||
mQuickQsViews.add(tileView);
|
||||
mAllViews.add(tileView.getIcon());
|
||||
mAllViews.add(quickTileView);
|
||||
} else if (mFullRows && isIconInAnimatedRow(count)) {
|
||||
@@ -346,27 +331,22 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
|
||||
|
||||
mAllViews.add(tileIcon);
|
||||
} else {
|
||||
if (!qsSideLabelsEnabled) {
|
||||
firstPageBuilder.addFloat(tileView, "alpha", 0, 1);
|
||||
firstPageBuilder.addFloat(tileView, "translationY", -heightDiff, 0);
|
||||
} else {
|
||||
// Pretend there's a corresponding QQS tile (for the position) that we are
|
||||
// expanding from.
|
||||
SideLabelTileLayout qqsLayout =
|
||||
(SideLabelTileLayout) mQuickQsPanel.getTileLayout();
|
||||
getRelativePosition(loc1, qqsLayout, view);
|
||||
getRelativePosition(loc2, tileView, view);
|
||||
int diff = loc2[1] - (loc1[1] + qqsLayout.getPhantomTopPosition(count));
|
||||
translationYBuilder.addFloat(tileView, "translationY", -diff, 0);
|
||||
if (mOtherTilesExpandAnimator == null) {
|
||||
mOtherTilesExpandAnimator =
|
||||
new HeightExpansionAnimator(
|
||||
this, qqsTileHeight, tileView.getHeight());
|
||||
}
|
||||
mOtherTilesExpandAnimator.addView(tileView);
|
||||
tileView.setClipChildren(true);
|
||||
tileView.setClipToPadding(true);
|
||||
// Pretend there's a corresponding QQS tile (for the position) that we are
|
||||
// expanding from.
|
||||
SideLabelTileLayout qqsLayout =
|
||||
(SideLabelTileLayout) mQuickQsPanel.getTileLayout();
|
||||
getRelativePosition(loc1, qqsLayout, view);
|
||||
getRelativePosition(loc2, tileView, view);
|
||||
int diff = loc2[1] - (loc1[1] + qqsLayout.getPhantomTopPosition(count));
|
||||
translationYBuilder.addFloat(tileView, "translationY", -diff, 0);
|
||||
if (mOtherTilesExpandAnimator == null) {
|
||||
mOtherTilesExpandAnimator =
|
||||
new HeightExpansionAnimator(
|
||||
this, qqsTileHeight, tileView.getHeight());
|
||||
}
|
||||
mOtherTilesExpandAnimator.addView(tileView);
|
||||
tileView.setClipChildren(true);
|
||||
tileView.setClipToPadding(true);
|
||||
}
|
||||
|
||||
mAllViews.add(tileView);
|
||||
@@ -392,7 +372,6 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
|
||||
.build();
|
||||
// Fade in the tiles/labels as we reach the final position.
|
||||
Builder builder = new Builder()
|
||||
.setStartDelay(qsSideLabelsEnabled ? 0 : EXPANDED_TILE_DELAY)
|
||||
.addFloat(tileLayout, "alpha", 0, 1);
|
||||
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
|
||||
private boolean isAPage(View view) {
|
||||
if (view instanceof PagedTileLayout.TilePage) {
|
||||
return true;
|
||||
} else if (view instanceof SideLabelTileLayout) {
|
||||
return !(view instanceof QuickQSPanel.QQSSideLabelTileLayout);
|
||||
}
|
||||
return false;
|
||||
return view.getClass().equals(SideLabelTileLayout.class);
|
||||
}
|
||||
|
||||
public void setPosition(float position) {
|
||||
|
||||
@@ -22,7 +22,6 @@ import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Point;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Pair;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
@@ -288,9 +287,6 @@ public class QSContainerImpl extends FrameLayout {
|
||||
if (view == mQSPanelContainer) {
|
||||
// QS panel lays out some of its content full width
|
||||
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) {
|
||||
// The header contains the QQS panel which needs to have special padding, to
|
||||
// visually align them.
|
||||
|
||||
@@ -71,7 +71,6 @@ public class QSFooterView extends FrameLayout {
|
||||
private float mExpansionAmount;
|
||||
|
||||
protected View mEdit;
|
||||
protected View mEditContainer;
|
||||
private TouchAnimator mSettingsCogAnimator;
|
||||
|
||||
private View mActionsContainer;
|
||||
@@ -107,7 +106,6 @@ public class QSFooterView extends FrameLayout {
|
||||
mMultiUserAvatar = mMultiUserSwitch.findViewById(R.id.multi_user_avatar);
|
||||
|
||||
mActionsContainer = requireViewById(R.id.qs_footer_actions_container);
|
||||
mEditContainer = findViewById(R.id.qs_footer_actions_edit_container);
|
||||
mBuildText = findViewById(R.id.build);
|
||||
mTunerIcon = requireViewById(R.id.tuner_icon);
|
||||
|
||||
@@ -185,9 +183,6 @@ public class QSFooterView extends FrameLayout {
|
||||
.addFloat(mPageIndicator, "alpha", 0, 1)
|
||||
.addFloat(mBuildText, "alpha", 0, 1)
|
||||
.setStartDelay(0.9f);
|
||||
if (mEditContainer != null) {
|
||||
builder.addFloat(mEditContainer, "alpha", 0, 1);
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
@@ -283,9 +278,6 @@ public class QSFooterView extends FrameLayout {
|
||||
mTunerIcon.setVisibility(isTunerEnabled ? View.VISIBLE : View.INVISIBLE);
|
||||
final boolean isDemo = UserManager.isDeviceInDemoMode(mContext);
|
||||
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);
|
||||
|
||||
mBuildText.setVisibility(mExpanded && mShouldShowBuildText ? View.VISIBLE : View.GONE);
|
||||
|
||||
@@ -27,12 +27,10 @@ import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Pair;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewStub;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.android.internal.logging.UiEventLogger;
|
||||
@@ -72,8 +70,6 @@ public class QSPanel extends LinearLayout implements Tunable {
|
||||
private final H mHandler = new H();
|
||||
/** Whether or not the QS media player feature is enabled. */
|
||||
protected boolean mUsingMediaPlayer;
|
||||
private int mVisualMarginStart;
|
||||
private int mVisualMarginEnd;
|
||||
|
||||
protected boolean mExpanded;
|
||||
protected boolean mListening;
|
||||
@@ -96,7 +92,6 @@ public class QSPanel extends LinearLayout implements Tunable {
|
||||
private PageIndicator mFooterPageIndicator;
|
||||
private int mContentMarginStart;
|
||||
private int mContentMarginEnd;
|
||||
private int mVisualTilePadding;
|
||||
private boolean mUsingHorizontalLayout;
|
||||
|
||||
private Record mDetailRecord;
|
||||
@@ -111,9 +106,7 @@ public class QSPanel extends LinearLayout implements Tunable {
|
||||
protected QSTileLayout mTileLayout;
|
||||
private int mLastOrientation = -1;
|
||||
private int mMediaTotalBottomMargin;
|
||||
private int mFooterMarginStartHorizontal;
|
||||
private Consumer<Boolean> mMediaVisibilityChangedListener;
|
||||
protected boolean mSideLabels;
|
||||
|
||||
public QSPanel(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
@@ -128,21 +121,7 @@ public class QSPanel extends LinearLayout implements Tunable {
|
||||
|
||||
}
|
||||
|
||||
protected void inflateQSFooter(boolean newFooter) {
|
||||
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);
|
||||
|
||||
void initialize() {
|
||||
mRegularTileLayout = createRegularTileLayout();
|
||||
mTileLayout = mRegularTileLayout;
|
||||
|
||||
@@ -195,8 +174,7 @@ public class QSPanel extends LinearLayout implements Tunable {
|
||||
public QSTileLayout createRegularTileLayout() {
|
||||
if (mRegularTileLayout == null) {
|
||||
mRegularTileLayout = (QSTileLayout) LayoutInflater.from(mContext)
|
||||
.inflate(mSideLabels ? R.layout.qs_paged_tile_layout_side_labels
|
||||
: R.layout.qs_paged_tile_layout, this, false);
|
||||
.inflate(R.layout.qs_paged_tile_layout, this, false);
|
||||
}
|
||||
return mRegularTileLayout;
|
||||
}
|
||||
@@ -311,11 +289,6 @@ public class QSPanel extends LinearLayout implements Tunable {
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
updatePageIndicator();
|
||||
@@ -358,6 +331,7 @@ public class QSPanel extends LinearLayout implements Tunable {
|
||||
@Override
|
||||
protected void onFinishInflate() {
|
||||
super.onFinishInflate();
|
||||
mFooter = findViewById(R.id.qs_footer);
|
||||
mDivider = findViewById(R.id.divider);
|
||||
}
|
||||
|
||||
@@ -638,60 +612,10 @@ public class QSPanel extends LinearLayout implements Tunable {
|
||||
// to the edge like the brightness slider
|
||||
mContentMarginStart = startMargin;
|
||||
mContentMarginEnd = endMargin;
|
||||
updateTileLayoutMargins(mContentMarginStart - mVisualTilePadding,
|
||||
mContentMarginEnd - mVisualTilePadding);
|
||||
updateMediaHostContentMargins(mediaHostView);
|
||||
updateFooterMargin();
|
||||
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() {
|
||||
if (mDivider == null) return;
|
||||
updateMargins(mDivider, mContentMarginStart, mContentMarginEnd);
|
||||
@@ -769,22 +693,13 @@ public class QSPanel extends LinearLayout implements Tunable {
|
||||
newLayout.setListening(mListening, uiEventLogger);
|
||||
if (needsDynamicRowsAndColumns()) {
|
||||
newLayout.setMinRows(horizontal ? 2 : 1);
|
||||
// Let's use 3 columns to match the current layout
|
||||
int columns;
|
||||
if (mSideLabels) {
|
||||
columns = horizontal ? 2 : 4;
|
||||
} else {
|
||||
columns = horizontal ? 3 : TileLayout.NO_MAX_COLUMNS;
|
||||
}
|
||||
newLayout.setMaxColumns(columns);
|
||||
newLayout.setMaxColumns(horizontal ? 2 : 4);
|
||||
}
|
||||
updateMargins(mediaHostView);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateMargins(ViewGroup mediaHostView) {
|
||||
updateTileLayoutMargins();
|
||||
updateFooterMargin();
|
||||
updateDividerMargin();
|
||||
updateMediaHostContentMargins(mediaHostView);
|
||||
updateHorizontalLinearLayoutMargins();
|
||||
|
||||
@@ -22,7 +22,6 @@ import static com.android.systemui.qs.dagger.QSFragmentModule.QS_USING_MEDIA_PLA
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.content.res.Configuration;
|
||||
import android.util.Pair;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
@@ -290,11 +289,6 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
|
||||
mView.setContentMargins(startMargin, endMargin, mMediaHost.getHostView());
|
||||
}
|
||||
|
||||
/** */
|
||||
public Pair<Integer, Integer> getVisualSideMargins() {
|
||||
return mView.getVisualSideMargins();
|
||||
}
|
||||
|
||||
/** */
|
||||
public void showDetailAdapter(DetailAdapter detailAdapter, int x, int y) {
|
||||
mView.showDetailAdapter(true, detailAdapter, new int[]{x, y});
|
||||
|
||||
@@ -75,8 +75,6 @@ public abstract class QSPanelControllerBase<T extends QSPanel> extends ViewContr
|
||||
private float mRevealExpansion;
|
||||
|
||||
private final QSHost.Callback mQSHostCallback = this::setTiles;
|
||||
protected boolean mShowLabels = true;
|
||||
protected boolean mQSLabelFlag;
|
||||
|
||||
private final QSPanel.OnConfigurationChangedListener mOnConfigurationChangedListener =
|
||||
new QSPanel.OnConfigurationChangedListener() {
|
||||
@@ -121,14 +119,13 @@ public abstract class QSPanelControllerBase<T extends QSPanel> extends ViewContr
|
||||
mQSLogger = qsLogger;
|
||||
mDumpManager = dumpManager;
|
||||
mFeatureFlags = featureFlags;
|
||||
mQSLabelFlag = featureFlags.isQSLabelsEnabled();
|
||||
mShouldUseSplitNotificationShade =
|
||||
Utils.shouldUseSplitNotificationShade(mFeatureFlags, getResources());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onInit() {
|
||||
mView.initialize(mQSLabelFlag);
|
||||
mView.initialize();
|
||||
mQSLogger.logAllTilesChangeListening(mView.isListening(), mView.getDumpableTag(), "");
|
||||
}
|
||||
|
||||
|
||||
@@ -50,16 +50,11 @@ public class QuickQSPanel extends QSPanel {
|
||||
}
|
||||
|
||||
@Override
|
||||
void initialize(boolean sideLabels) {
|
||||
super.initialize(sideLabels);
|
||||
void initialize() {
|
||||
super.initialize();
|
||||
applyBottomMargin((View) mRegularTileLayout);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void inflateQSFooter(boolean newFooter) {
|
||||
// No footer
|
||||
}
|
||||
|
||||
private void applyBottomMargin(View view) {
|
||||
int margin = getResources().getDimensionPixelSize(R.dimen.qs_header_tile_margin_bottom);
|
||||
MarginLayoutParams layoutParams = (MarginLayoutParams) view.getLayoutParams();
|
||||
@@ -74,22 +69,14 @@ public class QuickQSPanel extends QSPanel {
|
||||
|
||||
@Override
|
||||
public TileLayout createRegularTileLayout() {
|
||||
if (mSideLabels) {
|
||||
return new QQSSideLabelTileLayout(mContext);
|
||||
} else {
|
||||
return new QuickQSPanel.HeaderTileLayout(mContext);
|
||||
}
|
||||
return new QQSSideLabelTileLayout(mContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected QSTileLayout createHorizontalTileLayout() {
|
||||
if (mSideLabels) {
|
||||
TileLayout t = createRegularTileLayout();
|
||||
t.setMaxColumns(2);
|
||||
return t;
|
||||
} else {
|
||||
return new DoubleLineTileLayout(mContext);
|
||||
}
|
||||
TileLayout t = createRegularTileLayout();
|
||||
t.setMaxColumns(2);
|
||||
return t;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -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. */
|
||||
public void hide(boolean animate) {
|
||||
if (isShown) {
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
|
||||
package com.android.systemui.qs.customize;
|
||||
|
||||
import static com.android.systemui.qs.dagger.QSFlagsModule.QS_LABELS_FLAG;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
@@ -61,7 +59,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
/** */
|
||||
@QSScope
|
||||
@@ -110,25 +107,21 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
|
||||
private final AccessibilityDelegateCompat mAccessibilityDelegate;
|
||||
private RecyclerView mRecyclerView;
|
||||
private int mNumColumns;
|
||||
private final boolean mUseHorizontalTiles;
|
||||
|
||||
@Inject
|
||||
public TileAdapter(
|
||||
@QSThemedContext Context context,
|
||||
QSTileHost qsHost,
|
||||
UiEventLogger uiEventLogger,
|
||||
@Named(QS_LABELS_FLAG) boolean useHorizontalTiles
|
||||
) {
|
||||
UiEventLogger uiEventLogger) {
|
||||
mContext = context;
|
||||
mHost = qsHost;
|
||||
mUiEventLogger = uiEventLogger;
|
||||
mItemTouchHelper = new ItemTouchHelper(mCallbacks);
|
||||
mDecoration = new TileItemDecoration(context);
|
||||
mMarginDecoration = new MarginTileDecoration(!useHorizontalTiles);
|
||||
mMarginDecoration = new MarginTileDecoration();
|
||||
mMinNumTiles = context.getResources().getInteger(R.integer.quick_settings_min_num_tiles);
|
||||
mNumColumns = context.getResources().getInteger(NUM_COLUMNS_ID);
|
||||
mAccessibilityDelegate = new TileAdapterDelegate();
|
||||
mUseHorizontalTiles = useHorizontalTiles;
|
||||
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,
|
||||
false);
|
||||
View view = mUseHorizontalTiles
|
||||
? new CustomizeTileViewHorizontal(context, new QSIconViewImpl(context))
|
||||
: new CustomizeTileView(context, new QSIconViewImpl(context));
|
||||
View view = new CustomizeTileViewHorizontal(context, new QSIconViewImpl(context));
|
||||
frame.addView(view);
|
||||
return new Holder(frame);
|
||||
}
|
||||
@@ -715,11 +706,6 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
|
||||
|
||||
private static class MarginTileDecoration extends ItemDecoration {
|
||||
private int mHalfMargin;
|
||||
private final boolean mUseOutsideMargins;
|
||||
|
||||
private MarginTileDecoration(boolean useOutsideMargins) {
|
||||
mUseOutsideMargins = useOutsideMargins;
|
||||
}
|
||||
|
||||
public void setHalfMargin(int halfMargin) {
|
||||
mHalfMargin = halfMargin;
|
||||
@@ -738,9 +724,9 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
|
||||
if (view instanceof TextView) {
|
||||
super.getItemOffsets(outRect, view, parent, state);
|
||||
} else {
|
||||
if (mUseOutsideMargins || (column != 0 && column != lm.getSpanCount() - 1)) {
|
||||
// Using outside margins or in a column that's not leftmost or rightmost
|
||||
// (half of the margin between columns).
|
||||
if (column != 0 && column != lm.getSpanCount() - 1) {
|
||||
// In a column that's not leftmost or rightmost (half of the margin between
|
||||
// columns).
|
||||
outRect.left = mHalfMargin;
|
||||
outRect.right = mHalfMargin;
|
||||
} else if (column == 0) {
|
||||
|
||||
@@ -30,18 +30,11 @@ import dagger.Provides;
|
||||
|
||||
@Module
|
||||
public interface QSFlagsModule {
|
||||
String QS_LABELS_FLAG = "qs_labels_flag";
|
||||
|
||||
String RBC_AVAILABLE = "rbc_available";
|
||||
String PM_LITE_ENABLED = "pm_lite";
|
||||
String PM_LITE_SETTING = "sysui_pm_lite";
|
||||
|
||||
@Provides
|
||||
@SysUISingleton
|
||||
@Named(QS_LABELS_FLAG)
|
||||
static boolean provideQSFlag(FeatureFlags featureFlags) {
|
||||
return featureFlags.isQSLabelsEnabled();
|
||||
}
|
||||
|
||||
/** */
|
||||
@Provides
|
||||
@SysUISingleton
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
|
||||
package com.android.systemui.qs.tileimpl;
|
||||
|
||||
import static com.android.systemui.qs.dagger.QSFlagsModule.QS_LABELS_FLAG;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
@@ -56,7 +54,6 @@ import com.android.systemui.qs.tiles.WorkModeTile;
|
||||
import com.android.systemui.util.leak.GarbageMonitor;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import javax.inject.Provider;
|
||||
|
||||
import dagger.Lazy;
|
||||
@@ -97,12 +94,9 @@ public class QSFactoryImpl implements QSFactory {
|
||||
private final Lazy<QSHost> mQsHostLazy;
|
||||
private final Provider<CustomTile.Builder> mCustomTileBuilderProvider;
|
||||
|
||||
private final boolean mSideLabels;
|
||||
|
||||
@Inject
|
||||
public QSFactoryImpl(
|
||||
Lazy<QSHost> qsHostLazy,
|
||||
@Named(QS_LABELS_FLAG) boolean useSideLabels,
|
||||
Provider<CustomTile.Builder> customTileBuilderProvider,
|
||||
Provider<WifiTile> wifiTileProvider,
|
||||
Provider<InternetTile> internetTileProvider,
|
||||
@@ -134,8 +128,6 @@ public class QSFactoryImpl implements QSFactory {
|
||||
mQsHostLazy = qsHostLazy;
|
||||
mCustomTileBuilderProvider = customTileBuilderProvider;
|
||||
|
||||
mSideLabels = useSideLabels;
|
||||
|
||||
mWifiTileProvider = wifiTileProvider;
|
||||
mInternetTileProvider = internetTileProvider;
|
||||
mBluetoothTileProvider = bluetoothTileProvider;
|
||||
@@ -251,12 +243,6 @@ public class QSFactoryImpl implements QSFactory {
|
||||
@Override
|
||||
public QSTileView createTileView(Context context, QSTile tile, boolean collapsedView) {
|
||||
QSIconView icon = tile.createTileView(context);
|
||||
if (mSideLabels) {
|
||||
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);
|
||||
}
|
||||
return new QSTileViewHorizontal(context, icon, collapsedView);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.State;
|
||||
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.QSHost;
|
||||
import com.android.systemui.qs.SideLabelTileLayout;
|
||||
import com.android.systemui.qs.logging.QSLogger;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
@@ -497,7 +497,7 @@ public abstract class QSTileImpl<TState extends State> implements QSTile, Lifecy
|
||||
|
||||
private void updateIsFullQs() {
|
||||
for (Object listener : mListeners) {
|
||||
if (TilePage.class.equals(listener.getClass())) {
|
||||
if (SideLabelTileLayout.class.equals(listener.getClass())) {
|
||||
mIsFullQs = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -53,11 +53,6 @@ public class FeatureFlags {
|
||||
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() {
|
||||
return mFlagReader.isEnabled(R.bool.flag_keyguard_layout);
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class QSPanelTest extends SysuiTestCase {
|
||||
|
||||
mTestableLooper.runWithLooper(() -> {
|
||||
mQsPanel = new QSPanel(mContext, null);
|
||||
mQsPanel.initialize(false);
|
||||
mQsPanel.initialize();
|
||||
mQsPanel.onFinishInflate();
|
||||
// Provides a parent with non-zero size for QSPanel
|
||||
mParentView = new FrameLayout(mContext);
|
||||
|
||||
@@ -49,7 +49,7 @@ public class TileAdapterTest extends SysuiTestCase {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
|
||||
TestableLooper.get(this).runWithLooper(() -> mTileAdapter =
|
||||
new TileAdapter(mContext, mQSTileHost, new UiEventLoggerFake(), /* qsFlag */false));
|
||||
new TileAdapter(mContext, mQSTileHost, new UiEventLoggerFake()));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user