Merge "NIU Actions: Support Dark Mode and Landscape" into sc-dev am: f6e138cf21

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14753495

Change-Id: I09352c85b20cdad4b715ba58e7bb783bcf3d3be7
diff --git a/go/quickstep/res/layout/overview_actions_container.xml b/go/quickstep/res/layout/overview_actions_container.xml
index b36214b..e7da196 100644
--- a/go/quickstep/res/layout/overview_actions_container.xml
+++ b/go/quickstep/res/layout/overview_actions_container.xml
@@ -29,10 +29,6 @@
         android:orientation="horizontal">
 
         <Space
-            android:layout_width="@dimen/go_overview_button_width"
-            android:layout_height="1dp" />
-
-        <Space
             android:layout_width="0dp"
             android:layout_height="1dp"
             android:layout_weight="1" />
@@ -50,9 +46,8 @@
         </LinearLayout>
 
         <Space
-            android:layout_width="0dp"
-            android:layout_height="1dp"
-            android:layout_weight="1" />
+            android:layout_width="@dimen/go_overview_button_container_margin"
+            android:layout_height="1dp" />
 
         <LinearLayout
             style="@style/GoOverviewActionButtonContainer">
@@ -68,9 +63,8 @@
         </LinearLayout>
 
         <Space
-            android:layout_width="0dp"
-            android:layout_height="1dp"
-            android:layout_weight="1" />
+            android:layout_width="@dimen/go_overview_button_container_margin"
+            android:layout_height="1dp" />
 
         <LinearLayout
             style="@style/GoOverviewActionButtonContainer">
@@ -90,10 +84,6 @@
             android:layout_height="1dp"
             android:layout_weight="1" />
 
-        <Space
-            android:layout_width="@dimen/go_overview_button_width"
-            android:layout_height="1dp" />
-
         <!-- Will be enabled in a future version. -->
         <LinearLayout
             style="@style/GoOverviewActionButtonContainer"
diff --git a/go/quickstep/res/layout/overview_panel.xml b/go/quickstep/res/layout/overview_panel.xml
new file mode 100644
index 0000000..241b63d
--- /dev/null
+++ b/go/quickstep/res/layout/overview_panel.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+     Copyright (C) 2021 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <com.android.quickstep.views.LauncherRecentsView
+        android:id="@+id/overview_panel"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:accessibilityPaneTitle="@string/accessibility_recent_apps"
+        android:clipChildren="false"
+        android:clipToPadding="false"
+        android:background="?attr/overviewBackgroundColor"
+        android:visibility="invisible" />
+
+    <com.android.quickstep.views.SplitPlaceholderView
+        android:id="@+id/split_placeholder"
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/split_placeholder_size"
+        android:background="@android:color/darker_gray"
+        android:visibility="gone" />
+
+    <include
+        android:id="@+id/overview_actions_view"
+        layout="@layout/overview_actions_container" />
+
+</merge>
diff --git a/go/quickstep/res/values/attrs.xml b/go/quickstep/res/values/attrs.xml
new file mode 100644
index 0000000..3adf462
--- /dev/null
+++ b/go/quickstep/res/values/attrs.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2021 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<resources>
+    <!-- Attributes used for Overview theming -->
+    <attr name="overviewBackgroundColor" format="color" />
+    <attr name="overviewButtonTextColor" format="color" />
+    <attr name="overviewButtonIconColor" format="color" />
+    <attr name="overviewButtonBackgroundColor" format="color" />
+</resources>
\ No newline at end of file
diff --git a/go/quickstep/res/values/colors.xml b/go/quickstep/res/values/colors.xml
index 9383770..f815f54 100644
--- a/go/quickstep/res/values/colors.xml
+++ b/go/quickstep/res/values/colors.xml
@@ -16,6 +16,10 @@
 -->
 <resources>
     <!-- Overview -->
-    <color name="go_overview_button_icon_color">#3C4043</color>
+    <color name="go_overview_background_color">#DADADA</color>
+    <color name="go_overview_background_color_dark">#000000</color>
+    <color name="go_overview_text_color">#3C4043</color>
+    <color name="go_overview_text_color_dark">#F8F9FA</color>
     <color name="go_overview_button_color">#70FFFFFF</color>
+    <color name="go_overview_button_color_dark">#303030</color>
 </resources>
diff --git a/go/quickstep/res/values/dimens.xml b/go/quickstep/res/values/dimens.xml
index da684fa..55cd138 100644
--- a/go/quickstep/res/values/dimens.xml
+++ b/go/quickstep/res/values/dimens.xml
@@ -22,6 +22,7 @@
     <dimen name="go_overview_button_width">60dp</dimen>
     <dimen name="go_overview_button_height">60dp</dimen>
     <dimen name="go_overview_button_container_width">80dp</dimen>
+    <dimen name="go_overview_button_container_margin">16dp</dimen>
     <dimen name="go_overview_button_caption_margin">8dp</dimen>
     <dimen name="overview_actions_height">96dp</dimen>
     <dimen name="overview_proactive_row_height">0dp</dimen>
diff --git a/go/quickstep/res/values/styles.xml b/go/quickstep/res/values/styles.xml
index 9b3fe67..59f7377 100644
--- a/go/quickstep/res/values/styles.xml
+++ b/go/quickstep/res/values/styles.xml
@@ -15,9 +15,25 @@
      limitations under the License.
 -->
 <resources>
+    <!-- App themes -->
+    <style name="AppTheme" parent="@style/LauncherTheme">
+        <item name="overviewBackgroundColor">@color/go_overview_background_color</item>
+        <item name="overviewButtonTextColor">@color/go_overview_text_color</item>
+        <item name="overviewButtonIconColor">@color/go_overview_text_color</item>
+        <item name="overviewButtonBackgroundColor">@color/go_overview_button_color</item>
+    </style>
+
+    <style name="AppTheme.Dark" parent="@style/LauncherTheme.Dark">
+        <item name="overviewBackgroundColor">@color/go_overview_background_color_dark</item>
+        <item name="overviewButtonTextColor">@color/go_overview_text_color_dark</item>
+        <item name="overviewButtonIconColor">@color/go_overview_text_color_dark</item>
+        <item name="overviewButtonBackgroundColor">@color/go_overview_button_color_dark</item>
+    </style>
+
+    <!-- Overview -->
     <style name="GoOverviewActionButton">
-        <item name="android:tint">@color/go_overview_button_icon_color</item>
-        <item name="android:backgroundTint">@color/go_overview_button_color</item>
+        <item name="android:tint">?attr/overviewButtonIconColor</item>
+        <item name="android:backgroundTint">?attr/overviewButtonBackgroundColor</item>
         <item name="android:background">@drawable/round_rect_button</item>
         <item name="android:layout_width">@dimen/go_overview_button_width</item>
         <item name="android:layout_height">@dimen/go_overview_button_height</item>
@@ -27,7 +43,7 @@
     <style name="GoOverviewActionButtonCaption">
         <item name="android:fontFamily">sans-serif-medium</item>
         <item name="android:textSize">14dp</item>
-        <item name="android:textColor">@color/go_overview_button_icon_color</item>
+        <item name="android:textColor">?attr/overviewButtonTextColor</item>
         <item name="android:lineHeight">20dp</item>
         <item name="android:textAlignment">center</item>
         <item name="android:importantForAccessibility">no</item>