summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael W <baddaemon87@gmail.com>2020-06-20 16:05:40 +0200
committerMichael W <baddaemon87@gmail.com>2020-06-23 16:43:57 +0200
commitd6c4b2398721e6f77dd3c1ffcd28e755b60596c8 (patch)
tree1d8b0729cbf2f9826450bcf8ad7f97bbd8731242
parent027d8103d43b4fde345267541103cff2266a2471 (diff)
downloadandroid_frameworks_base-lineage-17.1.tar.gz
android_frameworks_base-lineage-17.1.tar.bz2
android_frameworks_base-lineage-17.1.zip
SystemUI: QS Details: Fix layout issueslineage-17.1
* Remove bottom padding: * It shifts the content up unnecessarily * It leaves a small white line at the bottom * Introduce a new background color for the switch bar: derived from textColorPrimary because that is basically the exact opposite of the background color so it allows us to get a slightly brighter overlay * Also change the qs detail's background: use the same color as for the rest of the qs backgrounds - now it doesn't look different from the rest anymore (was a slightly darker shade of white on light theme and a brighter grey on dark. This was more noticeable on a dark theme and is basically also the reason that we noticed the wrong padding * For zen tile (dnd), remove all background color references and apply qs_background_primary for the whole panel at once. Applying the color manually is required because the panel is inflated separately and not using the color that is assigned to the original content. Removing all separate references allows to define and change the color in one place * In order to make the buttons also look good on dark background, assign a color (similar to the one for the switchbar, see above) manually * Also remove the min height and add top/bottom paddings so the buttons are not as huge as currently * Remove start and end padding from QS detail header xml, because they are a) a mixture of left and end, which should really be start/end or left/right b) Not used anymore, as QSDetail.java applies them in onApplyWindowInsets programmatically The alpha values of 5% and 8% for our newly defined colors were determined by trying various values until it looked good on all themes Test: Open every qs tile on both light and dark themes and see if they look proper Change-Id: I5be8bf97582e877bdb1af1f3aedc88c00d134c16
-rw-r--r--packages/SystemUI/res/color/qs_header_background.xml20
-rw-r--r--packages/SystemUI/res/color/segmented_button_background.xml20
-rw-r--r--packages/SystemUI/res/drawable/qs_detail_background.xml4
-rw-r--r--packages/SystemUI/res/drawable/qs_detail_toolbar.xml2
-rw-r--r--packages/SystemUI/res/drawable/segmented_buttons_background.xml2
-rw-r--r--packages/SystemUI/res/layout/qs_detail.xml1
-rw-r--r--packages/SystemUI/res/layout/qs_detail_header.xml2
-rw-r--r--packages/SystemUI/res/layout/segmented_button.xml3
-rw-r--r--packages/SystemUI/res/layout/zen_mode_panel.xml9
9 files changed, 50 insertions, 13 deletions
diff --git a/packages/SystemUI/res/color/qs_header_background.xml b/packages/SystemUI/res/color/qs_header_background.xml
new file mode 100644
index 00000000000..8019b8dbb5c
--- /dev/null
+++ b/packages/SystemUI/res/color/qs_header_background.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2017 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:alpha="0.05"
+ android:color="?android:attr/textColorPrimary"/>
+</selector>
diff --git a/packages/SystemUI/res/color/segmented_button_background.xml b/packages/SystemUI/res/color/segmented_button_background.xml
new file mode 100644
index 00000000000..2f7011c5884
--- /dev/null
+++ b/packages/SystemUI/res/color/segmented_button_background.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2020 The LineageOS 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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:alpha="0.08"
+ android:color="?android:attr/textColorPrimary"/>
+</selector>
diff --git a/packages/SystemUI/res/drawable/qs_detail_background.xml b/packages/SystemUI/res/drawable/qs_detail_background.xml
index 672abf14774..4ba78504765 100644
--- a/packages/SystemUI/res/drawable/qs_detail_background.xml
+++ b/packages/SystemUI/res/drawable/qs_detail_background.xml
@@ -25,9 +25,9 @@ Copyright (C) 2014 The Android Open Source Project
<item>
<inset>
<shape>
- <solid android:color="?android:attr/colorPrimary"/>
+ <solid android:color="@color/qs_background_dark"/>
<corners android:radius="?android:attr/dialogCornerRadius" />
</shape>
</inset>
</item>
-</transition> \ No newline at end of file
+</transition>
diff --git a/packages/SystemUI/res/drawable/qs_detail_toolbar.xml b/packages/SystemUI/res/drawable/qs_detail_toolbar.xml
index 557cae15030..df0b4e13c01 100644
--- a/packages/SystemUI/res/drawable/qs_detail_toolbar.xml
+++ b/packages/SystemUI/res/drawable/qs_detail_toolbar.xml
@@ -15,7 +15,7 @@
-->
<inset xmlns:android="http://schemas.android.com/apk/res/android">
<shape>
- <solid android:color="?android:attr/colorSecondary"/>
+ <solid android:color="@color/qs_header_background"/>
<corners
android:topLeftRadius="?android:attr/dialogCornerRadius"
android:topRightRadius="?android:attr/dialogCornerRadius" />
diff --git a/packages/SystemUI/res/drawable/segmented_buttons_background.xml b/packages/SystemUI/res/drawable/segmented_buttons_background.xml
index 755c917cf20..c9cf30af5d6 100644
--- a/packages/SystemUI/res/drawable/segmented_buttons_background.xml
+++ b/packages/SystemUI/res/drawable/segmented_buttons_background.xml
@@ -17,6 +17,6 @@
<corners android:radius="@dimen/borderless_button_radius" />
- <solid android:color="?android:attr/colorPrimaryDark" />
+ <solid android:color="@color/segmented_button_background" />
</shape>
diff --git a/packages/SystemUI/res/layout/qs_detail.xml b/packages/SystemUI/res/layout/qs_detail.xml
index ab44c9de297..ca24ac28dd1 100644
--- a/packages/SystemUI/res/layout/qs_detail.xml
+++ b/packages/SystemUI/res/layout/qs_detail.xml
@@ -21,7 +21,6 @@
android:layout_height="match_parent"
android:clickable="true"
android:orientation="vertical"
- android:paddingBottom="8dp"
android:visibility="invisible"
android:elevation="4dp"
android:importantForAccessibility="no" >
diff --git a/packages/SystemUI/res/layout/qs_detail_header.xml b/packages/SystemUI/res/layout/qs_detail_header.xml
index f3feda45547..629e938f946 100644
--- a/packages/SystemUI/res/layout/qs_detail_header.xml
+++ b/packages/SystemUI/res/layout/qs_detail_header.xml
@@ -18,10 +18,8 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/qs_detail_header_padding"
android:paddingTop="@dimen/qs_detail_items_padding_top"
android:paddingBottom="@dimen/qs_detail_items_padding_top"
- android:paddingEnd="@dimen/qs_panel_padding"
android:background="@drawable/qs_detail_toolbar"
android:orientation="vertical"
android:gravity="center">
diff --git a/packages/SystemUI/res/layout/segmented_button.xml b/packages/SystemUI/res/layout/segmented_button.xml
index 9e1f373a6e7..6c6957f912d 100644
--- a/packages/SystemUI/res/layout/segmented_button.xml
+++ b/packages/SystemUI/res/layout/segmented_button.xml
@@ -25,4 +25,5 @@
android:textColor="@color/segmented_button_text_selector"
android:background="@drawable/btn_borderless_rect"
android:textAppearance="@style/TextAppearance.QS.SegmentedButton"
- android:minHeight="72dp" />
+ android:paddingTop="8dp"
+ android:paddingBottom="8dp" />
diff --git a/packages/SystemUI/res/layout/zen_mode_panel.xml b/packages/SystemUI/res/layout/zen_mode_panel.xml
index 58624135b85..66d5b600ba2 100644
--- a/packages/SystemUI/res/layout/zen_mode_panel.xml
+++ b/packages/SystemUI/res/layout/zen_mode_panel.xml
@@ -15,17 +15,18 @@
limitations under the License.
-->
<!-- extends LinearLayout -->
-<com.android.systemui.volume.ZenModePanel xmlns:android="http://schemas.android.com/apk/res/android"
+<com.android.systemui.volume.ZenModePanel
+ xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/zen_mode_panel"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:clipChildren="false" >
+ android:clipChildren="false"
+ android:background="@drawable/qs_background_primary">
<LinearLayout
android:id="@+id/edit_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="?android:attr/colorPrimary"
android:clipChildren="false"
android:orientation="vertical">
@@ -129,7 +130,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
- android:background="?android:attr/colorPrimary"
android:gravity="center"
android:orientation="vertical">
@@ -152,7 +152,6 @@
android:id="@+id/auto_rule"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="?android:attr/colorPrimary"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="16dp"