Loading libs/WindowManager/Shell/res/drawable/desktop_mode_ic_handle_menu_change_aspect_ratio.xml 0 → 100644 +25 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2024 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="20dp" android:height="20dp" android:viewportWidth="24" android:viewportHeight="24"> <path android:fillColor="@color/compat_controls_text" android:pathData="M19,12h-2v3h-3v2h5v-5zM7,9h3L10,7L5,7v5h2L7,9zM21,3L3,3c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h18c1.1,0 2,-0.9 2,-2L23,5c0,-1.1 -0.9,-2 -2,-2zM21,19.01L3,19.01L3,4.99h18v14.02z"/> </vector> libs/WindowManager/Shell/res/layout/desktop_mode_window_decor_handle_menu.xml +8 −0 Original line number Diff line number Diff line Loading @@ -157,6 +157,14 @@ android:drawableStart="@drawable/desktop_mode_ic_handle_menu_manage_windows" android:drawableTint="?androidprv:attr/materialColorOnSurface" style="@style/DesktopModeHandleMenuActionButton" /> <Button android:id="@+id/change_aspect_ratio_button" android:contentDescription="@string/change_aspect_ratio_text" android:text="@string/change_aspect_ratio_text" android:drawableStart="@drawable/desktop_mode_ic_handle_menu_change_aspect_ratio" android:drawableTint="?androidprv:attr/materialColorOnSurface" style="@style/DesktopModeHandleMenuActionButton" /> </LinearLayout> <LinearLayout Loading libs/WindowManager/Shell/res/values/dimen.xml +6 −2 Original line number Diff line number Diff line Loading @@ -523,8 +523,9 @@ <dimen name="desktop_mode_handle_menu_width">216dp</dimen> <!-- The maximum height of the handle menu in desktop mode. Three pills at 52dp each, additional actions pill 156dp, plus 2dp spacing between them plus 4dp top padding. --> <dimen name="desktop_mode_handle_menu_height">322dp</dimen> additional actions pill 208dp, plus 2dp spacing between them plus 4dp top padding. 52*3 + 52*4 + (4-1)*2 + 4 = 374 --> <dimen name="desktop_mode_handle_menu_height">374dp</dimen> <!-- The elevation set on the handle menu pills. --> <dimen name="desktop_mode_handle_menu_pill_elevation">1dp</dimen> Loading @@ -547,6 +548,9 @@ <!-- The height of the handle menu's "Open in browser" pill in desktop mode. --> <dimen name="desktop_mode_handle_menu_open_in_browser_pill_height">52dp</dimen> <!-- The height of the handle menu's "Change aspect ratio" pill in desktop mode. --> <dimen name="desktop_mode_handle_menu_change_aspect_ratio_height">52dp</dimen> <!-- The margin between pills of the handle menu in desktop mode. --> <dimen name="desktop_mode_handle_menu_pill_spacing_margin">2dp</dimen> Loading libs/WindowManager/Shell/res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -305,6 +305,8 @@ <string name="new_window_text">New Window</string> <!-- Accessibility text for the handle menu new window button [CHAR LIMIT=NONE] --> <string name="manage_windows_text">Manage Windows</string> <!-- Accessibility text for the handle menu change aspect ratio button [CHAR LIMIT=NONE] --> <string name="change_aspect_ratio_text">Change aspect ratio</string> <!-- Accessibility text for the handle menu close button [CHAR LIMIT=NONE] --> <string name="close_text">Close</string> <!-- Accessibility text for the handle menu close menu button [CHAR LIMIT=NONE] --> Loading libs/WindowManager/Shell/src/com/android/wm/shell/compatui/CompatUIController.java +7 −1 Original line number Diff line number Diff line Loading @@ -688,6 +688,12 @@ public class CompatUIController implements OnDisplaysChangedListener, private void launchUserAspectRatioSettings( @NonNull TaskInfo taskInfo, @NonNull ShellTaskOrganizer.TaskListener taskListener) { launchUserAspectRatioSettings(mContext, taskInfo); } /** Launch the user aspect ratio settings for the package of the given task. */ public static void launchUserAspectRatioSettings( @NonNull Context context, @NonNull TaskInfo taskInfo) { final Intent intent = new Intent(Settings.ACTION_MANAGE_USER_ASPECT_RATIO_SETTINGS); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); Loading @@ -697,7 +703,7 @@ public class CompatUIController implements OnDisplaysChangedListener, intent.setData(packageUri); } final UserHandle userHandle = UserHandle.of(taskInfo.userId); mContext.startActivityAsUser(intent, userHandle); context.startActivityAsUser(intent, userHandle); } @VisibleForTesting Loading Loading
libs/WindowManager/Shell/res/drawable/desktop_mode_ic_handle_menu_change_aspect_ratio.xml 0 → 100644 +25 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2024 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="20dp" android:height="20dp" android:viewportWidth="24" android:viewportHeight="24"> <path android:fillColor="@color/compat_controls_text" android:pathData="M19,12h-2v3h-3v2h5v-5zM7,9h3L10,7L5,7v5h2L7,9zM21,3L3,3c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h18c1.1,0 2,-0.9 2,-2L23,5c0,-1.1 -0.9,-2 -2,-2zM21,19.01L3,19.01L3,4.99h18v14.02z"/> </vector>
libs/WindowManager/Shell/res/layout/desktop_mode_window_decor_handle_menu.xml +8 −0 Original line number Diff line number Diff line Loading @@ -157,6 +157,14 @@ android:drawableStart="@drawable/desktop_mode_ic_handle_menu_manage_windows" android:drawableTint="?androidprv:attr/materialColorOnSurface" style="@style/DesktopModeHandleMenuActionButton" /> <Button android:id="@+id/change_aspect_ratio_button" android:contentDescription="@string/change_aspect_ratio_text" android:text="@string/change_aspect_ratio_text" android:drawableStart="@drawable/desktop_mode_ic_handle_menu_change_aspect_ratio" android:drawableTint="?androidprv:attr/materialColorOnSurface" style="@style/DesktopModeHandleMenuActionButton" /> </LinearLayout> <LinearLayout Loading
libs/WindowManager/Shell/res/values/dimen.xml +6 −2 Original line number Diff line number Diff line Loading @@ -523,8 +523,9 @@ <dimen name="desktop_mode_handle_menu_width">216dp</dimen> <!-- The maximum height of the handle menu in desktop mode. Three pills at 52dp each, additional actions pill 156dp, plus 2dp spacing between them plus 4dp top padding. --> <dimen name="desktop_mode_handle_menu_height">322dp</dimen> additional actions pill 208dp, plus 2dp spacing between them plus 4dp top padding. 52*3 + 52*4 + (4-1)*2 + 4 = 374 --> <dimen name="desktop_mode_handle_menu_height">374dp</dimen> <!-- The elevation set on the handle menu pills. --> <dimen name="desktop_mode_handle_menu_pill_elevation">1dp</dimen> Loading @@ -547,6 +548,9 @@ <!-- The height of the handle menu's "Open in browser" pill in desktop mode. --> <dimen name="desktop_mode_handle_menu_open_in_browser_pill_height">52dp</dimen> <!-- The height of the handle menu's "Change aspect ratio" pill in desktop mode. --> <dimen name="desktop_mode_handle_menu_change_aspect_ratio_height">52dp</dimen> <!-- The margin between pills of the handle menu in desktop mode. --> <dimen name="desktop_mode_handle_menu_pill_spacing_margin">2dp</dimen> Loading
libs/WindowManager/Shell/res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -305,6 +305,8 @@ <string name="new_window_text">New Window</string> <!-- Accessibility text for the handle menu new window button [CHAR LIMIT=NONE] --> <string name="manage_windows_text">Manage Windows</string> <!-- Accessibility text for the handle menu change aspect ratio button [CHAR LIMIT=NONE] --> <string name="change_aspect_ratio_text">Change aspect ratio</string> <!-- Accessibility text for the handle menu close button [CHAR LIMIT=NONE] --> <string name="close_text">Close</string> <!-- Accessibility text for the handle menu close menu button [CHAR LIMIT=NONE] --> Loading
libs/WindowManager/Shell/src/com/android/wm/shell/compatui/CompatUIController.java +7 −1 Original line number Diff line number Diff line Loading @@ -688,6 +688,12 @@ public class CompatUIController implements OnDisplaysChangedListener, private void launchUserAspectRatioSettings( @NonNull TaskInfo taskInfo, @NonNull ShellTaskOrganizer.TaskListener taskListener) { launchUserAspectRatioSettings(mContext, taskInfo); } /** Launch the user aspect ratio settings for the package of the given task. */ public static void launchUserAspectRatioSettings( @NonNull Context context, @NonNull TaskInfo taskInfo) { final Intent intent = new Intent(Settings.ACTION_MANAGE_USER_ASPECT_RATIO_SETTINGS); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); Loading @@ -697,7 +703,7 @@ public class CompatUIController implements OnDisplaysChangedListener, intent.setData(packageUri); } final UserHandle userHandle = UserHandle.of(taskInfo.userId); mContext.startActivityAsUser(intent, userHandle); context.startActivityAsUser(intent, userHandle); } @VisibleForTesting Loading