OSDN Git Service

[Pie port] Add minimize & pip buttons to freeform windows android-x86-9.0-r2
authorJon West <electrikjesus@gmail.com>
Sat, 14 Mar 2020 19:34:41 +0000 (15:34 -0400)
committerJon West <electrikjesus@gmail.com>
Mon, 23 Mar 2020 19:46:01 +0000 (15:46 -0400)
Thanks to @farmerbb for assistance and @rogerdott for the graphics

Change-Id: I8ddad6eab27f52574ee1c10e8006612fb46a83c5

core/java/android/view/Window.java
core/java/com/android/internal/policy/DecorView.java
core/java/com/android/internal/widget/DecorCaptionView.java
core/res/res/drawable/decor_minimize_button_dark.xml [new file with mode: 0644]
core/res/res/drawable/decor_minimize_button_light.xml [new file with mode: 0644]
core/res/res/drawable/decor_pip_button_dark.xml [new file with mode: 0644]
core/res/res/drawable/decor_pip_button_light.xml [new file with mode: 0644]
core/res/res/layout/decor_caption.xml
core/res/res/values/arrays.xml
core/res/res/values/strings.xml
core/res/res/values/symbols.xml

index 93b3fc2..867ce92 100644 (file)
@@ -624,6 +624,8 @@ public abstract class Window {
 
         /** Returns whether the window belongs to the task root. */
         boolean isTaskRoot();
+
+        boolean moveTaskToBack(boolean nonRoot);
     }
 
     /**
index 6ad1d72..9f039a2 100644 (file)
@@ -1994,6 +1994,10 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind
     }
 
     private void setLightDecorCaptionShade(DecorCaptionView view) {
+               view.findViewById(R.id.pip_window).setBackgroundResource(
+                R.drawable.decor_pip_button_light);
+        view.findViewById(R.id.minimize_window).setBackgroundResource(
+                R.drawable.decor_minimize_button_light);
         view.findViewById(R.id.maximize_window).setBackgroundResource(
                 R.drawable.decor_maximize_button_light);
         view.findViewById(R.id.close_window).setBackgroundResource(
@@ -2001,6 +2005,10 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind
     }
 
     private void setDarkDecorCaptionShade(DecorCaptionView view) {
+               view.findViewById(R.id.pip_window).setBackgroundResource(
+                R.drawable.decor_pip_button_dark);
+               view.findViewById(R.id.minimize_window).setBackgroundResource(
+                R.drawable.decor_minimize_button_dark);
         view.findViewById(R.id.maximize_window).setBackgroundResource(
                 R.drawable.decor_maximize_button_dark);
         view.findViewById(R.id.close_window).setBackgroundResource(
index b419113..ac05c9b 100644 (file)
@@ -86,6 +86,8 @@ public class DecorCaptionView extends ViewGroup implements View.OnTouchListener,
 
     private View mCaption;
     private View mContent;
+    private View mPip;
+    private View mMinimize;
     private View mMaximize;
     private View mClose;
 
@@ -102,6 +104,8 @@ public class DecorCaptionView extends ViewGroup implements View.OnTouchListener,
     private GestureDetector mGestureDetector;
     private final Rect mCloseRect = new Rect();
     private final Rect mMaximizeRect = new Rect();
+    private final Rect mMinimizeRect = new Rect();
+    private final Rect mPipRect = new Rect();
     private View mClickTarget;
 
     public DecorCaptionView(Context context) {
@@ -143,6 +147,8 @@ public class DecorCaptionView extends ViewGroup implements View.OnTouchListener,
         // By changing the outline provider to BOUNDS, the window can remove its
         // background without removing the shadow.
         mOwner.getDecorView().setOutlineProvider(ViewOutlineProvider.BOUNDS);
+        mPip = findViewById(R.id.pip_window);
+        mMinimize = findViewById(R.id.minimize_window);
         mMaximize = findViewById(R.id.maximize_window);
         mClose = findViewById(R.id.close_window);
     }
@@ -154,6 +160,13 @@ public class DecorCaptionView extends ViewGroup implements View.OnTouchListener,
         if (ev.getAction() == MotionEvent.ACTION_DOWN) {
             final int x = (int) ev.getX();
             final int y = (int) ev.getY();
+            // Only offset y for containment tests because the actual views are already translated.
+            if (mPipRect.contains(x, y)) {
+                mClickTarget = mPip;
+            }
+            if (mMinimizeRect.contains(x, y)) {
+                mClickTarget = mMinimize;
+            }
             if (mMaximizeRect.contains(x, y)) {
                 mClickTarget = mMaximize;
             }
@@ -298,10 +311,14 @@ public class DecorCaptionView extends ViewGroup implements View.OnTouchListener,
         if (mCaption.getVisibility() != View.GONE) {
             mCaption.layout(0, 0, mCaption.getMeasuredWidth(), mCaption.getMeasuredHeight());
             captionHeight = mCaption.getBottom() - mCaption.getTop();
+            mPip.getHitRect(mPipRect);
+            mMinimize.getHitRect(mMinimizeRect);
             mMaximize.getHitRect(mMaximizeRect);
             mClose.getHitRect(mCloseRect);
         } else {
             captionHeight = 0;
+            mPipRect.setEmpty();
+            mMinimizeRect.setEmpty();
             mMaximizeRect.setEmpty();
             mCloseRect.setEmpty();
         }
@@ -316,7 +333,7 @@ public class DecorCaptionView extends ViewGroup implements View.OnTouchListener,
         }
 
         // This assumes that the caption bar is at the top.
-        mOwner.notifyRestrictedCaptionAreaCallback(mMaximize.getLeft(), mMaximize.getTop(),
+        mOwner.notifyRestrictedCaptionAreaCallback(mPip.getLeft(), mMaximize.getTop(),
                 mClose.getRight(), mClose.getBottom());
     }
     /**
@@ -353,6 +370,20 @@ public class DecorCaptionView extends ViewGroup implements View.OnTouchListener,
         }
     }
 
+    private void minimizeWindow() {
+        Window.WindowControllerCallback callback = mOwner.getWindowControllerCallback();
+        if (callback != null) {
+            callback.moveTaskToBack(true);
+               }
+    }
+
+    private void pipWindow() {
+        Window.WindowControllerCallback callback = mOwner.getWindowControllerCallback();
+        if (callback != null) {
+                       callback.enterPictureInPictureModeIfPossible(); /* Send the task to PIP mode if the task supports it. */
+               }
+    }
+
     public boolean isCaptionShowing() {
         return mShow;
     }
