Loading core/java/com/android/internal/policy/SystemBarUtils.java +17 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.internal.policy; import android.annotation.DimenRes; import android.annotation.NonNull; import android.content.Context; import android.content.res.Resources; import android.graphics.Insets; Loading Loading @@ -99,4 +101,19 @@ public final class SystemBarUtils { public static int getTaskbarHeight(Resources res) { return res.getDimensionPixelSize(R.dimen.taskbar_frame_height); } /** * Gets the default app header height in desktop view in pixels. */ public static int getDesktopViewAppHeaderHeightPx(@NonNull Context context) { return context.getResources().getDimensionPixelSize(getDesktopViewAppHeaderHeightId()); } /** * Gets the dimen resource id of the default app header height in desktop view. */ @DimenRes public static int getDesktopViewAppHeaderHeightId() { return R.dimen.desktop_view_default_header_height; } } core/res/res/values/dimens.xml +3 −0 Original line number Diff line number Diff line Loading @@ -1250,4 +1250,7 @@ <!-- The maximum width for a context menu icon --> <dimen name="list_menu_item_icon_max_width">24dp</dimen> <!-- Default height of desktop view header for freeform tasks on launch. --> <dimen name="desktop_view_default_header_height">40dp</dimen> </resources> core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -5978,4 +5978,6 @@ <!-- Enable OEMs to support scale up anim across tasks.--> <java-symbol type="bool" name="config_enableCrossTaskScaleUpAnimation" /> <!-- Default height of desktop view header for freeform tasks on launch. --> <java-symbol type="dimen" name="desktop_view_default_header_height" /> </resources> libs/WindowManager/Shell/res/values/dimen.xml +0 −3 Original line number Diff line number Diff line Loading @@ -437,9 +437,6 @@ <!-- Height of button (32dp) + 2 * margin (5dp each). --> <dimen name="freeform_decor_caption_height">42dp</dimen> <!-- Height of desktop mode caption for freeform tasks. --> <dimen name="desktop_mode_freeform_decor_caption_height">40dp</dimen> <!-- Height of desktop mode caption for fullscreen tasks. --> <dimen name="desktop_mode_fullscreen_decor_caption_height">36dp</dimen> Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeUtils.kt +0 −10 Original line number Diff line number Diff line Loading @@ -18,10 +18,8 @@ package com.android.wm.shell.desktopmode import android.annotation.DimenRes import android.app.ActivityManager.RunningTaskInfo import android.app.TaskInfo import android.content.Context import android.content.Intent.FLAG_ACTIVITY_CLEAR_TASK import android.content.Intent.FLAG_ACTIVITY_MULTIPLE_TASK import android.content.Intent.FLAG_ACTIVITY_NEW_TASK Loading @@ -38,7 +36,6 @@ import android.graphics.Rect import android.os.SystemProperties import android.util.Size import android.window.DesktopModeFlags import com.android.wm.shell.R import com.android.wm.shell.ShellTaskOrganizer import com.android.wm.shell.common.DisplayController import com.android.wm.shell.common.DisplayLayout Loading Loading @@ -265,13 +262,6 @@ fun isTaskBoundsEqual(taskBounds: Rect, stableBounds: Rect): Boolean { return taskBounds == stableBounds } /** Returns the app header height in desktop mode in pixels. */ fun getAppHeaderHeight(context: Context): Int = context.resources.getDimensionPixelSize(getAppHeaderHeightId()) /** Returns the resource id of the app header height in desktop mode. */ @DimenRes fun getAppHeaderHeightId(): Int = R.dimen.desktop_mode_freeform_decor_caption_height /** * Returns the task bounds a launching task should inherit from an existing running instance. * Returns null if there are no bounds to inherit. Loading Loading
core/java/com/android/internal/policy/SystemBarUtils.java +17 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.internal.policy; import android.annotation.DimenRes; import android.annotation.NonNull; import android.content.Context; import android.content.res.Resources; import android.graphics.Insets; Loading Loading @@ -99,4 +101,19 @@ public final class SystemBarUtils { public static int getTaskbarHeight(Resources res) { return res.getDimensionPixelSize(R.dimen.taskbar_frame_height); } /** * Gets the default app header height in desktop view in pixels. */ public static int getDesktopViewAppHeaderHeightPx(@NonNull Context context) { return context.getResources().getDimensionPixelSize(getDesktopViewAppHeaderHeightId()); } /** * Gets the dimen resource id of the default app header height in desktop view. */ @DimenRes public static int getDesktopViewAppHeaderHeightId() { return R.dimen.desktop_view_default_header_height; } }
core/res/res/values/dimens.xml +3 −0 Original line number Diff line number Diff line Loading @@ -1250,4 +1250,7 @@ <!-- The maximum width for a context menu icon --> <dimen name="list_menu_item_icon_max_width">24dp</dimen> <!-- Default height of desktop view header for freeform tasks on launch. --> <dimen name="desktop_view_default_header_height">40dp</dimen> </resources>
core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -5978,4 +5978,6 @@ <!-- Enable OEMs to support scale up anim across tasks.--> <java-symbol type="bool" name="config_enableCrossTaskScaleUpAnimation" /> <!-- Default height of desktop view header for freeform tasks on launch. --> <java-symbol type="dimen" name="desktop_view_default_header_height" /> </resources>
libs/WindowManager/Shell/res/values/dimen.xml +0 −3 Original line number Diff line number Diff line Loading @@ -437,9 +437,6 @@ <!-- Height of button (32dp) + 2 * margin (5dp each). --> <dimen name="freeform_decor_caption_height">42dp</dimen> <!-- Height of desktop mode caption for freeform tasks. --> <dimen name="desktop_mode_freeform_decor_caption_height">40dp</dimen> <!-- Height of desktop mode caption for fullscreen tasks. --> <dimen name="desktop_mode_fullscreen_decor_caption_height">36dp</dimen> Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeUtils.kt +0 −10 Original line number Diff line number Diff line Loading @@ -18,10 +18,8 @@ package com.android.wm.shell.desktopmode import android.annotation.DimenRes import android.app.ActivityManager.RunningTaskInfo import android.app.TaskInfo import android.content.Context import android.content.Intent.FLAG_ACTIVITY_CLEAR_TASK import android.content.Intent.FLAG_ACTIVITY_MULTIPLE_TASK import android.content.Intent.FLAG_ACTIVITY_NEW_TASK Loading @@ -38,7 +36,6 @@ import android.graphics.Rect import android.os.SystemProperties import android.util.Size import android.window.DesktopModeFlags import com.android.wm.shell.R import com.android.wm.shell.ShellTaskOrganizer import com.android.wm.shell.common.DisplayController import com.android.wm.shell.common.DisplayLayout Loading Loading @@ -265,13 +262,6 @@ fun isTaskBoundsEqual(taskBounds: Rect, stableBounds: Rect): Boolean { return taskBounds == stableBounds } /** Returns the app header height in desktop mode in pixels. */ fun getAppHeaderHeight(context: Context): Int = context.resources.getDimensionPixelSize(getAppHeaderHeightId()) /** Returns the resource id of the app header height in desktop mode. */ @DimenRes fun getAppHeaderHeightId(): Int = R.dimen.desktop_mode_freeform_decor_caption_height /** * Returns the task bounds a launching task should inherit from an existing running instance. * Returns null if there are no bounds to inherit. Loading