Loading libs/WindowManager/Shell/res/drawable/decor_minimize_button_dark.xml 0 → 100644 +24 −0 Original line number Diff line number Diff line <!-- ~ Copyright (C) 2022 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="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24" android:tint="?attr/colorControlNormal"> <path android:fillColor="@android:color/white" android:pathData="M6,21V19H18V21Z"/> </vector> libs/WindowManager/Shell/res/layout/caption_window_decoration.xml +11 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,17 @@ android:layout_height="wrap_content" android:gravity="end" android:background="@drawable/decor_caption_title"> <Button android:id="@+id/minimize_window" android:visibility="gone" android:layout_width="32dp" android:layout_height="32dp" android:layout_margin="5dp" android:padding="4dp" android:layout_gravity="top|end" android:contentDescription="@string/maximize_button_text" android:background="@drawable/decor_minimize_button_dark" android:duplicateParentState="true"/> <Button android:id="@+id/maximize_window" android:layout_width="32dp" Loading @@ -42,4 +53,3 @@ android:background="@drawable/decor_close_button_dark" android:duplicateParentState="true"/> </com.android.wm.shell.windowdecor.WindowDecorLinearLayout> libs/WindowManager/Shell/res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -192,6 +192,8 @@ <!-- Freeform window caption strings --> <!-- Accessibility text for the maximize window button [CHAR LIMIT=NONE] --> <string name="maximize_button_text">Maximize</string> <!-- Accessibility text for the minimize window button [CHAR LIMIT=NONE] --> <string name="minimize_button_text">Minimize</string> <!-- Accessibility text for the close window button [CHAR LIMIT=NONE] --> <string name="close_button_text">Close</string> </resources> libs/WindowManager/Shell/src/com/android/wm/shell/freeform/FreeformTaskTransitionHandler.java +16 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,12 @@ public class FreeformTaskTransitionHandler mPendingTransitionTokens.add(token); } @Override public void startMinimizedModeTransition(WindowContainerTransaction wct) { final int type = WindowManager.TRANSIT_TO_BACK; mPendingTransitionTokens.add(mTransitions.startTransition(type, wct, this)); } @Override public boolean startAnimation(@NonNull IBinder transition, @NonNull TransitionInfo info, @NonNull SurfaceControl.Transaction startT, Loading Loading @@ -121,6 +127,8 @@ public class FreeformTaskTransitionHandler transition, info.getType(), change, startT, finishT); break; case WindowManager.TRANSIT_TO_BACK: transitionHandled |= startMinimizeTransition(transition); break; case WindowManager.TRANSIT_TO_FRONT: break; } Loading Loading @@ -169,6 +177,13 @@ public class FreeformTaskTransitionHandler return false; } private boolean startMinimizeTransition(IBinder transition) { if (!mPendingTransitionTokens.contains(transition)) { return false; } return true; } private boolean startChangeTransition( IBinder transition, int type, Loading Loading @@ -243,4 +258,5 @@ public class FreeformTaskTransitionHandler return null; } } } libs/WindowManager/Shell/src/com/android/wm/shell/freeform/FreeformTaskTransitionStarter.java +10 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,15 @@ public interface FreeformTaskTransitionStarter { * * @param targetWindowingMode the target windowing mode * @param wct the {@link WindowContainerTransaction} that changes the windowing mode * */ void startWindowingModeTransition(int targetWindowingMode, WindowContainerTransaction wct); /** * Starts window minimization transition * * @param wct the {@link WindowContainerTransaction} that changes the windowing mode * */ void startMinimizedModeTransition(WindowContainerTransaction wct); } No newline at end of file Loading
libs/WindowManager/Shell/res/drawable/decor_minimize_button_dark.xml 0 → 100644 +24 −0 Original line number Diff line number Diff line <!-- ~ Copyright (C) 2022 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="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24" android:tint="?attr/colorControlNormal"> <path android:fillColor="@android:color/white" android:pathData="M6,21V19H18V21Z"/> </vector>
libs/WindowManager/Shell/res/layout/caption_window_decoration.xml +11 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,17 @@ android:layout_height="wrap_content" android:gravity="end" android:background="@drawable/decor_caption_title"> <Button android:id="@+id/minimize_window" android:visibility="gone" android:layout_width="32dp" android:layout_height="32dp" android:layout_margin="5dp" android:padding="4dp" android:layout_gravity="top|end" android:contentDescription="@string/maximize_button_text" android:background="@drawable/decor_minimize_button_dark" android:duplicateParentState="true"/> <Button android:id="@+id/maximize_window" android:layout_width="32dp" Loading @@ -42,4 +53,3 @@ android:background="@drawable/decor_close_button_dark" android:duplicateParentState="true"/> </com.android.wm.shell.windowdecor.WindowDecorLinearLayout>
libs/WindowManager/Shell/res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -192,6 +192,8 @@ <!-- Freeform window caption strings --> <!-- Accessibility text for the maximize window button [CHAR LIMIT=NONE] --> <string name="maximize_button_text">Maximize</string> <!-- Accessibility text for the minimize window button [CHAR LIMIT=NONE] --> <string name="minimize_button_text">Minimize</string> <!-- Accessibility text for the close window button [CHAR LIMIT=NONE] --> <string name="close_button_text">Close</string> </resources>
libs/WindowManager/Shell/src/com/android/wm/shell/freeform/FreeformTaskTransitionHandler.java +16 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,12 @@ public class FreeformTaskTransitionHandler mPendingTransitionTokens.add(token); } @Override public void startMinimizedModeTransition(WindowContainerTransaction wct) { final int type = WindowManager.TRANSIT_TO_BACK; mPendingTransitionTokens.add(mTransitions.startTransition(type, wct, this)); } @Override public boolean startAnimation(@NonNull IBinder transition, @NonNull TransitionInfo info, @NonNull SurfaceControl.Transaction startT, Loading Loading @@ -121,6 +127,8 @@ public class FreeformTaskTransitionHandler transition, info.getType(), change, startT, finishT); break; case WindowManager.TRANSIT_TO_BACK: transitionHandled |= startMinimizeTransition(transition); break; case WindowManager.TRANSIT_TO_FRONT: break; } Loading Loading @@ -169,6 +177,13 @@ public class FreeformTaskTransitionHandler return false; } private boolean startMinimizeTransition(IBinder transition) { if (!mPendingTransitionTokens.contains(transition)) { return false; } return true; } private boolean startChangeTransition( IBinder transition, int type, Loading Loading @@ -243,4 +258,5 @@ public class FreeformTaskTransitionHandler return null; } } }
libs/WindowManager/Shell/src/com/android/wm/shell/freeform/FreeformTaskTransitionStarter.java +10 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,15 @@ public interface FreeformTaskTransitionStarter { * * @param targetWindowingMode the target windowing mode * @param wct the {@link WindowContainerTransaction} that changes the windowing mode * */ void startWindowingModeTransition(int targetWindowingMode, WindowContainerTransaction wct); /** * Starts window minimization transition * * @param wct the {@link WindowContainerTransaction} that changes the windowing mode * */ void startMinimizedModeTransition(WindowContainerTransaction wct); } No newline at end of file