Removing the debug header bar icon.
- Repurposing resize button to move tasks between
stacks when freeform is enabled
- Enabling freeform workspaces for supported
devices
- Removing old debug dialog
Bug: 26043230
Bug: 24815256
Change-Id: If3236999dd236de5d5bd665d69edfc17f18f74f0
diff --git a/packages/SystemUI/res/drawable/recents_dismiss_dark.xml b/packages/SystemUI/res/drawable/recents_dismiss_dark.xml
index ba09ebe..951269b 100644
--- a/packages/SystemUI/res/drawable/recents_dismiss_dark.xml
+++ b/packages/SystemUI/res/drawable/recents_dismiss_dark.xml
@@ -19,6 +19,6 @@
android:viewportWidth="48.0"
android:viewportHeight="48.0">
<path
- android:fillColor="@color/recents_task_bar_dark_dismiss_color"
+ android:fillColor="@color/recents_task_bar_dark_icon_color"
android:pathData="M38.000000,12.800000l-2.799999,-2.800000 -11.200001,11.200001 -11.200000,-11.200001 -2.800000,2.800000 11.200001,11.200000 -11.200001,11.200001 2.800000,2.799999 11.200000,-11.200001 11.200001,11.200001 2.799999,-2.799999 -11.200001,-11.200001z"/>
</vector>
\ No newline at end of file
diff --git a/packages/SystemUI/res/drawable/recents_dismiss_light.xml b/packages/SystemUI/res/drawable/recents_dismiss_light.xml
index be0825c..1f44c1c 100644
--- a/packages/SystemUI/res/drawable/recents_dismiss_light.xml
+++ b/packages/SystemUI/res/drawable/recents_dismiss_light.xml
@@ -19,6 +19,6 @@
android:viewportWidth="48.0"
android:viewportHeight="48.0">
<path
- android:fillColor="@color/recents_task_bar_light_dismiss_color"
+ android:fillColor="@color/recents_task_bar_light_icon_color"
android:pathData="M38.000000,12.800000l-2.799999,-2.800000 -11.200001,11.200001 -11.200000,-11.200001 -2.800000,2.800000 11.200001,11.200000 -11.200001,11.200001 2.800000,2.799999 11.200000,-11.200001 11.200001,11.200001 2.799999,-2.799999 -11.200001,-11.200001z"/>
</vector>
\ No newline at end of file
diff --git a/packages/SystemUI/res/drawable/vector_drawable_place_top_left.xml b/packages/SystemUI/res/drawable/recents_move_task_freeform_dark.xml
similarity index 93%
rename from packages/SystemUI/res/drawable/vector_drawable_place_top_left.xml
rename to packages/SystemUI/res/drawable/recents_move_task_freeform_dark.xml
index feb612c..ce07b2d 100644
--- a/packages/SystemUI/res/drawable/vector_drawable_place_top_left.xml
+++ b/packages/SystemUI/res/drawable/recents_move_task_freeform_dark.xml
@@ -19,6 +19,6 @@
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
- android:fillColor="#FF000000"
+ android:fillColor="@color/recents_task_bar_dark_icon_color"
android:pathData="M0.0,0.0l0.0,24.0l24.0,0.0L24.0,0.0L0.0,0.0zM4.0,4.0l10.0,0.0l0.0,10.0L4.0,14.0L4.0,4.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/vector_drawable_place_top_left.xml b/packages/SystemUI/res/drawable/recents_move_task_freeform_light.xml
similarity index 92%
copy from packages/SystemUI/res/drawable/vector_drawable_place_top_left.xml
copy to packages/SystemUI/res/drawable/recents_move_task_freeform_light.xml
index feb612c..bf452ae 100644
--- a/packages/SystemUI/res/drawable/vector_drawable_place_top_left.xml
+++ b/packages/SystemUI/res/drawable/recents_move_task_freeform_light.xml
@@ -19,6 +19,6 @@
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
- android:fillColor="#FF000000"
+ android:fillColor="@color/recents_task_bar_light_icon_color"
android:pathData="M0.0,0.0l0.0,24.0l24.0,0.0L24.0,0.0L0.0,0.0zM4.0,4.0l10.0,0.0l0.0,10.0L4.0,14.0L4.0,4.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/vector_drawable_place_fullscreen.xml b/packages/SystemUI/res/drawable/recents_move_task_fullscreen_dark.xml
similarity index 81%
copy from packages/SystemUI/res/drawable/vector_drawable_place_fullscreen.xml
copy to packages/SystemUI/res/drawable/recents_move_task_fullscreen_dark.xml
index aee0b7f..4160efb 100644
--- a/packages/SystemUI/res/drawable/vector_drawable_place_fullscreen.xml
+++ b/packages/SystemUI/res/drawable/recents_move_task_fullscreen_dark.xml
@@ -19,15 +19,15 @@
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
- android:fillColor="#FF000000"
+ android:fillColor="@color/recents_task_bar_dark_icon_color"
android:pathData="M0.0,8.0l4.0,0.0 0.0,-4.0 4.0,0.0 0.0,-4.0 -8.0,0.0z"/>
<path
- android:fillColor="#FF000000"
+ android:fillColor="@color/recents_task_bar_dark_icon_color"
android:pathData="M4.0,16.0l-4.0,0.0 0.0,8.0 8.0,0.0 0.0,-4.0 -4.0,0.0z"/>
<path
- android:fillColor="#FF000000"
+ android:fillColor="@color/recents_task_bar_dark_icon_color"
android:pathData="M16.0,0.0l0.0,4.0 4.0,0.0 0.0,4.0 4.0,0.0 0.0,-8.0z"/>
<path
- android:fillColor="#FF000000"
+ android:fillColor="@color/recents_task_bar_dark_icon_color"
android:pathData="M20.0,20.0l-4.0,0.0 0.0,4.0 8.0,0.0 0.0,-8.0 -4.0,0.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/vector_drawable_place_fullscreen.xml b/packages/SystemUI/res/drawable/recents_move_task_fullscreen_light.xml
similarity index 81%
rename from packages/SystemUI/res/drawable/vector_drawable_place_fullscreen.xml
rename to packages/SystemUI/res/drawable/recents_move_task_fullscreen_light.xml
index aee0b7f..f424bf6 100644
--- a/packages/SystemUI/res/drawable/vector_drawable_place_fullscreen.xml
+++ b/packages/SystemUI/res/drawable/recents_move_task_fullscreen_light.xml
@@ -19,15 +19,15 @@
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
- android:fillColor="#FF000000"
+ android:fillColor="@color/recents_task_bar_light_icon_color"
android:pathData="M0.0,8.0l4.0,0.0 0.0,-4.0 4.0,0.0 0.0,-4.0 -8.0,0.0z"/>
<path
- android:fillColor="#FF000000"
+ android:fillColor="@color/recents_task_bar_light_icon_color"
android:pathData="M4.0,16.0l-4.0,0.0 0.0,8.0 8.0,0.0 0.0,-4.0 -4.0,0.0z"/>
<path
- android:fillColor="#FF000000"
+ android:fillColor="@color/recents_task_bar_light_icon_color"
android:pathData="M16.0,0.0l0.0,4.0 4.0,0.0 0.0,4.0 4.0,0.0 0.0,-8.0z"/>
<path
- android:fillColor="#FF000000"
+ android:fillColor="@color/recents_task_bar_light_icon_color"
android:pathData="M20.0,20.0l-4.0,0.0 0.0,4.0 8.0,0.0 0.0,-8.0 -4.0,0.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/vector_drawable_place_bottom.xml b/packages/SystemUI/res/drawable/vector_drawable_place_bottom.xml
deleted file mode 100644
index 14f1981..0000000
--- a/packages/SystemUI/res/drawable/vector_drawable_place_bottom.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<!--
-Copyright (C) 2015 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24.0dp"
- android:height="24.0dp"
- android:viewportWidth="24.0"
- android:viewportHeight="24.0">
- <path
- android:fillColor="#FF000000"
- android:pathData="M0.0,0.0l0.0,24.0l24.0,0.0L24.0,0.0L0.0,0.0zM4.0,10.0l16.0,0.0l0.0,10.0L4.0,20.0L4.0,10.0z"/>
-</vector>
diff --git a/packages/SystemUI/res/drawable/vector_drawable_place_bottom_left.xml b/packages/SystemUI/res/drawable/vector_drawable_place_bottom_left.xml
deleted file mode 100644
index cea6324..0000000
--- a/packages/SystemUI/res/drawable/vector_drawable_place_bottom_left.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<!--
-Copyright (C) 2015 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24.0dp"
- android:height="24.0dp"
- android:viewportWidth="24.0"
- android:viewportHeight="24.0">
- <path
- android:fillColor="#FF000000"
- android:pathData="M24.0,24.0L24.0,0.0L0.0,0.0l0.0,24.0L24.0,24.0zM4.0,10.0l10.0,0.0l0.0,10.0L4.0,20.0L4.0,10.0z"/>
-</vector>
diff --git a/packages/SystemUI/res/drawable/vector_drawable_place_bottom_right.xml b/packages/SystemUI/res/drawable/vector_drawable_place_bottom_right.xml
deleted file mode 100644
index c2ae9c8..0000000
--- a/packages/SystemUI/res/drawable/vector_drawable_place_bottom_right.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<!--
-Copyright (C) 2015 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24.0dp"
- android:height="24.0dp"
- android:viewportWidth="24.0"
- android:viewportHeight="24.0">
- <path
- android:fillColor="#FF000000"
- android:pathData="M24.0,24.0L24.0,0.0L0.0,0.0l0.0,24.0L24.0,24.0zM20.0,20.0L10.0,20.0L10.0,10.0l10.0,0.0L20.0,20.0z"/>
-</vector>
diff --git a/packages/SystemUI/res/drawable/vector_drawable_place_dock_bottom.xml b/packages/SystemUI/res/drawable/vector_drawable_place_dock_bottom.xml
deleted file mode 100644
index f11b690..0000000
--- a/packages/SystemUI/res/drawable/vector_drawable_place_dock_bottom.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<!--
-Copyright (C) 2015 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24.0dp"
- android:height="24.0dp"
- android:viewportWidth="24.0"
- android:viewportHeight="24.0">
- <path
- android:fillColor="#FF0000FF"
- android:pathData="M0.0,0.0l0.0,24.0l24.0,0.0L24.0,0.0L0.0,0.0zM4.0,10.0l16.0,0.0l0.0,10.0L4.0,20.0L4.0,10.0z"/>
-</vector>
diff --git a/packages/SystemUI/res/drawable/vector_drawable_place_dock_left.xml b/packages/SystemUI/res/drawable/vector_drawable_place_dock_left.xml
deleted file mode 100644
index 79ade42..0000000
--- a/packages/SystemUI/res/drawable/vector_drawable_place_dock_left.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<!--
-Copyright (C) 2015 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24.0dp"
- android:height="24.0dp"
- android:viewportWidth="24.0"
- android:viewportHeight="24.0">
- <path
- android:fillColor="#FF0000FF"
- android:pathData="M24.0,0.0L0.0,0.0l0.0,24.0l24.0,0.0L24.0,0.0zM14.0,4.0l0.0,16.0L4.0,20.0L4.0,4.0L14.0,4.0z"/>
-</vector>
diff --git a/packages/SystemUI/res/drawable/vector_drawable_place_dock_right.xml b/packages/SystemUI/res/drawable/vector_drawable_place_dock_right.xml
deleted file mode 100644
index 49c2a38..0000000
--- a/packages/SystemUI/res/drawable/vector_drawable_place_dock_right.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<!--
-Copyright (C) 2015 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24.0dp"
- android:height="24.0dp"
- android:viewportWidth="24.0"
- android:viewportHeight="24.0">
- <path
- android:fillColor="#FF0000FF"
- android:pathData="M0.0,24.0l24.0,0.0L24.0,0.0L0.0,0.0L0.0,24.0zM10.0,20.0L10.0,4.0l10.0,0.0l0.0,16.0L10.0,20.0z"/>
-</vector>
diff --git a/packages/SystemUI/res/drawable/vector_drawable_place_dock_top.xml b/packages/SystemUI/res/drawable/vector_drawable_place_dock_top.xml
deleted file mode 100644
index c3abec2..0000000
--- a/packages/SystemUI/res/drawable/vector_drawable_place_dock_top.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<!--
-Copyright (C) 2015 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24.0dp"
- android:height="24.0dp"
- android:viewportWidth="24.0"
- android:viewportHeight="24.0">
- <path
- android:fillColor="#FF0000FF"
- android:pathData="M24.0,24.0L24.0,0.0L0.0,0.0l0.0,24.0L24.0,24.0zM20.0,14.0L4.0,14.0L4.0,4.0l16.0,0.0L20.0,14.0z"/>
-</vector>
diff --git a/packages/SystemUI/res/drawable/vector_drawable_place_left.xml b/packages/SystemUI/res/drawable/vector_drawable_place_left.xml
deleted file mode 100644
index 078f83c..0000000
--- a/packages/SystemUI/res/drawable/vector_drawable_place_left.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<!--
-Copyright (C) 2015 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24.0dp"
- android:height="24.0dp"
- android:viewportWidth="24.0"
- android:viewportHeight="24.0">
- <path
- android:fillColor="#FF000000"
- android:pathData="M24.0,0.0L0.0,0.0l0.0,24.0l24.0,0.0L24.0,0.0zM14.0,4.0l0.0,16.0L4.0,20.0L4.0,4.0L14.0,4.0z"/>
-</vector>
diff --git a/packages/SystemUI/res/drawable/vector_drawable_place_right.xml b/packages/SystemUI/res/drawable/vector_drawable_place_right.xml
deleted file mode 100644
index 86730db..0000000
--- a/packages/SystemUI/res/drawable/vector_drawable_place_right.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<!--
-Copyright (C) 2015 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24.0dp"
- android:height="24.0dp"
- android:viewportWidth="24.0"
- android:viewportHeight="24.0">
- <path
- android:fillColor="#FF000000"
- android:pathData="M0.0,24.0l24.0,0.0L24.0,0.0L0.0,0.0L0.0,24.0zM10.0,20.0L10.0,4.0l10.0,0.0l0.0,16.0L10.0,20.0z"/>
-</vector>
diff --git a/packages/SystemUI/res/drawable/vector_drawable_place_top.xml b/packages/SystemUI/res/drawable/vector_drawable_place_top.xml
deleted file mode 100644
index 92e01af..0000000
--- a/packages/SystemUI/res/drawable/vector_drawable_place_top.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<!--
-Copyright (C) 2015 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24.0dp"
- android:height="24.0dp"
- android:viewportWidth="24.0"
- android:viewportHeight="24.0">
- <path
- android:fillColor="#FF000000"
- android:pathData="M24.0,24.0L24.0,0.0L0.0,0.0l0.0,24.0L24.0,24.0zM20.0,14.0L4.0,14.0L4.0,4.0l16.0,0.0L20.0,14.0z"/>
-</vector>
diff --git a/packages/SystemUI/res/drawable/vector_drawable_place_top_right.xml b/packages/SystemUI/res/drawable/vector_drawable_place_top_right.xml
deleted file mode 100644
index 9f4ee49..0000000
--- a/packages/SystemUI/res/drawable/vector_drawable_place_top_right.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<!--
-Copyright (C) 2015 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24.0dp"
- android:height="24.0dp"
- android:viewportWidth="24.0"
- android:viewportHeight="24.0">
- <path
- android:fillColor="#FF000000"
- android:pathData="M0.0,0.0l0.0,24.0l24.0,0.0L24.0,0.0L0.0,0.0zM20.0,14.0L10.0,14.0L10.0,4.0l10.0,0.0L20.0,14.0z"/>
-</vector>
diff --git a/packages/SystemUI/res/layout-land/recents_task_resize_dialog.xml b/packages/SystemUI/res/layout-land/recents_task_resize_dialog.xml
deleted file mode 100644
index 0a4c086..0000000
--- a/packages/SystemUI/res/layout-land/recents_task_resize_dialog.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2015 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.
--->
-
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:padding="16dp"
- android:orientation="vertical"
- android:descendantFocusability="beforeDescendants"
- android:focusableInTouchMode="true">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal">
- <Button
- android:id="@+id/place_dock_left"
- android:layout_width="36dp"
- android:layout_height="36dp"
- android:layout_weight="1"
- android:layout_margin="10dp"
- android:background="@drawable/vector_drawable_place_dock_left" />
- <Button
- android:id="@+id/place_dock_right"
- android:layout_width="36dp"
- android:layout_height="36dp"
- android:layout_weight="1"
- android:layout_margin="10dp"
- android:background="@drawable/vector_drawable_place_dock_right" />
- <Button
- android:id="@+id/place_left"
- android:layout_width="36dp"
- android:layout_height="36dp"
- android:layout_weight="1"
- android:layout_margin="10dp"
- android:background="@drawable/vector_drawable_place_left" />
- <Button
- android:id="@+id/place_right"
- android:layout_width="36dp"
- android:layout_height="36dp"
- android:layout_weight="1"
- android:layout_margin="10dp"
- android:background="@drawable/vector_drawable_place_right" />
- <Button
- android:id="@+id/place_full"
- android:layout_width="36dp"
- android:layout_height="36dp"
- android:layout_weight="1"
- android:layout_margin="10dp"
- android:background="@drawable/vector_drawable_place_fullscreen" />
- </LinearLayout>
-</LinearLayout>
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout-port/recents_task_resize_dialog.xml b/packages/SystemUI/res/layout-port/recents_task_resize_dialog.xml
deleted file mode 100644
index bf5207a..0000000
--- a/packages/SystemUI/res/layout-port/recents_task_resize_dialog.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2015 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.
--->
-
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:padding="16dp"
- android:orientation="vertical"
- android:descendantFocusability="beforeDescendants"
- android:focusableInTouchMode="true">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal">
- <Button
- android:id="@+id/place_dock_top"
- android:layout_width="36dp"
- android:layout_height="36dp"
- android:layout_weight="1"
- android:layout_margin="10dp"
- android:background="@drawable/vector_drawable_place_dock_top" />
- <Button
- android:id="@+id/place_dock_bottom"
- android:layout_width="36dp"
- android:layout_height="36dp"
- android:layout_weight="1"
- android:layout_margin="10dp"
- android:background="@drawable/vector_drawable_place_dock_bottom" />
- <Button
- android:id="@+id/place_top"
- android:layout_width="36dp"
- android:layout_height="36dp"
- android:layout_weight="1"
- android:layout_margin="10dp"
- android:background="@drawable/vector_drawable_place_top" />
- <Button
- android:id="@+id/place_bottom"
- android:layout_width="36dp"
- android:layout_height="36dp"
- android:layout_weight="1"
- android:layout_margin="10dp"
- android:background="@drawable/vector_drawable_place_bottom" />
- <Button
- android:id="@+id/place_full"
- android:layout_width="36dp"
- android:layout_height="36dp"
- android:layout_weight="1"
- android:layout_margin="10dp"
- android:background="@drawable/vector_drawable_place_fullscreen" />
- </LinearLayout>
-</LinearLayout>
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout-sw600dp-land/recents_task_resize_dialog.xml b/packages/SystemUI/res/layout-sw600dp-land/recents_task_resize_dialog.xml
deleted file mode 100644
index 6e92afc..0000000
--- a/packages/SystemUI/res/layout-sw600dp-land/recents_task_resize_dialog.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2015 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.
--->
-
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:padding="16dp"
- android:orientation="vertical"
- android:descendantFocusability="beforeDescendants"
- android:focusableInTouchMode="true">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal">
- <Button
- android:id="@+id/place_dock_left"
- android:layout_width="36dp"
- android:layout_height="36dp"
- android:layout_weight="1"
- android:layout_margin="10dp"
- android:background="@drawable/vector_drawable_place_dock_left" />
- <Button
- android:id="@+id/place_dock_right"
- android:layout_width="36dp"
- android:layout_height="36dp"
- android:layout_weight="1"
- android:layout_margin="10dp"
- android:background="@drawable/vector_drawable_place_dock_right" />
- <Button
- android:id="@+id/place_left"
- android:layout_width="36dp"
- android:layout_height="36dp"
- android:layout_weight="1"
- android:layout_margin="10dp"
- android:background="@drawable/vector_drawable_place_left" />
- <Button
- android:id="@+id/place_right"
- android:layout_width="36dp"
- android:layout_height="36dp"
- android:layout_weight="1"
- android:layout_margin="10dp"
- android:background="@drawable/vector_drawable_place_right" />
- <Button
- android:id="@+id/place_top_left"
- android:layout_width="36dp"
- android:layout_height="36dp"
- android:layout_weight="1"
- android:layout_margin="10dp"
- android:background="@drawable/vector_drawable_place_top_left" />
- <Button
- android:id="@+id/place_top_right"
- android:layout_width="36dp"
- android:layout_height="36dp"
- android:layout_weight="1"
- android:layout_margin="10dp"
- android:background="@drawable/vector_drawable_place_top_right" />
- <Button
- android:id="@+id/place_bottom_left"
- android:layout_width="36dp"
- android:layout_height="36dp"
- android:layout_weight="1"
- android:layout_margin="10dp"
- android:background="@drawable/vector_drawable_place_bottom_left" />
- <Button
- android:id="@+id/place_bottom_right"
- android:layout_width="36dp"
- android:layout_height="36dp"
- android:layout_weight="1"
- android:layout_margin="10dp"
- android:background="@drawable/vector_drawable_place_bottom_right" />
- <Button
- android:id="@+id/place_full"
- android:layout_width="36dp"
- android:layout_height="36dp"
- android:layout_weight="1"
- android:layout_margin="10dp"
- android:background="@drawable/vector_drawable_place_fullscreen" />
- </LinearLayout>
-</LinearLayout>
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout-sw600dp-port/recents_task_resize_dialog.xml b/packages/SystemUI/res/layout-sw600dp-port/recents_task_resize_dialog.xml
deleted file mode 100644
index faa5f4b..0000000
--- a/packages/SystemUI/res/layout-sw600dp-port/recents_task_resize_dialog.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2015 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.
--->
-
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:padding="16dp"
- android:orientation="vertical"
- android:descendantFocusability="beforeDescendants"
- android:focusableInTouchMode="true">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal">
- <Button
- android:id="@+id/place_dock_top"
- android:layout_width="36dp"
- android:layout_height="36dp"
- android:layout_weight="1"
- android:layout_margin="10dp"
- android:background="@drawable/vector_drawable_place_dock_top" />
- <Button
- android:id="@+id/place_dock_bottom"
- android:layout_width="36dp"
- android:layout_height="36dp"
- android:layout_weight="1"
- android:layout_margin="10dp"
- android:background="@drawable/vector_drawable_place_dock_bottom" />
- <Button
- android:id="@+id/place_top"
- android:layout_width="36dp"
- android:layout_height="36dp"
- android:layout_weight="1"
- android:layout_margin="10dp"
- android:background="@drawable/vector_drawable_place_top" />
- <Button
- android:id="@+id/place_bottom"
- android:layout_width="36dp"
- android:layout_height="36dp"
- android:layout_weight="1"
- android:layout_margin="10dp"
- android:background="@drawable/vector_drawable_place_bottom" />
- <Button
- android:id="@+id/place_top_left"
- android:layout_width="36dp"
- android:layout_height="36dp"
- android:layout_weight="1"
- android:layout_margin="10dp"
- android:background="@drawable/vector_drawable_place_top_left" />
- <Button
- android:id="@+id/place_top_right"
- android:layout_width="36dp"
- android:layout_height="36dp"
- android:layout_weight="1"
- android:layout_margin="10dp"
- android:background="@drawable/vector_drawable_place_top_right" />
- <Button
- android:id="@+id/place_bottom_left"
- android:layout_width="36dp"
- android:layout_height="36dp"
- android:layout_weight="1"
- android:layout_margin="10dp"
- android:background="@drawable/vector_drawable_place_bottom_left" />
- <Button
- android:id="@+id/place_bottom_right"
- android:layout_width="36dp"
- android:layout_height="36dp"
- android:layout_weight="1"
- android:layout_margin="10dp"
- android:background="@drawable/vector_drawable_place_bottom_right" />
- <Button
- android:id="@+id/place_full"
- android:layout_width="36dp"
- android:layout_height="36dp"
- android:layout_weight="1"
- android:layout_margin="10dp"
- android:background="@drawable/vector_drawable_place_fullscreen" />
- </LinearLayout>
-</LinearLayout>
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout/recents_task_view_header.xml b/packages/SystemUI/res/layout/recents_task_view_header.xml
index 2168e8b..b8caf23 100644
--- a/packages/SystemUI/res/layout/recents_task_view_header.xml
+++ b/packages/SystemUI/res/layout/recents_task_view_header.xml
@@ -34,7 +34,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|start"
android:layout_marginStart="64dp"
- android:layout_marginEnd="64dp"
+ android:layout_marginEnd="112dp"
android:textSize="16sp"
android:textColor="#ffffffff"
android:text="@string/recents_empty_message"
diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml
index 94350d9..76c08f6 100644
--- a/packages/SystemUI/res/values/colors.xml
+++ b/packages/SystemUI/res/values/colors.xml
@@ -59,9 +59,9 @@
<!-- The recents task bar dark text color to be drawn on top of light backgrounds. -->
<color name="recents_task_bar_dark_text_color">#cc000000</color>
<!-- The recents task bar light dismiss icon color to be drawn on top of dark backgrounds. -->
- <color name="recents_task_bar_light_dismiss_color">#ffeeeeee</color>
+ <color name="recents_task_bar_light_icon_color">#ffeeeeee</color>
<!-- The recents task bar dark dismiss icon color to be drawn on top of light backgrounds. -->
- <color name="recents_task_bar_dark_dismiss_color">#99000000</color>
+ <color name="recents_task_bar_dark_icon_color">#99000000</color>
<!-- The recents task bar highlight color. -->
<color name="recents_task_bar_highlight_color">#28ffffff</color>
<!-- The lock to task button background color. -->
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
index 1bc9a63..9f0ac35 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
@@ -56,7 +56,6 @@
import com.android.systemui.recents.events.component.ScreenPinningRequestEvent;
import com.android.systemui.recents.events.ui.AllTaskViewsDismissedEvent;
import com.android.systemui.recents.events.ui.DismissTaskViewEvent;
-import com.android.systemui.recents.events.ui.ResizeTaskEvent;
import com.android.systemui.recents.events.ui.ShowApplicationInfoEvent;
import com.android.systemui.recents.events.ui.StackViewScrolledEvent;
import com.android.systemui.recents.events.ui.UpdateFreeformTaskViewVisibilityEvent;
@@ -103,9 +102,6 @@
private ViewStub mHistoryViewStub;
private RecentsHistoryView mHistoryView;
- // Resize task debug
- private RecentsResizeTaskDialog mResizeTaskDebugDialog;
-
// Search AppWidget
private AppWidgetProviderInfo mSearchWidgetInfo;
private RecentsAppWidgetHost mAppWidgetHost;
@@ -587,15 +583,6 @@
EventBus.getDefault().send(new ToggleRecentsEvent());
}
- /**** RecentsResizeTaskDialog ****/
-
- private RecentsResizeTaskDialog getResizeTaskDebugDialog() {
- if (mResizeTaskDebugDialog == null) {
- mResizeTaskDebugDialog = new RecentsResizeTaskDialog(getFragmentManager(), this);
- }
- return mResizeTaskDebugDialog;
- }
-
/**** EventBus events ****/
public final void onBusEvent(ToggleRecentsEvent event) {
@@ -745,10 +732,6 @@
MetricsLogger.count(this, "overview_task_all_dismissed", 1);
}
- public final void onBusEvent(ResizeTaskEvent event) {
- getResizeTaskDebugDialog().showResizeTaskDialog(event.task, mRecentsView);
- }
-
public final void onBusEvent(LaunchTaskSucceededEvent event) {
MetricsLogger.histogram(this, "overview_task_launch_index", event.taskIndexFromStackFront);
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsResizeTaskDialog.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsResizeTaskDialog.java
deleted file mode 100644
index d415845..0000000
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsResizeTaskDialog.java
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * Copyright (C) 2015 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.systemui.recents;
-
-import android.app.ActivityManager;
-import android.app.AlertDialog;
-import android.app.Dialog;
-import android.app.DialogFragment;
-import android.app.FragmentManager;
-import android.content.DialogInterface;
-import android.graphics.Rect;
-import android.os.Bundle;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.widget.Button;
-import android.widget.Toast;
-import com.android.systemui.R;
-import com.android.systemui.recents.misc.SystemServicesProxy;
-import com.android.systemui.recents.model.Task;
-import com.android.systemui.recents.views.RecentsView;
-
-import static android.app.ActivityManager.StackId.DOCKED_STACK_ID;
-import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID;
-
-/**
- * A helper for the dialogs that show when task debugging is on.
- */
-public class RecentsResizeTaskDialog extends DialogFragment {
-
- static final String TAG = "RecentsResizeTaskDialog";
-
- // The various window arrangements we can handle.
- private static final int PLACE_LEFT = 1;
- private static final int PLACE_RIGHT = 2;
- private static final int PLACE_TOP = 3;
- private static final int PLACE_BOTTOM = 4;
- private static final int PLACE_TOP_LEFT = 5;
- private static final int PLACE_TOP_RIGHT = 6;
- private static final int PLACE_BOTTOM_LEFT = 7;
- private static final int PLACE_BOTTOM_RIGHT = 8;
- private static final int PLACE_FULL = 9;
- private static final int PLACE_DOCK_LEFT = 10;
- private static final int PLACE_DOCK_RIGHT = 11;
- private static final int PLACE_DOCK_TOP = 12;
- private static final int PLACE_DOCK_BOTTOM = 13;
-
- // The button resource ID combined with the arrangement command.
- private static final int[][] BUTTON_DEFINITIONS =
- {{R.id.place_dock_left, PLACE_DOCK_LEFT},
- {R.id.place_dock_right, PLACE_DOCK_RIGHT},
- {R.id.place_dock_top, PLACE_DOCK_TOP},
- {R.id.place_dock_bottom, PLACE_DOCK_BOTTOM},
- {R.id.place_left, PLACE_LEFT},
- {R.id.place_right, PLACE_RIGHT},
- {R.id.place_top, PLACE_TOP},
- {R.id.place_bottom, PLACE_BOTTOM},
- {R.id.place_top_left, PLACE_TOP_LEFT},
- {R.id.place_top_right, PLACE_TOP_RIGHT},
- {R.id.place_bottom_left, PLACE_BOTTOM_LEFT},
- {R.id.place_bottom_right, PLACE_BOTTOM_RIGHT},
- {R.id.place_full, PLACE_FULL}};
-
- // The task we want to resize.
- private FragmentManager mFragmentManager;
- private View mResizeTaskDialogContent;
- private RecentsActivity mRecentsActivity;
- private RecentsView mRecentsView;
- private Rect[] mBounds = {new Rect(), new Rect(), new Rect(), new Rect()};
- private Task[] mTasks = {null, null, null, null};
-
- /**
- * Called by FragmentManager
- */
- public RecentsResizeTaskDialog() {
- }
-
- public RecentsResizeTaskDialog(FragmentManager mgr, RecentsActivity activity) {
- mFragmentManager = mgr;
- mRecentsActivity = activity;
- }
-
- /** Shows the resize-task dialog. */
- void showResizeTaskDialog(Task mainTask, RecentsView rv) {
- mTasks[0] = mainTask;
- mRecentsView = rv;
- showAllowingStateLoss(mFragmentManager, TAG);
- }
-
- /** Creates a new resize-task dialog. */
- private void createResizeTaskDialog(LayoutInflater inflater, AlertDialog.Builder builder) {
- builder.setTitle(R.string.recents_caption_resize);
- mResizeTaskDialogContent =
- inflater.inflate(R.layout.recents_task_resize_dialog, null, false);
-
- for (int i = 0; i < BUTTON_DEFINITIONS.length; i++) {
- Button b = (Button)mResizeTaskDialogContent.findViewById(BUTTON_DEFINITIONS[i][0]);
- if (b != null) {
- final int action = BUTTON_DEFINITIONS[i][1];
- b.setOnClickListener(
- new View.OnClickListener() {
- public void onClick(View v) {
- switch (action) {
- case PLACE_DOCK_LEFT:
- case PLACE_DOCK_RIGHT:
- case PLACE_DOCK_TOP:
- case PLACE_DOCK_BOTTOM:
- placeDockTasks(action);
- break;
- default:
- placeTasks(action);
- break;
- }
- }
- });
- }
- }
-
- builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- dismissAllowingStateLoss();
- }
- });
-
- builder.setView(mResizeTaskDialogContent);
- }
-
- /** Helper function to place window(s) on the display according to an arrangement request. */
- private void placeTasks(int arrangement) {
- SystemServicesProxy ssp = Recents.getSystemServices();
- Rect rect = ssp.getDisplayRect();
- for (int i = 0; i < mBounds.length; ++i) {
- mBounds[i].set(rect);
- if (i != 0) {
- mTasks[i] = null;
- }
- }
- int additionalTasks = 0;
- switch (arrangement) {
- case PLACE_LEFT:
- mBounds[0].right = mBounds[0].centerX();
- mBounds[1].left = mBounds[0].right;
- additionalTasks = 1;
- break;
- case PLACE_RIGHT:
- mBounds[1].right = mBounds[1].centerX();
- mBounds[0].left = mBounds[1].right;
- additionalTasks = 1;
- break;
- case PLACE_TOP:
- mBounds[0].bottom = mBounds[0].centerY();
- mBounds[1].top = mBounds[0].bottom;
- additionalTasks = 1;
- break;
- case PLACE_BOTTOM:
- mBounds[1].bottom = mBounds[1].centerY();
- mBounds[0].top = mBounds[1].bottom;
- additionalTasks = 1;
- break;
- case PLACE_TOP_LEFT: // TL, TR, BL, BR
- mBounds[0].right = mBounds[0].centerX();
- mBounds[0].bottom = mBounds[0].centerY();
- mBounds[1].left = mBounds[0].right;
- mBounds[1].bottom = mBounds[0].bottom;
- mBounds[2].right = mBounds[0].right;
- mBounds[2].top = mBounds[0].bottom;
- mBounds[3].left = mBounds[0].right;
- mBounds[3].top = mBounds[0].bottom;
- additionalTasks = 3;
- break;
- case PLACE_TOP_RIGHT: // TR, TL, BR, BL
- mBounds[0].left = mBounds[0].centerX();
- mBounds[0].bottom = mBounds[0].centerY();
- mBounds[1].right = mBounds[0].left;
- mBounds[1].bottom = mBounds[0].bottom;
- mBounds[2].left = mBounds[0].left;
- mBounds[2].top = mBounds[0].bottom;
- mBounds[3].right = mBounds[0].left;
- mBounds[3].top = mBounds[0].bottom;
- additionalTasks = 3;
- break;
- case PLACE_BOTTOM_LEFT: // BL, BR, TL, TR
- mBounds[0].right = mBounds[0].centerX();
- mBounds[0].top = mBounds[0].centerY();
- mBounds[1].left = mBounds[0].right;
- mBounds[1].top = mBounds[0].top;
- mBounds[2].right = mBounds[0].right;
- mBounds[2].bottom = mBounds[0].top;
- mBounds[3].left = mBounds[0].right;
- mBounds[3].bottom = mBounds[0].top;
- additionalTasks = 3;
- break;
- case PLACE_BOTTOM_RIGHT: // BR, BL, TR, TL
- mBounds[0].left = mBounds[0].centerX();
- mBounds[0].top = mBounds[0].centerY();
- mBounds[1].right = mBounds[0].left;
- mBounds[1].top = mBounds[0].top;
- mBounds[2].left = mBounds[0].left;
- mBounds[2].bottom = mBounds[0].top;
- mBounds[3].right = mBounds[0].left;
- mBounds[3].bottom = mBounds[0].top;
- additionalTasks = 3;
- break;
- case PLACE_FULL:
- // Nothing to change.
- mBounds[0] = new Rect();
- break;
- }
-
- // Get the other tasks.
- for (int i = 1; i <= additionalTasks && mTasks[i - 1] != null; ++i) {
- mTasks[i] = mRecentsView.getNextTaskOrTopTask(mTasks[i - 1]);
- // Do stop if we circled back to the first item.
- if (mTasks[i] == mTasks[0]) {
- mTasks[i] = null;
- }
- }
-
- // Get rid of the dialog.
- dismissAllowingStateLoss();
- mRecentsActivity.dismissRecentsToHomeWithoutTransitionAnimation();
-
- // Show tasks as they might not be currently visible - beginning with the oldest so that
- // the focus ends on the selected one.
- for (int i = additionalTasks; i >= 0; --i) {
- if (mTasks[i] != null) {
- mRecentsView.launchTask(mTasks[i], mBounds[i], FREEFORM_WORKSPACE_STACK_ID);
- }
- }
- }
-
- /**
- * Helper function to place docked window(s) on the display according to an arrangement request.
- */
- private void placeDockTasks(int arrangement) {
- int createMode = ActivityManager.DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT;
- switch (arrangement) {
- case PLACE_DOCK_LEFT:
- createMode = ActivityManager.DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT;
- break;
- case PLACE_DOCK_TOP:
- createMode = ActivityManager.DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT;
- break;
- case PLACE_DOCK_RIGHT:
- createMode = ActivityManager.DOCKED_STACK_CREATE_MODE_BOTTOM_OR_RIGHT;
- break;
- case PLACE_DOCK_BOTTOM:
- createMode = ActivityManager.DOCKED_STACK_CREATE_MODE_BOTTOM_OR_RIGHT;
- break;
- }
-
- // Dismiss the dialog before trying to launch the task
- dismissAllowingStateLoss();
-
- if (mTasks[0].key.stackId != DOCKED_STACK_ID) {
- int taskId = mTasks[0].key.id;
- SystemServicesProxy ssp = Recents.getSystemServices();
- ssp.startTaskInDockedMode(taskId, createMode);
- mRecentsView.launchTask(mTasks[0], null, DOCKED_STACK_ID);
- } else {
- Toast.makeText(getContext(), "Already docked", Toast.LENGTH_SHORT);
- }
- }
-
- @Override
- public Dialog onCreateDialog(Bundle args) {
- LayoutInflater inflater = getActivity().getLayoutInflater();
- AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
- createResizeTaskDialog(inflater, builder);
- return builder.create();
- }
-}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/events/activity/LaunchTaskEvent.java b/packages/SystemUI/src/com/android/systemui/recents/events/activity/LaunchTaskEvent.java
new file mode 100644
index 0000000..457d81e
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/recents/events/activity/LaunchTaskEvent.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.recents.events.activity;
+
+import android.graphics.Rect;
+import com.android.systemui.recents.events.EventBus;
+import com.android.systemui.recents.model.Task;
+import com.android.systemui.recents.views.TaskView;
+
+/**
+ * This is sent to launch a task from Recents.
+ */
+public class LaunchTaskEvent extends EventBus.Event {
+
+ public final TaskView taskView;
+ public final Task task;
+ public final Rect targetTaskBounds;
+ public final int targetTaskStack;
+ public final boolean screenPinningRequested;
+
+ public LaunchTaskEvent(TaskView taskView, Task task, Rect targetTaskBounds, int targetTaskStack,
+ boolean screenPinningRequested) {
+ this.taskView = taskView;
+ this.task = task;
+ this.targetTaskBounds = targetTaskBounds;
+ this.targetTaskStack = targetTaskStack;
+ this.screenPinningRequested = screenPinningRequested;
+ }
+
+}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/events/ui/ResizeTaskEvent.java b/packages/SystemUI/src/com/android/systemui/recents/events/ui/ResizeTaskEvent.java
deleted file mode 100644
index e0d83fd..0000000
--- a/packages/SystemUI/src/com/android/systemui/recents/events/ui/ResizeTaskEvent.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2015 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.systemui.recents.events.ui;
-
-import com.android.systemui.recents.events.EventBus;
-import com.android.systemui.recents.model.Task;
-
-/**
- * This is sent when a {@link Task} is resized.
- */
-public class ResizeTaskEvent extends EventBus.Event {
-
- public final Task task;
-
- public ResizeTaskEvent(Task task) {
- this.task = task;
- }
-}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java
index 8979843..5888b30 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java
@@ -65,7 +65,6 @@
import com.android.internal.os.BackgroundThread;
import com.android.systemui.Prefs;
import com.android.systemui.R;
-import com.android.systemui.recents.Recents;
import com.android.systemui.recents.RecentsDebugFlags;
import com.android.systemui.recents.RecentsImpl;
@@ -127,7 +126,7 @@
mUm = UserManager.get(context);
mDisplay = mWm.getDefaultDisplay();
mRecentsPackage = context.getPackageName();
- mHasFreeformWorkspaceSupport = false &&
+ mHasFreeformWorkspaceSupport =
mPm.hasSystemFeature(PackageManager.FEATURE_FREEFORM_WINDOW_MANAGEMENT);
// Get the dummy thumbnail width/heights
diff --git a/packages/SystemUI/src/com/android/systemui/recents/model/Task.java b/packages/SystemUI/src/com/android/systemui/recents/model/Task.java
index 512effa..3aed3f3 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/model/Task.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/model/Task.java
@@ -39,7 +39,6 @@
public void onTaskDataLoaded();
/* Notifies when a task has been unbound */
public void onTaskDataUnloaded();
-
/* Notifies when a task's stack id has changed. */
public void onTaskStackIdChanged();
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/AnimateableViewBounds.java b/packages/SystemUI/src/com/android/systemui/recents/views/AnimateableViewBounds.java
index f646a92..c0b8a9d 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/AnimateableViewBounds.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/AnimateableViewBounds.java
@@ -55,7 +55,7 @@
* Resets the right and bottom clip for this view.
*/
public void reset() {
- mClipRect.setEmpty();
+ mClipRect.set(-1, -1, -1, -1);
updateClipBounds();
}
@@ -90,9 +90,9 @@
}
private void updateClipBounds() {
- mClipBounds.set(mClipRect.left, mClipRect.top,
- mSourceView.getWidth() - mClipRect.right,
- mSourceView.getHeight() - mClipRect.bottom);
+ mClipBounds.set(Math.max(0, mClipRect.left), Math.max(0, mClipRect.top),
+ mSourceView.getWidth() - Math.max(0, mClipRect.right),
+ mSourceView.getHeight() - Math.max(0, mClipRect.bottom));
mSourceView.setClipBounds(mClipBounds);
mSourceView.invalidateOutline();
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
index addcc85..501cbc0 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
@@ -47,6 +47,7 @@
import com.android.systemui.recents.events.activity.DismissRecentsToHomeAnimationStarted;
import com.android.systemui.recents.events.activity.HideHistoryButtonEvent;
import com.android.systemui.recents.events.activity.HideHistoryEvent;
+import com.android.systemui.recents.events.activity.LaunchTaskEvent;
import com.android.systemui.recents.events.activity.ShowHistoryButtonEvent;
import com.android.systemui.recents.events.activity.ShowHistoryEvent;
import com.android.systemui.recents.events.component.RecentsVisibilityChangedEvent;
@@ -71,7 +72,7 @@
* This view is the the top level layout that contains TaskStacks (which are laid out according
* to their SpaceNode bounds.
*/
-public class RecentsView extends FrameLayout implements TaskStackView.TaskStackViewCallbacks {
+public class RecentsView extends FrameLayout {
private static final String TAG = "RecentsView";
private static final boolean DEBUG = false;
@@ -156,7 +157,6 @@
addView(mTaskStackView);
} else {
mTaskStackView = new TaskStackView(getContext(), stack);
- mTaskStackView.setCallbacks(this);
addView(mTaskStackView);
}
} else {
@@ -164,7 +164,6 @@
removeView(mTaskStackView);
}
mTaskStackView = new TaskStackView(getContext(), stack);
- mTaskStackView.setCallbacks(this);
addView(mTaskStackView);
}
@@ -223,8 +222,8 @@
Task task = mTaskStackView.getFocusedTask();
if (task != null) {
TaskView taskView = mTaskStackView.getChildViewForTask(task);
- onTaskViewClicked(mTaskStackView, taskView, stack, task, false, null,
- INVALID_STACK_ID);
+ EventBus.getDefault().send(new LaunchTaskEvent(taskView, task, null,
+ INVALID_STACK_ID, false));
return true;
}
}
@@ -238,8 +237,8 @@
Task task = stack.getLaunchTarget();
if (task != null) {
TaskView taskView = mTaskStackView.getChildViewForTask(task);
- onTaskViewClicked(mTaskStackView, taskView, stack, task, false, null,
- INVALID_STACK_ID);
+ EventBus.getDefault().send(new LaunchTaskEvent(taskView, task, null,
+ INVALID_STACK_ID, false));
return true;
}
}
@@ -256,8 +255,8 @@
for (int j = 0; j < taskViewCount; j++) {
TaskView tv = taskViews.get(j);
if (tv.getTask() == task) {
- onTaskViewClicked(mTaskStackView, tv, stack, task, false,
- taskBounds, destinationStack);
+ EventBus.getDefault().send(new LaunchTaskEvent(tv, task, taskBounds,
+ destinationStack, false));
return true;
}
}
@@ -491,19 +490,14 @@
return super.verifyDrawable(who);
}
- /**** TaskStackView.TaskStackCallbacks Implementation ****/
-
- @Override
- public void onTaskViewClicked(final TaskStackView stackView, final TaskView tv,
- final TaskStack stack, final Task task, final boolean lockToTask,
- final Rect bounds, int destinationStack) {
- mLastTaskLaunchedWasFreeform = task.isFreeformTask();
- mTransitionHelper.launchTaskFromRecents(stack, task, stackView, tv, lockToTask, bounds,
- destinationStack);
- }
-
/**** EventBus Events ****/
+ public final void onBusEvent(LaunchTaskEvent event) {
+ mLastTaskLaunchedWasFreeform = event.task.isFreeformTask();
+ mTransitionHelper.launchTaskFromRecents(mStack, event.task, mTaskStackView, event.taskView,
+ event.screenPinningRequested, event.targetTaskBounds, event.targetTaskStack);
+ }
+
public final void onBusEvent(DragStartEvent event) {
updateVisibleDockRegions(mTouchHandler.getDockStatesForCurrentOrientation(),
TaskStack.DockState.NONE.viewState.dockAreaAlpha);
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
index 404ac47..61479bf 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
@@ -51,6 +51,7 @@
import com.android.systemui.recents.events.activity.HideHistoryButtonEvent;
import com.android.systemui.recents.events.activity.HideHistoryEvent;
import com.android.systemui.recents.events.activity.IterateRecentsEvent;
+import com.android.systemui.recents.events.activity.LaunchTaskEvent;
import com.android.systemui.recents.events.activity.PackagesChangedEvent;
import com.android.systemui.recents.events.activity.ShowHistoryButtonEvent;
import com.android.systemui.recents.events.activity.ShowHistoryEvent;
@@ -115,17 +116,10 @@
}
};
- /** The TaskView callbacks */
- interface TaskStackViewCallbacks {
- public void onTaskViewClicked(TaskStackView stackView, TaskView tv, TaskStack stack, Task t,
- boolean lockToTask, Rect bounds, int destinationStack);
- }
-
TaskStack mStack;
TaskStackLayoutAlgorithm mLayoutAlgorithm;
TaskStackViewScroller mStackScroller;
TaskStackViewTouchHandler mTouchHandler;
- TaskStackViewCallbacks mCb;
GradientDrawable mFreeformWorkspaceBackground;
ObjectAnimator mFreeformWorkspaceBackgroundAnimator;
ViewPool<TaskView, Task> mViewPool;
@@ -223,11 +217,6 @@
}
}
- /** Sets the callbacks */
- void setCallbacks(TaskStackViewCallbacks cb) {
- mCb = cb;
- }
-
@Override
protected void onAttachedToWindow() {
SystemServicesProxy ssp = Recents.getSystemServices();
@@ -1205,7 +1194,8 @@
public boolean launchFreeformTasks() {
Task frontTask = mStack.getStackFrontMostTask();
if (frontTask != null && frontTask.isFreeformTask()) {
- onTaskViewClicked(getChildViewForTask(frontTask), frontTask, false);
+ EventBus.getDefault().send(new LaunchTaskEvent(getChildViewForTask(frontTask),
+ frontTask, null, INVALID_STACK_ID, false));
return true;
}
return false;
@@ -1376,16 +1366,6 @@
/**** TaskViewCallbacks Implementation ****/
@Override
- public void onTaskViewClicked(TaskView tv, Task task, boolean lockToTask) {
- // Cancel any doze triggers
- mUIDozeTrigger.stopDozing();
-
- if (mCb != null) {
- mCb.onTaskViewClicked(this, tv, mStack, task, lockToTask, null, INVALID_STACK_ID);
- }
- }
-
- @Override
public void onTaskViewClipStateChanged(TaskView tv) {
requestUpdateStackViewsClip();
}
@@ -1437,6 +1417,11 @@
}
}
+ public final void onBusEvent(LaunchTaskEvent event) {
+ // Cancel any doze triggers once a task is launched
+ mUIDozeTrigger.stopDozing();
+ }
+
public final void onBusEvent(DismissTaskViewEvent event) {
removeTaskViewFromStack(event.taskView);
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java
index 1e2227e..ab51d5f 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java
@@ -45,6 +45,7 @@
import com.android.systemui.recents.RecentsActivityLaunchState;
import com.android.systemui.recents.RecentsConfiguration;
import com.android.systemui.recents.events.EventBus;
+import com.android.systemui.recents.events.activity.LaunchTaskEvent;
import com.android.systemui.recents.events.ui.DismissTaskViewEvent;
import com.android.systemui.recents.events.ui.dragndrop.DragEndEvent;
import com.android.systemui.recents.events.ui.dragndrop.DragStartEvent;
@@ -54,6 +55,8 @@
import com.android.systemui.recents.model.TaskStack;
import com.android.systemui.statusbar.phone.PhoneStatusBar;
+import static android.app.ActivityManager.StackId.INVALID_STACK_ID;
+
/* A task view */
public class TaskView extends FrameLayout implements Task.TaskCallbacks,
View.OnClickListener, View.OnLongClickListener {
@@ -63,8 +66,7 @@
/** The TaskView callbacks */
interface TaskViewCallbacks {
- public void onTaskViewClicked(TaskView tv, Task task, boolean lockToTask);
- public void onTaskViewClipStateChanged(TaskView tv);
+ void onTaskViewClipStateChanged(TaskView tv);
}
float mTaskProgress;
@@ -278,7 +280,6 @@
/** Resets this view's properties */
void resetViewProperties() {
setDim(0);
- setLayerType(View.LAYER_TYPE_NONE, null);
setVisibility(View.VISIBLE);
getViewBounds().reset();
TaskViewTransform.reset(this);
@@ -723,13 +724,14 @@
@Override
public void onClick(final View v) {
+ boolean screenPinningRequested = false;
if (v == mActionButtonView) {
// Reset the translation of the action button before we animate it out
mActionButtonView.setTranslationZ(0f);
+ screenPinningRequested = true;
}
- if (mCb != null) {
- mCb.onTaskViewClicked(this, mTask, (v == mActionButtonView));
- }
+ EventBus.getDefault().send(new LaunchTaskEvent(this, mTask, null, INVALID_STACK_ID,
+ screenPinningRequested));
}
/**** View.OnLongClickListener Implementation ****/
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java
index d8220fd..0271ccd 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java
@@ -16,25 +16,20 @@
package com.android.systemui.recents.views;
-import android.animation.ObjectAnimator;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Canvas;
import android.graphics.Color;
-import android.graphics.Outline;
import android.graphics.Paint;
import android.graphics.PorterDuff;
-import android.graphics.PorterDuffColorFilter;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.RippleDrawable;
-import android.graphics.drawable.ShapeDrawable;
import android.util.AttributeSet;
import android.view.View;
-import android.view.ViewOutlineProvider;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
import android.widget.FrameLayout;
@@ -45,12 +40,16 @@
import com.android.systemui.recents.Constants;
import com.android.systemui.recents.Recents;
import com.android.systemui.recents.events.EventBus;
-import com.android.systemui.recents.events.ui.ResizeTaskEvent;
+import com.android.systemui.recents.events.activity.LaunchTaskEvent;
import com.android.systemui.recents.events.ui.ShowApplicationInfoEvent;
import com.android.systemui.recents.misc.SystemServicesProxy;
import com.android.systemui.recents.misc.Utilities;
import com.android.systemui.recents.model.Task;
+import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID;
+import static android.app.ActivityManager.StackId.FULLSCREEN_WORKSPACE_STACK_ID;
+import static android.app.ActivityManager.StackId.INVALID_STACK_ID;
+
/* The task bar view */
public class TaskViewHeader extends FrameLayout
@@ -63,6 +62,7 @@
ImageView mDismissButton;
ImageView mApplicationIcon;
TextView mActivityDescription;
+ int mMoveTaskTargetStackId = INVALID_STACK_ID;
// Header drawables
Rect mTaskViewRect = new Rect();
@@ -157,24 +157,55 @@
*/
public void onTaskViewSizeChanged(int width, int height) {
mTaskViewRect.set(0, 0, width, height);
- if (mDismissButton.getMeasuredWidth() > (width - mApplicationIcon.getMeasuredWidth())) {
- mDismissButton.setAlpha(0f);
- } else {
- mDismissButton.setAlpha(1f);
- if (mDismissButton != null) {
- mDismissButton.setTranslationX(width - getMeasuredWidth());
+ boolean updateMoveTaskButton = mMoveTaskButton.getVisibility() != View.GONE;
+ int appIconWidth = mApplicationIcon.getMeasuredWidth();
+ int activityDescWidth = mActivityDescription.getMeasuredWidth();
+ int dismissIconWidth = mDismissButton.getMeasuredWidth();
+ int moveTaskIconWidth = mMoveTaskButton.getVisibility() == View.VISIBLE
+ ? mMoveTaskButton.getMeasuredWidth()
+ : 0;
+
+ // Priority-wise, we show the activity icon first, the dismiss icon if there is room, the
+ // move-task icon if there is room, and then finally, the activity label if there is room
+ if (width < (appIconWidth + dismissIconWidth)) {
+ mActivityDescription.setVisibility(View.INVISIBLE);
+ if (updateMoveTaskButton) {
+ mMoveTaskButton.setVisibility(View.INVISIBLE);
}
- }
- if (mActivityDescription.getMeasuredWidth() > (width -
- (mApplicationIcon.getMeasuredWidth() + mDismissButton.getMeasuredWidth()))) {
- mActivityDescription.setAlpha(0f);
+ mDismissButton.setVisibility(View.INVISIBLE);
+ } else if (width < (appIconWidth + dismissIconWidth + moveTaskIconWidth)) {
+ mActivityDescription.setVisibility(View.INVISIBLE);
+ if (updateMoveTaskButton) {
+ mMoveTaskButton.setVisibility(View.INVISIBLE);
+ }
+ mDismissButton.setVisibility(View.VISIBLE);
+ } else if (width < (appIconWidth + dismissIconWidth + moveTaskIconWidth +
+ activityDescWidth)) {
+ mActivityDescription.setVisibility(View.INVISIBLE);
+ if (updateMoveTaskButton) {
+ mMoveTaskButton.setVisibility(View.VISIBLE);
+ }
+ mDismissButton.setVisibility(View.VISIBLE);
} else {
- mActivityDescription.setAlpha(1f);
+ mActivityDescription.setVisibility(View.VISIBLE);
+ if (updateMoveTaskButton) {
+ mMoveTaskButton.setVisibility(View.VISIBLE);
+ }
+ mDismissButton.setVisibility(View.VISIBLE);
}
+ if (updateMoveTaskButton) {
+ mMoveTaskButton.setTranslationX(width - getMeasuredWidth());
+ }
+ mDismissButton.setTranslationX(width - getMeasuredWidth());
invalidate();
}
@Override
+ protected void onSizeChanged(int w, int h, int oldw, int oldh) {
+ onTaskViewSizeChanged(mTaskViewRect.width(), mTaskViewRect.height());
+ }
+
+ @Override
protected void onDraw(Canvas canvas) {
// Draw the highlight at the top edge (but put the bottom edge just out of view)
float offset = (float) Math.ceil(mHighlightHeight / 2f);
@@ -197,6 +228,7 @@
/** Binds the bar view to the task */
public void rebindToTask(Task t) {
+ SystemServicesProxy ssp = Recents.getSystemServices();
mTask = t;
// If an activity icon is defined, then we use that as the primary icon to show in the bar,
@@ -228,12 +260,26 @@
mLightDismissDrawable : mDarkDismissDrawable);
mDismissButton.setContentDescription(String.format(mDismissContentDescription,
t.contentDescription));
- updateResizeTaskBarIcon(t);
- mMoveTaskButton.setVisibility(View.VISIBLE);
- mMoveTaskButton.setOnClickListener(this);
+
+ // When freeform workspaces are enabled, then update the move-task button depending on the
+ // current task
+ if (ssp.hasFreeformWorkspaceSupport()) {
+ if (t.isFreeformTask()) {
+ mMoveTaskTargetStackId = FULLSCREEN_WORKSPACE_STACK_ID;
+ mMoveTaskButton.setImageResource(t.useLightOnPrimaryColor
+ ? R.drawable.recents_move_task_fullscreen_light
+ : R.drawable.recents_move_task_fullscreen_dark);
+ } else {
+ mMoveTaskTargetStackId = FREEFORM_WORKSPACE_STACK_ID;
+ mMoveTaskButton.setImageResource(t.useLightOnPrimaryColor
+ ? R.drawable.recents_move_task_freeform_light
+ : R.drawable.recents_move_task_freeform_dark);
+ }
+ mMoveTaskButton.setVisibility(View.VISIBLE);
+ mMoveTaskButton.setOnClickListener(this);
+ }
// In accessibility, a single click on the focused app info button will show it
- SystemServicesProxy ssp = Recents.getSystemServices();
if (ssp.isTouchExplorationEnabled()) {
mApplicationIcon.setOnClickListener(this);
}
@@ -247,40 +293,6 @@
mMoveTaskButton.setOnClickListener(null);
}
- /** Updates the resize task bar button. */
- void updateResizeTaskBarIcon(Task t) {
- SystemServicesProxy ssp = Recents.getSystemServices();
- Rect display = ssp.getWindowRect();
- Rect taskRect = ssp.getTaskBounds(t.key.id);
- int resId = R.drawable.star;
- if (display.equals(taskRect) || taskRect.isEmpty()) {
- resId = R.drawable.vector_drawable_place_fullscreen;
- } else {
- boolean top = display.top == taskRect.top;
- boolean bottom = display.bottom == taskRect.bottom;
- boolean left = display.left == taskRect.left;
- boolean right = display.right == taskRect.right;
- if (top && bottom && left) {
- resId = R.drawable.vector_drawable_place_left;
- } else if (top && bottom && right) {
- resId = R.drawable.vector_drawable_place_right;
- } else if (top && left && right) {
- resId = R.drawable.vector_drawable_place_top;
- } else if (bottom && left && right) {
- resId = R.drawable.vector_drawable_place_bottom;
- } else if (top && right) {
- resId = R.drawable.vector_drawable_place_top_right;
- } else if (top && left) {
- resId = R.drawable.vector_drawable_place_top_left;
- } else if (bottom && right) {
- resId = R.drawable.vector_drawable_place_bottom_right;
- } else if (bottom && left) {
- resId = R.drawable.vector_drawable_place_bottom_left;
- }
- }
- mMoveTaskButton.setImageResource(resId);
- }
-
/** Animates this task bar dismiss button when launching a task. */
void startLaunchTaskDismissAnimation(final Runnable postAnimationRunanble) {
if (mDismissButton.getVisibility() == View.VISIBLE) {
@@ -356,7 +368,12 @@
MetricsLogger.histogram(getContext(), "overview_task_dismissed_source",
Constants.Metrics.DismissSourceHeaderButton);
} else if (v == mMoveTaskButton) {
- EventBus.getDefault().send(new ResizeTaskEvent(mTask));
+ TaskView tv = Utilities.findParent(this, TaskView.class);
+ Rect bounds = mMoveTaskTargetStackId == FREEFORM_WORKSPACE_STACK_ID
+ ? new Rect(mTaskViewRect)
+ : new Rect();
+ EventBus.getDefault().send(new LaunchTaskEvent(tv, mTask, bounds,
+ mMoveTaskTargetStackId, false));
}
}