@@ -405,7 +436,11 @@ public class DecorCaptionView extends ViewGroup implements View.OnTouchListener,
 
     @Override
     public boolean onSingleTapUp(MotionEvent e) {
-        if (mClickTarget == mMaximize) {
+        if (mClickTarget == mMinimize) {
+            minimizeWindow();
+        } else if (mClickTarget == mPip) {
+            pipWindow();
+        } else if (mClickTarget == mMaximize) {
             maximizeWindow();
         } else if (mClickTarget == mClose) {
             mOwner.dispatchOnWindowDismissed(
diff --git a/core/res/res/drawable/decor_minimize_button_dark.xml b/core/res/res/drawable/decor_minimize_button_dark.xml
new file mode 100644 (file)
index 0000000..7143d6c
--- /dev/null
@@ -0,0 +1,30 @@
+<?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.
+-->
+
+<vector
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:name="vector"
+    android:width="32dp"
+    android:height="32dp"
+    android:viewportWidth="32"
+    android:viewportHeight="32"
+       android:tint="@color/decor_button_dark_color">
+    <path
+        android:name="path"
+        android:pathData="M 9.484 21.193 C 9.591 21.14 9.732 21.171 9.809 21.263 C 9.852 21.321 9.866 21.394 9.897 21.458 C 9.964 21.52 10.065 21.552 10.1 21.644 C 10.174 21.795 10.073 21.997 9.907 22.026 C 9.788 22.043 9.667 22.042 9.549 22.028 C 9.407 22.009 9.311 21.867 9.32 21.729 C 9.322 21.546 9.276 21.286 9.484 21.193 Z M 14.253 21.491 C 14.47 21.465 14.692 21.478 14.911 21.482 C 15.122 21.487 15.244 21.764 15.107 21.925 C 14.995 22.077 14.786 22.028 14.624 22.036 C 14.457 22.024 14.25 22.083 14.122 21.942 C 13.982 21.803 14.06 21.534 14.253 21.491 Z M 10.893 21.491 C 11.11 21.465 11.332 21.478 11.551 21.482 C 11.761 21.488 11.883 21.764 11.747 21.924 C 11.627 22.086 11.404 22.024 11.232 22.036 C 11.075 22.027 10.88 22.076 10.762 21.943 C 10.622 21.804 10.699 21.532 10.893 21.491 Z M 15.948 21.487 C 16.165 21.469 16.385 21.475 16.603 21.484 C 16.803 21.497 16.916 21.758 16.794 21.916 C 16.681 22.082 16.458 22.027 16.288 22.036 C 16.124 22.026 15.916 22.08 15.795 21.935 C 15.661 21.788 15.75 21.519 15.948 21.487 Z M 12.588 21.487 C 12.805 21.469 13.025 21.475 13.243 21.484 C 13.443 21.497 13.556 21.758 13.434 21.916 C 13.321 22.082 13.098 22.027 12.928 22.036 C 12.763 22.026 12.556 22.08 12.434 21.935 C 12.3 21.787 12.389 21.519 12.588 21.487 Z M 17.708 21.067 C 17.865 20.99 18.075 21.104 18.092 21.28 C 18.103 21.449 18.097 21.621 18.084 21.791 C 18.075 21.914 17.969 22.015 17.849 22.03 C 17.724 22.045 17.572 22.047 17.483 21.942 C 17.386 21.844 17.39 21.68 17.48 21.579 C 17.556 21.498 17.531 21.384 17.547 21.285 C 17.554 21.189 17.62 21.103 17.708 21.067 Z M 9.517 19.502 C 9.681 19.441 9.878 19.568 9.882 19.745 C 9.889 19.947 9.89 20.149 9.88 20.351 C 9.87 20.5 9.723 20.621 9.575 20.6 C 9.435 20.589 9.323 20.457 9.327 20.318 C 9.325 20.129 9.323 19.94 9.331 19.751 C 9.335 19.64 9.412 19.537 9.517 19.502 Z M 17.774 19.374 C 17.922 19.326 18.097 19.431 18.122 19.585 C 18.139 19.723 18.124 19.861 18.125 19.999 C 18.119 20.141 18.142 20.317 18.015 20.416 C 17.866 20.548 17.597 20.454 17.57 20.254 C 17.553 20.052 17.57 19.849 17.573 19.646 C 17.572 19.524 17.654 19.406 17.774 19.374 Z M 11.437 10.112 C 11.442 10.075 11.423 9.991 11.488 10.002 C 15.061 10 18.635 10.001 22.208 10.001 C 22.472 10.003 22.737 9.996 23.001 10.005 C 22.999 13.11 23.001 16.215 23 19.32 C 19.146 19.321 15.292 19.322 11.437 19.32 C 11.439 16.251 11.439 13.181 11.437 10.112 Z M 9.487 17.839 C 9.647 17.747 9.875 17.864 9.887 18.049 C 9.899 18.261 9.897 18.475 9.883 18.687 C 9.866 18.895 9.582 18.998 9.433 18.855 C 9.29 18.735 9.342 18.531 9.333 18.368 C 9.34 18.188 9.289 17.936 9.487 17.839 Z M 13.09 11.554 C 13.089 13.624 13.089 15.695 13.09 17.766 C 15.842 17.768 18.595 17.769 21.347 17.766 C 21.349 15.695 21.349 13.625 21.347 11.554 C 18.595 11.552 15.842 11.553 13.09 11.554 Z M 9.547 16.137 C 9.686 16.098 9.851 16.182 9.885 16.325 C 9.915 16.471 9.895 16.62 9.9 16.768 C 9.895 16.897 9.919 17.049 9.823 17.152 C 9.719 17.272 9.513 17.27 9.411 17.148 C 9.332 17.064 9.34 16.94 9.339 16.833 C 9.344 16.683 9.337 16.533 9.347 16.384 C 9.35 16.269 9.436 16.165 9.547 16.137 Z M 9.515 14.471 C 9.653 14.404 9.835 14.48 9.886 14.624 C 9.927 14.769 9.9 14.923 9.907 15.072 C 9.903 15.217 9.931 15.396 9.803 15.499 C 9.656 15.628 9.392 15.544 9.357 15.349 C 9.334 15.151 9.349 14.95 9.349 14.75 C 9.345 14.635 9.405 14.516 9.515 14.471 Z M 10.51 14.263 C 10.665 14.246 10.821 14.26 10.977 14.255 C 11.088 14.257 11.215 14.247 11.301 14.33 C 11.447 14.45 11.411 14.714 11.235 14.787 C 11.091 14.837 10.934 14.807 10.784 14.815 C 10.629 14.812 10.43 14.844 10.331 14.694 C 10.211 14.539 10.314 14.285 10.51 14.263 Z"
+        android:fillColor="@color/white"
+        android:strokeWidth="1"/>
+</vector>
diff --git a/core/res/res/drawable/decor_minimize_button_light.xml b/core/res/res/drawable/decor_minimize_button_light.xml
new file mode 100644 (file)
index 0000000..876641c
--- /dev/null
@@ -0,0 +1,30 @@
+<!--
+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:name="vector"
+    android:width="32dp"
+    android:height="32dp"
+    android:viewportWidth="32"
+    android:viewportHeight="32"
+       android:tint="@color/decor_button_light_color">
+    <path
+        android:name="path"
+        android:pathData="M 9.484 21.193 C 9.591 21.14 9.732 21.171 9.809 21.263 C 9.852 21.321 9.866 21.394 9.897 21.458 C 9.964 21.52 10.065 21.552 10.1 21.644 C 10.174 21.795 10.073 21.997 9.907 22.026 C 9.788 22.043 9.667 22.042 9.549 22.028 C 9.407 22.009 9.311 21.867 9.32 21.729 C 9.322 21.546 9.276 21.286 9.484 21.193 Z M 14.253 21.491 C 14.47 21.465 14.692 21.478 14.911 21.482 C 15.122 21.487 15.244 21.764 15.107 21.925 C 14.995 22.077 14.786 22.028 14.624 22.036 C 14.457 22.024 14.25 22.083 14.122 21.942 C 13.982 21.803 14.06 21.534 14.253 21.491 Z M 10.893 21.491 C 11.11 21.465 11.332 21.478 11.551 21.482 C 11.761 21.488 11.883 21.764 11.747 21.924 C 11.627 22.086 11.404 22.024 11.232 22.036 C 11.075 22.027 10.88 22.076 10.762 21.943 C 10.622 21.804 10.699 21.532 10.893 21.491 Z M 15.948 21.487 C 16.165 21.469 16.385 21.475 16.603 21.484 C 16.803 21.497 16.916 21.758 16.794 21.916 C 16.681 22.082 16.458 22.027 16.288 22.036 C 16.124 22.026 15.916 22.08 15.795 21.935 C 15.661 21.788 15.75 21.519 15.948 21.487 Z M 12.588 21.487 C 12.805 21.469 13.025 21.475 13.243 21.484 C 13.443 21.497 13.556 21.758 13.434 21.916 C 13.321 22.082 13.098 22.027 12.928 22.036 C 12.763 22.026 12.556 22.08 12.434 21.935 C 12.3 21.787 12.389 21.519 12.588 21.487 Z M 17.708 21.067 C 17.865 20.99 18.075 21.104 18.092 21.28 C 18.103 21.449 18.097 21.621 18.084 21.791 C 18.075 21.914 17.969 22.015 17.849 22.03 C 17.724 22.045 17.572 22.047 17.483 21.942 C 17.386 21.844 17.39 21.68 17.48 21.579 C 17.556 21.498 17.531 21.384 17.547 21.285 C 17.554 21.189 17.62 21.103 17.708 21.067 Z M 9.517 19.502 C 9.681 19.441 9.878 19.568 9.882 19.745 C 9.889 19.947 9.89 20.149 9.88 20.351 C 9.87 20.5 9.723 20.621 9.575 20.6 C 9.435 20.589 9.323 20.457 9.327 20.318 C 9.325 20.129 9.323 19.94 9.331 19.751 C 9.335 19.64 9.412 19.537 9.517 19.502 Z M 17.774 19.374 C 17.922 19.326 18.097 19.431 18.122 19.585 C 18.139 19.723 18.124 19.861 18.125 19.999 C 18.119 20.141 18.142 20.317 18.015 20.416 C 17.866 20.548 17.597 20.454 17.57 20.254 C 17.553 20.052 17.57 19.849 17.573 19.646 C 17.572 19.524 17.654 19.406 17.774 19.374 Z M 11.437 10.112 C 11.442 10.075 11.423 9.991 11.488 10.002 C 15.061 10 18.635 10.001 22.208 10.001 C 22.472 10.003 22.737 9.996 23.001 10.005 C 22.999 13.11 23.001 16.215 23 19.32 C 19.146 19.321 15.292 19.322 11.437 19.32 C 11.439 16.251 11.439 13.181 11.437 10.112 Z M 9.487 17.839 C 9.647 17.747 9.875 17.864 9.887 18.049 C 9.899 18.261 9.897 18.475 9.883 18.687 C 9.866 18.895 9.582 18.998 9.433 18.855 C 9.29 18.735 9.342 18.531 9.333 18.368 C 9.34 18.188 9.289 17.936 9.487 17.839 Z M 13.09 11.554 C 13.089 13.624 13.089 15.695 13.09 17.766 C 15.842 17.768 18.595 17.769 21.347 17.766 C 21.349 15.695 21.349 13.625 21.347 11.554 C 18.595 11.552 15.842 11.553 13.09 11.554 Z M 9.547 16.137 C 9.686 16.098 9.851 16.182 9.885 16.325 C 9.915 16.471 9.895 16.62 9.9 16.768 C 9.895 16.897 9.919 17.049 9.823 17.152 C 9.719 17.272 9.513 17.27 9.411 17.148 C 9.332 17.064 9.34 16.94 9.339 16.833 C 9.344 16.683 9.337 16.533 9.347 16.384 C 9.35 16.269 9.436 16.165 9.547 16.137 Z M 9.515 14.471 C 9.653 14.404 9.835 14.48 9.886 14.624 C 9.927 14.769 9.9 14.923 9.907 15.072 C 9.903 15.217 9.931 15.396 9.803 15.499 C 9.656 15.628 9.392 15.544 9.357 15.349 C 9.334 15.151 9.349 14.95 9.349 14.75 C 9.345 14.635 9.405 14.516 9.515 14.471 Z M 10.51 14.263 C 10.665 14.246 10.821 14.26 10.977 14.255 C 11.088 14.257 11.215 14.247 11.301 14.33 C 11.447 14.45 11.411 14.714 11.235 14.787 C 11.091 14.837 10.934 14.807 10.784 14.815 C 10.629 14.812 10.43 14.844 10.331 14.694 C 10.211 14.539 10.314 14.285 10.51 14.263 Z"
+        android:fillColor="@color/white"
+        android:strokeWidth="1"/>
+</vector>
diff --git a/core/res/res/drawable/decor_pip_button_dark.xml b/core/res/res/drawable/decor_pip_button_dark.xml
new file mode 100644 (file)
index 0000000..8a1c43c
--- /dev/null
@@ -0,0 +1,29 @@
+<!--
+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:name="vector"
+    android:width="32dp"
+    android:height="32dp"
+    android:viewportWidth="32"
+    android:viewportHeight="32"
+       android:tint="@color/decor_button_dark_color">
+    <path
+        android:name="path"
+        android:pathData="M 17.644 20.959 C 17.758 20.921 17.879 20.923 17.998 20.921 C 18.601 20.924 19.206 20.916 19.809 20.926 C 20.059 20.918 20.291 21.118 20.313 21.368 C 20.351 21.638 20.126 21.906 19.854 21.916 C 19.16 21.933 18.465 21.937 17.771 21.914 C 17.488 21.897 17.271 21.601 17.334 21.325 C 17.366 21.16 17.488 21.019 17.644 20.959 Z M 9.645 20.959 C 9.759 20.921 9.881 20.923 9.999 20.921 C 10.604 20.924 11.208 20.915 11.813 20.926 C 12.087 20.917 12.333 21.165 12.316 21.439 C 12.314 21.703 12.073 21.926 11.811 21.919 C 11.13 21.93 10.448 21.938 9.768 21.914 C 9.506 21.894 9.298 21.638 9.327 21.379 C 9.341 21.193 9.471 21.024 9.645 20.959 Z M 13.641 20.96 C 13.757 20.92 13.881 20.924 14.002 20.921 C 14.607 20.924 15.212 20.915 15.816 20.926 C 16.063 20.921 16.29 21.121 16.313 21.367 C 16.351 21.638 16.127 21.906 15.854 21.916 C 15.174 21.935 14.494 21.932 13.813 21.918 C 13.578 21.917 13.36 21.731 13.331 21.496 C 13.293 21.273 13.431 21.039 13.641 20.96 Z M 22.231 20.124 C 22.334 19.811 22.77 19.697 23.014 19.918 C 23.29 20.154 23.169 20.558 23.196 20.874 C 23.172 21.176 23.284 21.548 23.037 21.783 C 22.826 21.985 22.512 21.908 22.249 21.924 C 22.001 21.91 21.714 21.976 21.505 21.805 C 21.273 21.626 21.266 21.238 21.493 21.052 C 21.682 20.878 21.958 20.931 22.191 20.921 C 22.208 20.656 22.163 20.384 22.231 20.124 Z M 13.325 20.481 C 13.326 18.987 13.323 17.494 13.326 16 C 16.118 16.001 18.91 16.001 21.701 16 C 21.704 17.494 21.701 18.987 21.703 20.481 L 13.325 20.481 Z M 9.262 17.323 C 9.521 17.193 9.87 17.347 9.943 17.628 C 10.004 17.914 9.952 18.209 9.975 18.499 C 10.005 18.811 9.958 19.123 9.971 19.436 C 9.966 19.648 10.003 19.886 9.869 20.068 C 9.711 20.291 9.363 20.336 9.156 20.156 C 9.011 20.046 8.967 19.858 8.97 19.684 C 8.977 19.206 8.946 18.728 8.971 18.249 C 8.972 17.929 8.901 17.482 9.262 17.323 Z M 22.569 15.818 C 22.875 15.726 23.208 15.992 23.191 16.309 C 23.2 16.956 23.196 17.604 23.194 18.251 C 23.204 18.461 23.086 18.675 22.887 18.754 C 22.582 18.897 22.196 18.645 22.2 18.309 C 22.186 17.644 22.189 16.979 22.198 16.314 C 22.193 16.089 22.348 15.871 22.569 15.818 Z M 9.263 13.323 C 9.522 13.194 9.87 13.347 9.943 13.628 C 10.004 13.915 9.952 14.211 9.975 14.501 C 10.005 14.835 9.955 15.169 9.972 15.504 C 9.977 15.731 9.985 16.007 9.782 16.158 C 9.533 16.378 9.094 16.249 9.001 15.931 C 8.941 15.667 8.984 15.394 8.97 15.126 C 8.941 14.709 8.984 14.293 8.97 13.877 C 8.955 13.656 9.048 13.413 9.263 13.323 Z M 22.569 11.818 C 22.875 11.726 23.208 11.993 23.192 12.31 C 23.2 12.958 23.196 13.605 23.194 14.253 C 23.204 14.464 23.084 14.677 22.884 14.756 C 22.579 14.896 22.195 14.644 22.2 14.309 C 22.186 13.663 22.192 13.015 22.196 12.368 C 22.178 12.127 22.325 11.874 22.569 11.818 Z M 9.339 10.022 C 9.576 9.976 9.819 10.04 10.059 10.023 C 10.315 10.03 10.626 9.968 10.824 10.175 C 11.028 10.37 11.006 10.733 10.785 10.906 C 10.566 11.084 10.267 10.996 10.009 11.028 C 9.877 11.364 10.111 11.837 9.813 12.131 C 9.557 12.4 9.044 12.245 8.988 11.876 C 8.948 11.481 8.989 11.082 8.949 10.686 C 8.919 10.409 9.055 10.102 9.339 10.022 Z M 16.459 10.026 C 16.953 10.028 17.448 9.993 17.941 10.023 C 18.168 10.031 18.401 9.996 18.624 10.052 C 18.902 10.131 19.052 10.48 18.917 10.737 C 18.834 10.92 18.635 11.025 18.438 11.02 C 17.771 11.026 17.104 11.034 16.438 11.015 C 16.177 11.008 15.956 10.759 15.976 10.499 C 15.979 10.245 16.206 10.03 16.459 10.026 Z M 20.457 10.027 C 20.97 10.025 21.484 9.995 21.997 10.023 C 22.249 10.036 22.531 9.969 22.756 10.117 C 22.978 10.264 23.034 10.599 22.873 10.811 C 22.776 10.954 22.602 11.022 22.434 11.02 C 21.77 11.026 21.106 11.034 20.443 11.015 C 20.179 11.01 19.958 10.762 19.976 10.501 C 19.979 10.247 20.205 10.031 20.457 10.027 Z M 12.461 10.026 C 12.973 10.026 13.486 9.994 13.998 10.023 C 14.249 10.036 14.529 9.97 14.754 10.115 C 14.978 10.262 15.036 10.6 14.871 10.813 C 14.775 10.954 14.604 11.021 14.437 11.02 C 13.772 11.026 13.106 11.034 12.441 11.015 C 12.178 11.009 11.956 10.76 11.976 10.499 C 11.98 10.244 12.208 10.029 12.461 10.026 Z"
+        android:fillColor="@color/white"
+        android:strokeWidth="1"/>
+</vector>
diff --git a/core/res/res/drawable/decor_pip_button_light.xml b/core/res/res/drawable/decor_pip_button_light.xml
new file mode 100644 (file)
index 0000000..84433b5
--- /dev/null
@@ -0,0 +1,29 @@
+<!--
+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:name="vector"
+    android:width="32dp"
+    android:height="32dp"
+    android:viewportWidth="32"
+    android:viewportHeight="32"
+       android:tint="@color/decor_button_light_color">
+    <path
+        android:name="path"
+        android:pathData="M 17.644 20.959 C 17.758 20.921 17.879 20.923 17.998 20.921 C 18.601 20.924 19.206 20.916 19.809 20.926 C 20.059 20.918 20.291 21.118 20.313 21.368 C 20.351 21.638 20.126 21.906 19.854 21.916 C 19.16 21.933 18.465 21.937 17.771 21.914 C 17.488 21.897 17.271 21.601 17.334 21.325 C 17.366 21.16 17.488 21.019 17.644 20.959 Z M 9.645 20.959 C 9.759 20.921 9.881 20.923 9.999 20.921 C 10.604 20.924 11.208 20.915 11.813 20.926 C 12.087 20.917 12.333 21.165 12.316 21.439 C 12.314 21.703 12.073 21.926 11.811 21.919 C 11.13 21.93 10.448 21.938 9.768 21.914 C 9.506 21.894 9.298 21.638 9.327 21.379 C 9.341 21.193 9.471 21.024 9.645 20.959 Z M 13.641 20.96 C 13.757 20.92 13.881 20.924 14.002 20.921 C 14.607 20.924 15.212 20.915 15.816 20.926 C 16.063 20.921 16.29 21.121 16.313 21.367 C 16.351 21.638 16.127 21.906 15.854 21.916 C 15.174 21.935 14.494 21.932 13.813 21.918 C 13.578 21.917 13.36 21.731 13.331 21.496 C 13.293 21.273 13.431 21.039 13.641 20.96 Z M 22.231 20.124 C 22.334 19.811 22.77 19.697 23.014 19.918 C 23.29 20.154 23.169 20.558 23.196 20.874 C 23.172 21.176 23.284 21.548 23.037 21.783 C 22.826 21.985 22.512 21.908 22.249 21.924 C 22.001 21.91 21.714 21.976 21.505 21.805 C 21.273 21.626 21.266 21.238 21.493 21.052 C 21.682 20.878 21.958 20.931 22.191 20.921 C 22.208 20.656 22.163 20.384 22.231 20.124 Z M 13.325 20.481 C 13.326 18.987 13.323 17.494 13.326 16 C 16.118 16.001 18.91 16.001 21.701 16 C 21.704 17.494 21.701 18.987 21.703 20.481 L 13.325 20.481 Z M 9.262 17.323 C 9.521 17.193 9.87 17.347 9.943 17.628 C 10.004 17.914 9.952 18.209 9.975 18.499 C 10.005 18.811 9.958 19.123 9.971 19.436 C 9.966 19.648 10.003 19.886 9.869 20.068 C 9.711 20.291 9.363 20.336 9.156 20.156 C 9.011 20.046 8.967 19.858 8.97 19.684 C 8.977 19.206 8.946 18.728 8.971 18.249 C 8.972 17.929 8.901 17.482 9.262 17.323 Z M 22.569 15.818 C 22.875 15.726 23.208 15.992 23.191 16.309 C 23.2 16.956 23.196 17.604 23.194 18.251 C 23.204 18.461 23.086 18.675 22.887 18.754 C 22.582 18.897 22.196 18.645 22.2 18.309 C 22.186 17.644 22.189 16.979 22.198 16.314 C 22.193 16.089 22.348 15.871 22.569 15.818 Z M 9.263 13.323 C 9.522 13.194 9.87 13.347 9.943 13.628 C 10.004 13.915 9.952 14.211 9.975 14.501 C 10.005 14.835 9.955 15.169 9.972 15.504 C 9.977 15.731 9.985 16.007 9.782 16.158 C 9.533 16.378 9.094 16.249 9.001 15.931 C 8.941 15.667 8.984 15.394 8.97 15.126 C 8.941 14.709 8.984 14.293 8.97 13.877 C 8.955 13.656 9.048 13.413 9.263 13.323 Z M 22.569 11.818 C 22.875 11.726 23.208 11.993 23.192 12.31 C 23.2 12.958 23.196 13.605 23.194 14.253 C 23.204 14.464 23.084 14.677 22.884 14.756 C 22.579 14.896 22.195 14.644 22.2 14.309 C 22.186 13.663 22.192 13.015 22.196 12.368 C 22.178 12.127 22.325 11.874 22.569 11.818 Z M 9.339 10.022 C 9.576 9.976 9.819 10.04 10.059 10.023 C 10.315 10.03 10.626 9.968 10.824 10.175 C 11.028 10.37 11.006 10.733 10.785 10.906 C 10.566 11.084 10.267 10.996 10.009 11.028 C 9.877 11.364 10.111 11.837 9.813 12.131 C 9.557 12.4 9.044 12.245 8.988 11.876 C 8.948 11.481 8.989 11.082 8.949 10.686 C 8.919 10.409 9.055 10.102 9.339 10.022 Z M 16.459 10.026 C 16.953 10.028 17.448 9.993 17.941 10.023 C 18.168 10.031 18.401 9.996 18.624 10.052 C 18.902 10.131 19.052 10.48 18.917 10.737 C 18.834 10.92 18.635 11.025 18.438 11.02 C 17.771 11.026 17.104 11.034 16.438 11.015 C 16.177 11.008 15.956 10.759 15.976 10.499 C 15.979 10.245 16.206 10.03 16.459 10.026 Z M 20.457 10.027 C 20.97 10.025 21.484 9.995 21.997 10.023 C 22.249 10.036 22.531 9.969 22.756 10.117 C 22.978 10.264 23.034 10.599 22.873 10.811 C 22.776 10.954 22.602 11.022 22.434 11.02 C 21.77 11.026 21.106 11.034 20.443 11.015 C 20.179 11.01 19.958 10.762 19.976 10.501 C 19.979 10.247 20.205 10.031 20.457 10.027 Z M 12.461 10.026 C 12.973 10.026 13.486 9.994 13.998 10.023 C 14.249 10.036 14.529 9.97 14.754 10.115 C 14.978 10.262 15.036 10.6 14.871 10.813 C 14.775 10.954 14.604 11.021 14.437 11.02 C 13.772 11.026 13.106 11.034 12.441 11.015 C 12.178 11.009 11.956 10.76 11.976 10.499 C 11.98 10.244 12.208 10.029 12.461 10.026 Z"
+        android:fillColor="@color/white"
+        android:strokeWidth="1"/>
+</vector>
index 0246736..55edbfc 100644 (file)
             android:focusable="false"
             android:descendantFocusability="blocksDescendants" >
         <Button
+                android:id="@+id/pip_window"
+                android:layout_width="32dp"
+                android:layout_height="32dp"
+                android:layout_margin="5dp"
+                android:padding="4dp"
+                android:layout_gravity="center_vertical|end"
+                android:contentDescription="@string/pip_button_text"
+                android:background="@drawable/decor_pip_button_dark" />
+        <Button
+                android:id="@+id/minimize_window"
+                android:layout_width="32dp"
+                android:layout_height="32dp"
+                android:layout_margin="5dp"
+                android:padding="4dp"
+                android:layout_gravity="center_vertical|end"
+                android:contentDescription="@string/minimize_button_text"
+                android:background="@drawable/decor_minimize_button_dark" />
+        <Button
                 android:id="@+id/maximize_window"
                 android:layout_width="32dp"
                 android:layout_height="32dp"
index 733878b..67a1334 100644 (file)
    <array name="preloaded_freeform_multi_window_drawables">
       <item>@drawable/decor_maximize_button_dark</item>
       <item>@drawable/decor_maximize_button_light</item>
+      <item>@drawable/decor_minimize_button_dark</item>
+      <item>@drawable/decor_minimize_button_light</item>
+      <item>@drawable/decor_pip_button_dark</item>
+      <item>@drawable/decor_pip_button_light</item>
    </array>
 
     <!-- Used in LocalePicker -->
index f0bf98c..2b9da1c 100644 (file)
     <string name="floating_toolbar_close_overflow_description">Close overflow</string>
 
     <!-- Free style window strings -->
+    <!-- Accessibility text for the minimize window button -->
+    <string name="pip_button_text">Picture In Picture</string>
+    <!-- Accessibility text for the minimize window button -->
+    <string name="minimize_button_text">Minimize</string>
     <!-- Accessibility text for the maximize window button -->
     <string name="maximize_button_text">Maximize</string>
     <!-- Accessibility text for the close window button -->
index 77ea947..57dfa63 100644 (file)
 
   <!-- From Phone -->
   <java-symbol type="bool" name="config_built_in_sip_phone" />
+  <java-symbol type="id" name="pip_window" />
+  <java-symbol type="id" name="minimize_window" />
   <java-symbol type="id" name="maximize_window" />
   <java-symbol type="id" name="close_window" />
   <java-symbol type="layout" name="decor_caption" />
   <java-symbol type="drawable" name="decor_caption_title_focused" />
   <java-symbol type="drawable" name="decor_close_button_dark" />
   <java-symbol type="drawable" name="decor_close_button_light" />
+  <java-symbol type="drawable" name="decor_minimize_button_dark" />
+  <java-symbol type="drawable" name="decor_minimize_button_light" />
   <java-symbol type="drawable" name="decor_maximize_button_dark" />
   <java-symbol type="drawable" name="decor_maximize_button_light" />
+  <java-symbol type="drawable" name="decor_pip_button_dark" />
+  <java-symbol type="drawable" name="decor_pip_button_light" />
   <java-symbol type="color" name="decor_button_dark_color" />
   <java-symbol type="color" name="decor_button_light_color" />