• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

frameworks/base


Commit MetaInfo

Revisione40a336b70d3b99213082ad74e2b0d88d0f3584a (tree)
Zeit2020-03-24 04:46:01
AutorJon West <electrikjesus@gmai...>
CommiterJon West

Log Message

[Pie port] Add minimize & pip buttons to freeform windows

Thanks to @farmerbb for assistance and @rogerdott for the graphics

Change-Id: I8ddad6eab27f52574ee1c10e8006612fb46a83c5

Ändern Zusammenfassung

Diff

--- a/core/java/android/view/Window.java
+++ b/core/java/android/view/Window.java
@@ -624,6 +624,8 @@ public abstract class Window {
624624
625625 /** Returns whether the window belongs to the task root. */
626626 boolean isTaskRoot();
627+
628+ boolean moveTaskToBack(boolean nonRoot);
627629 }
628630
629631 /**
--- a/core/java/com/android/internal/policy/DecorView.java
+++ b/core/java/com/android/internal/policy/DecorView.java
@@ -1994,6 +1994,10 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind
19941994 }
19951995
19961996 private void setLightDecorCaptionShade(DecorCaptionView view) {
1997+ view.findViewById(R.id.pip_window).setBackgroundResource(
1998+ R.drawable.decor_pip_button_light);
1999+ view.findViewById(R.id.minimize_window).setBackgroundResource(
2000+ R.drawable.decor_minimize_button_light);
19972001 view.findViewById(R.id.maximize_window).setBackgroundResource(
19982002 R.drawable.decor_maximize_button_light);
19992003 view.findViewById(R.id.close_window).setBackgroundResource(
@@ -2001,6 +2005,10 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind
20012005 }
20022006
20032007 private void setDarkDecorCaptionShade(DecorCaptionView view) {
2008+ view.findViewById(R.id.pip_window).setBackgroundResource(
2009+ R.drawable.decor_pip_button_dark);
2010+ view.findViewById(R.id.minimize_window).setBackgroundResource(
2011+ R.drawable.decor_minimize_button_dark);
20042012 view.findViewById(R.id.maximize_window).setBackgroundResource(
20052013 R.drawable.decor_maximize_button_dark);
20062014 view.findViewById(R.id.close_window).setBackgroundResource(
--- a/core/java/com/android/internal/widget/DecorCaptionView.java
+++ b/core/java/com/android/internal/widget/DecorCaptionView.java
@@ -86,6 +86,8 @@ public class DecorCaptionView extends ViewGroup implements View.OnTouchListener,
8686
8787 private View mCaption;
8888 private View mContent;
89+ private View mPip;
90+ private View mMinimize;
8991 private View mMaximize;
9092 private View mClose;
9193
@@ -102,6 +104,8 @@ public class DecorCaptionView extends ViewGroup implements View.OnTouchListener,
102104 private GestureDetector mGestureDetector;
103105 private final Rect mCloseRect = new Rect();
104106 private final Rect mMaximizeRect = new Rect();
107+ private final Rect mMinimizeRect = new Rect();
108+ private final Rect mPipRect = new Rect();
105109 private View mClickTarget;
106110
107111 public DecorCaptionView(Context context) {
@@ -143,6 +147,8 @@ public class DecorCaptionView extends ViewGroup implements View.OnTouchListener,
143147 // By changing the outline provider to BOUNDS, the window can remove its
144148 // background without removing the shadow.
145149 mOwner.getDecorView().setOutlineProvider(ViewOutlineProvider.BOUNDS);
150+ mPip = findViewById(R.id.pip_window);
151+ mMinimize = findViewById(R.id.minimize_window);
146152 mMaximize = findViewById(R.id.maximize_window);
147153 mClose = findViewById(R.id.close_window);
148154 }
@@ -154,6 +160,13 @@ public class DecorCaptionView extends ViewGroup implements View.OnTouchListener,
154160 if (ev.getAction() == MotionEvent.ACTION_DOWN) {
155161 final int x = (int) ev.getX();
156162 final int y = (int) ev.getY();
163+ // Only offset y for containment tests because the actual views are already translated.
164+ if (mPipRect.contains(x, y)) {
165+ mClickTarget = mPip;
166+ }
167+ if (mMinimizeRect.contains(x, y)) {
168+ mClickTarget = mMinimize;
169+ }
157170 if (mMaximizeRect.contains(x, y)) {
158171 mClickTarget = mMaximize;
159172 }
@@ -298,10 +311,14 @@ public class DecorCaptionView extends ViewGroup implements View.OnTouchListener,
298311 if (mCaption.getVisibility() != View.GONE) {
299312 mCaption.layout(0, 0, mCaption.getMeasuredWidth(), mCaption.getMeasuredHeight());
300313 captionHeight = mCaption.getBottom() - mCaption.getTop();
314+ mPip.getHitRect(mPipRect);
315+ mMinimize.getHitRect(mMinimizeRect);
301316 mMaximize.getHitRect(mMaximizeRect);
302317 mClose.getHitRect(mCloseRect);
303318 } else {
304319 captionHeight = 0;
320+ mPipRect.setEmpty();
321+ mMinimizeRect.setEmpty();
305322 mMaximizeRect.setEmpty();
306323 mCloseRect.setEmpty();
307324 }
@@ -316,7 +333,7 @@ public class DecorCaptionView extends ViewGroup implements View.OnTouchListener,
316333 }
317334
318335 // This assumes that the caption bar is at the top.
319- mOwner.notifyRestrictedCaptionAreaCallback(mMaximize.getLeft(), mMaximize.getTop(),
336+ mOwner.notifyRestrictedCaptionAreaCallback(mPip.getLeft(), mMaximize.getTop(),
320337 mClose.getRight(), mClose.getBottom());
321338 }
322339 /**
@@ -353,6 +370,20 @@ public class DecorCaptionView extends ViewGroup implements View.OnTouchListener,
353370 }
354371 }
355372
373+ private void minimizeWindow() {
374+ Window.WindowControllerCallback callback = mOwner.getWindowControllerCallback();
375+ if (callback != null) {
376+ callback.moveTaskToBack(true);
377+ }
378+ }
379+
380+ private void pipWindow() {
381+ Window.WindowControllerCallback callback = mOwner.getWindowControllerCallback();
382+ if (callback != null) {
383+ callback.enterPictureInPictureModeIfPossible(); /* Send the task to PIP mode if the task supports it. */
384+ }
385+ }
386+
356387 public boolean isCaptionShowing() {
357388 return mShow;
358389 }
@@ -405,7 +436,11 @@ public class DecorCaptionView extends ViewGroup implements View.OnTouchListener,
405436
406437 @Override
407438 public boolean onSingleTapUp(MotionEvent e) {
408- if (mClickTarget == mMaximize) {
439+ if (mClickTarget == mMinimize) {
440+ minimizeWindow();
441+ } else if (mClickTarget == mPip) {
442+ pipWindow();
443+ } else if (mClickTarget == mMaximize) {
409444 maximizeWindow();
410445 } else if (mClickTarget == mClose) {
411446 mOwner.dispatchOnWindowDismissed(
--- /dev/null
+++ b/core/res/res/drawable/decor_minimize_button_dark.xml
@@ -0,0 +1,30 @@
1+<?xml version="1.0" encoding="utf-8"?>
2+<!-- Copyright (C) 2015 The Android Open Source Project
3+
4+ Licensed under the Apache License, Version 2.0 (the "License");
5+ you may not use this file except in compliance with the License.
6+ You may obtain a copy of the License at
7+
8+ http://www.apache.org/licenses/LICENSE-2.0
9+
10+ Unless required by applicable law or agreed to in writing, software
11+ distributed under the License is distributed on an "AS IS" BASIS,
12+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ See the License for the specific language governing permissions and
14+ limitations under the License.
15+-->
16+
17+<vector
18+ xmlns:android="http://schemas.android.com/apk/res/android"
19+ android:name="vector"
20+ android:width="32dp"
21+ android:height="32dp"
22+ android:viewportWidth="32"
23+ android:viewportHeight="32"
24+ android:tint="@color/decor_button_dark_color">
25+ <path
26+ android:name="path"
27+ 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"
28+ android:fillColor="@color/white"
29+ android:strokeWidth="1"/>
30+</vector>
--- /dev/null
+++ b/core/res/res/drawable/decor_minimize_button_light.xml
@@ -0,0 +1,30 @@
1+<!--
2+Copyright (C) 2015 The Android Open Source Project
3+
4+ Licensed under the Apache License, Version 2.0 (the "License");
5+ you may not use this file except in compliance with the License.
6+ You may obtain a copy of the License at
7+
8+ http://www.apache.org/licenses/LICENSE-2.0
9+
10+ Unless required by applicable law or agreed to in writing, software
11+ distributed under the License is distributed on an "AS IS" BASIS,
12+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ See the License for the specific language governing permissions and
14+ limitations under the License.
15+-->
16+
17+<vector
18+ xmlns:android="http://schemas.android.com/apk/res/android"
19+ android:name="vector"
20+ android:width="32dp"
21+ android:height="32dp"
22+ android:viewportWidth="32"
23+ android:viewportHeight="32"
24+ android:tint="@color/decor_button_light_color">
25+ <path
26+ android:name="path"
27+ 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"
28+ android:fillColor="@color/white"
29+ android:strokeWidth="1"/>
30+</vector>
--- /dev/null
+++ b/core/res/res/drawable/decor_pip_button_dark.xml
@@ -0,0 +1,29 @@
1+<!--
2+Copyright (C) 2015 The Android Open Source Project
3+
4+ Licensed under the Apache License, Version 2.0 (the "License");
5+ you may not use this file except in compliance with the License.
6+ You may obtain a copy of the License at
7+
8+ http://www.apache.org/licenses/LICENSE-2.0
9+
10+ Unless required by applicable law or agreed to in writing, software
11+ distributed under the License is distributed on an "AS IS" BASIS,
12+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ See the License for the specific language governing permissions and
14+ limitations under the License.
15+-->
16+<vector
17+ xmlns:android="http://schemas.android.com/apk/res/android"
18+ android:name="vector"
19+ android:width="32dp"
20+ android:height="32dp"
21+ android:viewportWidth="32"
22+ android:viewportHeight="32"
23+ android:tint="@color/decor_button_dark_color">
24+ <path
25+ android:name="path"
26+ 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"
27+ android:fillColor="@color/white"
28+ android:strokeWidth="1"/>
29+</vector>
--- /dev/null
+++ b/core/res/res/drawable/decor_pip_button_light.xml
@@ -0,0 +1,29 @@
1+<!--
2+Copyright (C) 2015 The Android Open Source Project
3+
4+ Licensed under the Apache License, Version 2.0 (the "License");
5+ you may not use this file except in compliance with the License.
6+ You may obtain a copy of the License at
7+
8+ http://www.apache.org/licenses/LICENSE-2.0
9+
10+ Unless required by applicable law or agreed to in writing, software
11+ distributed under the License is distributed on an "AS IS" BASIS,
12+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ See the License for the specific language governing permissions and
14+ limitations under the License.
15+-->
16+<vector
17+ xmlns:android="http://schemas.android.com/apk/res/android"
18+ android:name="vector"
19+ android:width="32dp"
20+ android:height="32dp"
21+ android:viewportWidth="32"
22+ android:viewportHeight="32"
23+ android:tint="@color/decor_button_light_color">
24+ <path
25+ android:name="path"
26+ 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"
27+ android:fillColor="@color/white"
28+ android:strokeWidth="1"/>
29+</vector>
--- a/core/res/res/layout/decor_caption.xml
+++ b/core/res/res/layout/decor_caption.xml
@@ -31,6 +31,24 @@
3131 android:focusable="false"
3232 android:descendantFocusability="blocksDescendants" >
3333 <Button
34+ android:id="@+id/pip_window"
35+ android:layout_width="32dp"
36+ android:layout_height="32dp"
37+ android:layout_margin="5dp"
38+ android:padding="4dp"
39+ android:layout_gravity="center_vertical|end"
40+ android:contentDescription="@string/pip_button_text"
41+ android:background="@drawable/decor_pip_button_dark" />
42+ <Button
43+ android:id="@+id/minimize_window"
44+ android:layout_width="32dp"
45+ android:layout_height="32dp"
46+ android:layout_margin="5dp"
47+ android:padding="4dp"
48+ android:layout_gravity="center_vertical|end"
49+ android:contentDescription="@string/minimize_button_text"
50+ android:background="@drawable/decor_minimize_button_dark" />
51+ <Button
3452 android:id="@+id/maximize_window"
3553 android:layout_width="32dp"
3654 android:layout_height="32dp"
--- a/core/res/res/values/arrays.xml
+++ b/core/res/res/values/arrays.xml
@@ -139,6 +139,10 @@
139139 <array name="preloaded_freeform_multi_window_drawables">
140140 <item>@drawable/decor_maximize_button_dark</item>
141141 <item>@drawable/decor_maximize_button_light</item>
142+ <item>@drawable/decor_minimize_button_dark</item>
143+ <item>@drawable/decor_minimize_button_light</item>
144+ <item>@drawable/decor_pip_button_dark</item>
145+ <item>@drawable/decor_pip_button_light</item>
142146 </array>
143147
144148 <!-- Used in LocalePicker -->
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -4671,6 +4671,10 @@
46714671 <string name="floating_toolbar_close_overflow_description">Close overflow</string>
46724672
46734673 <!-- Free style window strings -->
4674+ <!-- Accessibility text for the minimize window button -->
4675+ <string name="pip_button_text">Picture In Picture</string>
4676+ <!-- Accessibility text for the minimize window button -->
4677+ <string name="minimize_button_text">Minimize</string>
46744678 <!-- Accessibility text for the maximize window button -->
46754679 <string name="maximize_button_text">Maximize</string>
46764680 <!-- Accessibility text for the close window button -->
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -2223,14 +2223,20 @@
22232223
22242224 <!-- From Phone -->
22252225 <java-symbol type="bool" name="config_built_in_sip_phone" />
2226+ <java-symbol type="id" name="pip_window" />
2227+ <java-symbol type="id" name="minimize_window" />
22262228 <java-symbol type="id" name="maximize_window" />
22272229 <java-symbol type="id" name="close_window" />
22282230 <java-symbol type="layout" name="decor_caption" />
22292231 <java-symbol type="drawable" name="decor_caption_title_focused" />
22302232 <java-symbol type="drawable" name="decor_close_button_dark" />
22312233 <java-symbol type="drawable" name="decor_close_button_light" />
2234+ <java-symbol type="drawable" name="decor_minimize_button_dark" />
2235+ <java-symbol type="drawable" name="decor_minimize_button_light" />
22322236 <java-symbol type="drawable" name="decor_maximize_button_dark" />
22332237 <java-symbol type="drawable" name="decor_maximize_button_light" />
2238+ <java-symbol type="drawable" name="decor_pip_button_dark" />
2239+ <java-symbol type="drawable" name="decor_pip_button_light" />
22342240 <java-symbol type="color" name="decor_button_dark_color" />
22352241 <java-symbol type="color" name="decor_button_light_color" />
22362242