Loading libs/WindowManager/Shell/res/drawable/desktop_mode_header_ic_close.xml 0 → 100644 +26 −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="24dp" android:height="24dp" android:viewportHeight="24" android:viewportWidth="24"> <path android:fillColor="#FF000000" android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/> </vector> libs/WindowManager/Shell/res/layout/desktop_mode_app_controls_window_decor.xml +11 −9 Original line number Diff line number Diff line Loading @@ -33,14 +33,15 @@ android:orientation="horizontal" android:clickable="true" android:focusable="true" android:paddingStart="6dp" android:paddingEnd="8dp"> android:paddingStart="12dp"> <ImageView android:id="@+id/application_icon" android:layout_width="@dimen/desktop_mode_caption_icon_radius" android:layout_height="@dimen/desktop_mode_caption_icon_radius" android:layout_gravity="center_vertical" android:contentDescription="@string/app_icon_text" /> android:contentDescription="@string/app_icon_text" android:layout_marginStart="6dp" android:scaleType="centerCrop"/> <TextView android:id="@+id/application_name" Loading @@ -53,8 +54,7 @@ android:lineHeight="20dp" android:layout_gravity="center_vertical" android:layout_weight="1" android:paddingStart="8dp" android:paddingEnd="8dp" android:layout_marginStart="8dp" tools:text="Gmail"/> <ImageButton Loading @@ -67,6 +67,7 @@ android:scaleType="fitCenter" android:clickable="false" android:focusable="false" android:layout_marginHorizontal="8dp" android:layout_gravity="center_vertical"/> </LinearLayout> Loading @@ -87,14 +88,15 @@ <ImageButton android:id="@+id/close_window" android:layout_width="40dp" android:layout_width="44dp" android:layout_height="40dp" android:padding="4dp" android:paddingHorizontal="10dp" android:paddingVertical="8dp" android:layout_marginEnd="8dp" android:tint="?androidprv:attr/materialColorOnSurface" android:background="?android:selectableItemBackgroundBorderless" android:contentDescription="@string/close_button_text" android:src="@drawable/decor_close_button_dark" android:scaleType="fitCenter" android:src="@drawable/desktop_mode_header_ic_close" android:scaleType="centerCrop" android:gravity="end"/> </com.android.wm.shell.windowdecor.WindowDecorLinearLayout> No newline at end of file libs/WindowManager/Shell/res/values/dimen.xml +12 −5 Original line number Diff line number Diff line Loading @@ -434,15 +434,22 @@ <!-- (32 dp buttons + 10dp margins) * 3 buttons--> <dimen name="caption_right_buttons_width">126dp</dimen> <!-- 2 buttons * 48dp button size. --> <dimen name="desktop_mode_right_edge_buttons_width">96dp</dimen> <!-- 2 buttons * 44dp button size + 16dp total margins. --> <dimen name="desktop_mode_right_edge_buttons_width">104dp</dimen> <!-- 22dp padding + 24dp app icon + 16dp expand button. Text varies in size, we will calculate that width separately. --> <dimen name="desktop_mode_app_details_width_minus_text">62dp</dimen> <!-- 22dp padding + 24dp app icon + 16dp expand button + 86dp text (max) --> <dimen name="desktop_mode_app_details_max_width">148dp</dimen> <!-- When custom headers are requested, this is the width of the left-aligned region that is taken up by caption elements and extra margins. The customizable region starts at the end of this area. --> <dimen name="desktop_mode_customizable_caption_margin_start">84dp</dimen> <!-- When custom headers are requested, this is the width of the right-aligned region that is taken up by caption elements and extra margins. The customizable region ends at the start of this area. --> <dimen name="desktop_mode_customizable_caption_margin_end">152dp</dimen> <!-- The width of the maximize menu in desktop mode. --> <dimen name="desktop_mode_maximize_menu_width">287dp</dimen> Loading Loading @@ -490,7 +497,7 @@ <dimen name="desktop_mode_handle_menu_corner_radius">26dp</dimen> <!-- The radius of the caption menu icon. --> <dimen name="desktop_mode_caption_icon_radius">28dp</dimen> <dimen name="desktop_mode_caption_icon_radius">24dp</dimen> <!-- The radius of the caption menu shadow. --> <dimen name="desktop_mode_handle_menu_shadow_radius">2dp</dimen> Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +11 −14 Original line number Diff line number Diff line Loading @@ -318,28 +318,25 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin relayoutParams.mCaptionHeightId = getCaptionHeightIdStatic(taskInfo.getWindowingMode()); relayoutParams.mCaptionWidthId = getCaptionWidthId(relayoutParams.mLayoutResId); // The "app controls" type caption bar should report the occluding elements as bounding // rects to the insets system so that apps can draw in the empty space left in the center. if (captionLayoutId == R.layout.desktop_mode_app_controls_window_decor) { // The "app chip" section of the caption bar, it's aligned to the left and its width // varies depending on the length of the app name, but we'll report its max width for // now. // TODO(b/316387515): consider reporting the true width after it's been laid out. if (captionLayoutId == R.layout.desktop_mode_app_controls_window_decor && TaskInfoKt.isTransparentCaptionBarAppearance(taskInfo)) { // App is requesting to customize the caption bar. Allow input to fall through to the // windows below so that the app can respond to input events on their custom content. relayoutParams.mAllowCaptionInputFallthrough = true; // Report occluding elements as bounding rects to the insets system so that apps can // draw in the empty space in the center: // First, the "app chip" section of the caption bar (+ some extra margins). final RelayoutParams.OccludingCaptionElement appChipElement = new RelayoutParams.OccludingCaptionElement(); appChipElement.mWidthResId = R.dimen.desktop_mode_app_details_max_width; appChipElement.mWidthResId = R.dimen.desktop_mode_customizable_caption_margin_start; appChipElement.mAlignment = RelayoutParams.OccludingCaptionElement.Alignment.START; relayoutParams.mOccludingCaptionElements.add(appChipElement); // The "controls" section of the caption bar (maximize, close btns). These are aligned // to the right of the caption bar and have a fixed width. // TODO(b/316387515): add additional padding for an exclusive drag-move region. // Then, the right-aligned section (drag space, maximize and close buttons). final RelayoutParams.OccludingCaptionElement controlsElement = new RelayoutParams.OccludingCaptionElement(); controlsElement.mWidthResId = R.dimen.desktop_mode_right_edge_buttons_width; controlsElement.mWidthResId = R.dimen.desktop_mode_customizable_caption_margin_end; controlsElement.mAlignment = RelayoutParams.OccludingCaptionElement.Alignment.END; relayoutParams.mOccludingCaptionElements.add(controlsElement); relayoutParams.mAllowCaptionInputFallthrough = TaskInfoKt.isTransparentCaptionBarAppearance(taskInfo); } if (DesktopModeStatus.useWindowShadow(/* isFocusedWindow= */ taskInfo.isFocused)) { relayoutParams.mShadowRadiusId = taskInfo.isFocused Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/DesktopModeAppControlsWindowDecorationViewHolder.kt +2 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ import android.widget.ImageButton import android.widget.ImageView import android.widget.TextView import androidx.core.content.withStyledAttributes import androidx.core.view.isVisible import com.android.internal.R.attr.materialColorOnSecondaryContainer import com.android.internal.R.attr.materialColorOnSurface import com.android.internal.R.attr.materialColorSecondaryContainer Loading Loading @@ -76,6 +77,7 @@ internal class DesktopModeAppControlsWindowDecorationViewHolder( closeWindowButton.imageTintList = ColorStateList.valueOf(color) maximizeWindowButton.imageTintList = ColorStateList.valueOf(color) expandMenuButton.imageTintList = ColorStateList.valueOf(color) appNameTextView.isVisible = !taskInfo.isTransparentCaptionBarAppearance appNameTextView.setTextColor(color) appIconImageView.imageAlpha = alpha maximizeWindowButton.imageAlpha = alpha Loading Loading
libs/WindowManager/Shell/res/drawable/desktop_mode_header_ic_close.xml 0 → 100644 +26 −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="24dp" android:height="24dp" android:viewportHeight="24" android:viewportWidth="24"> <path android:fillColor="#FF000000" android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/> </vector>
libs/WindowManager/Shell/res/layout/desktop_mode_app_controls_window_decor.xml +11 −9 Original line number Diff line number Diff line Loading @@ -33,14 +33,15 @@ android:orientation="horizontal" android:clickable="true" android:focusable="true" android:paddingStart="6dp" android:paddingEnd="8dp"> android:paddingStart="12dp"> <ImageView android:id="@+id/application_icon" android:layout_width="@dimen/desktop_mode_caption_icon_radius" android:layout_height="@dimen/desktop_mode_caption_icon_radius" android:layout_gravity="center_vertical" android:contentDescription="@string/app_icon_text" /> android:contentDescription="@string/app_icon_text" android:layout_marginStart="6dp" android:scaleType="centerCrop"/> <TextView android:id="@+id/application_name" Loading @@ -53,8 +54,7 @@ android:lineHeight="20dp" android:layout_gravity="center_vertical" android:layout_weight="1" android:paddingStart="8dp" android:paddingEnd="8dp" android:layout_marginStart="8dp" tools:text="Gmail"/> <ImageButton Loading @@ -67,6 +67,7 @@ android:scaleType="fitCenter" android:clickable="false" android:focusable="false" android:layout_marginHorizontal="8dp" android:layout_gravity="center_vertical"/> </LinearLayout> Loading @@ -87,14 +88,15 @@ <ImageButton android:id="@+id/close_window" android:layout_width="40dp" android:layout_width="44dp" android:layout_height="40dp" android:padding="4dp" android:paddingHorizontal="10dp" android:paddingVertical="8dp" android:layout_marginEnd="8dp" android:tint="?androidprv:attr/materialColorOnSurface" android:background="?android:selectableItemBackgroundBorderless" android:contentDescription="@string/close_button_text" android:src="@drawable/decor_close_button_dark" android:scaleType="fitCenter" android:src="@drawable/desktop_mode_header_ic_close" android:scaleType="centerCrop" android:gravity="end"/> </com.android.wm.shell.windowdecor.WindowDecorLinearLayout> No newline at end of file
libs/WindowManager/Shell/res/values/dimen.xml +12 −5 Original line number Diff line number Diff line Loading @@ -434,15 +434,22 @@ <!-- (32 dp buttons + 10dp margins) * 3 buttons--> <dimen name="caption_right_buttons_width">126dp</dimen> <!-- 2 buttons * 48dp button size. --> <dimen name="desktop_mode_right_edge_buttons_width">96dp</dimen> <!-- 2 buttons * 44dp button size + 16dp total margins. --> <dimen name="desktop_mode_right_edge_buttons_width">104dp</dimen> <!-- 22dp padding + 24dp app icon + 16dp expand button. Text varies in size, we will calculate that width separately. --> <dimen name="desktop_mode_app_details_width_minus_text">62dp</dimen> <!-- 22dp padding + 24dp app icon + 16dp expand button + 86dp text (max) --> <dimen name="desktop_mode_app_details_max_width">148dp</dimen> <!-- When custom headers are requested, this is the width of the left-aligned region that is taken up by caption elements and extra margins. The customizable region starts at the end of this area. --> <dimen name="desktop_mode_customizable_caption_margin_start">84dp</dimen> <!-- When custom headers are requested, this is the width of the right-aligned region that is taken up by caption elements and extra margins. The customizable region ends at the start of this area. --> <dimen name="desktop_mode_customizable_caption_margin_end">152dp</dimen> <!-- The width of the maximize menu in desktop mode. --> <dimen name="desktop_mode_maximize_menu_width">287dp</dimen> Loading Loading @@ -490,7 +497,7 @@ <dimen name="desktop_mode_handle_menu_corner_radius">26dp</dimen> <!-- The radius of the caption menu icon. --> <dimen name="desktop_mode_caption_icon_radius">28dp</dimen> <dimen name="desktop_mode_caption_icon_radius">24dp</dimen> <!-- The radius of the caption menu shadow. --> <dimen name="desktop_mode_handle_menu_shadow_radius">2dp</dimen> Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +11 −14 Original line number Diff line number Diff line Loading @@ -318,28 +318,25 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin relayoutParams.mCaptionHeightId = getCaptionHeightIdStatic(taskInfo.getWindowingMode()); relayoutParams.mCaptionWidthId = getCaptionWidthId(relayoutParams.mLayoutResId); // The "app controls" type caption bar should report the occluding elements as bounding // rects to the insets system so that apps can draw in the empty space left in the center. if (captionLayoutId == R.layout.desktop_mode_app_controls_window_decor) { // The "app chip" section of the caption bar, it's aligned to the left and its width // varies depending on the length of the app name, but we'll report its max width for // now. // TODO(b/316387515): consider reporting the true width after it's been laid out. if (captionLayoutId == R.layout.desktop_mode_app_controls_window_decor && TaskInfoKt.isTransparentCaptionBarAppearance(taskInfo)) { // App is requesting to customize the caption bar. Allow input to fall through to the // windows below so that the app can respond to input events on their custom content. relayoutParams.mAllowCaptionInputFallthrough = true; // Report occluding elements as bounding rects to the insets system so that apps can // draw in the empty space in the center: // First, the "app chip" section of the caption bar (+ some extra margins). final RelayoutParams.OccludingCaptionElement appChipElement = new RelayoutParams.OccludingCaptionElement(); appChipElement.mWidthResId = R.dimen.desktop_mode_app_details_max_width; appChipElement.mWidthResId = R.dimen.desktop_mode_customizable_caption_margin_start; appChipElement.mAlignment = RelayoutParams.OccludingCaptionElement.Alignment.START; relayoutParams.mOccludingCaptionElements.add(appChipElement); // The "controls" section of the caption bar (maximize, close btns). These are aligned // to the right of the caption bar and have a fixed width. // TODO(b/316387515): add additional padding for an exclusive drag-move region. // Then, the right-aligned section (drag space, maximize and close buttons). final RelayoutParams.OccludingCaptionElement controlsElement = new RelayoutParams.OccludingCaptionElement(); controlsElement.mWidthResId = R.dimen.desktop_mode_right_edge_buttons_width; controlsElement.mWidthResId = R.dimen.desktop_mode_customizable_caption_margin_end; controlsElement.mAlignment = RelayoutParams.OccludingCaptionElement.Alignment.END; relayoutParams.mOccludingCaptionElements.add(controlsElement); relayoutParams.mAllowCaptionInputFallthrough = TaskInfoKt.isTransparentCaptionBarAppearance(taskInfo); } if (DesktopModeStatus.useWindowShadow(/* isFocusedWindow= */ taskInfo.isFocused)) { relayoutParams.mShadowRadiusId = taskInfo.isFocused Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/DesktopModeAppControlsWindowDecorationViewHolder.kt +2 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ import android.widget.ImageButton import android.widget.ImageView import android.widget.TextView import androidx.core.content.withStyledAttributes import androidx.core.view.isVisible import com.android.internal.R.attr.materialColorOnSecondaryContainer import com.android.internal.R.attr.materialColorOnSurface import com.android.internal.R.attr.materialColorSecondaryContainer Loading Loading @@ -76,6 +77,7 @@ internal class DesktopModeAppControlsWindowDecorationViewHolder( closeWindowButton.imageTintList = ColorStateList.valueOf(color) maximizeWindowButton.imageTintList = ColorStateList.valueOf(color) expandMenuButton.imageTintList = ColorStateList.valueOf(color) appNameTextView.isVisible = !taskInfo.isTransparentCaptionBarAppearance appNameTextView.setTextColor(color) appIconImageView.imageAlpha = alpha maximizeWindowButton.imageAlpha = alpha Loading