From 7366a4b1b97d0223e37eb5e0749ed55733cd2762 Mon Sep 17 00:00:00 2001 From: Ben Lin Date: Mon, 12 Apr 2021 16:25:59 -0700 Subject: [PATCH] PiP: Add rounded corners to the menu. Bug: 184972396 Test: Manual. Enter PiP, see rounded corners on the menu when showing the menu. Change-Id: I4af6a48ecb07fce8b96acd775ab6538d9f6cb198 --- .../res/drawable/pip_menu_background.xml | 22 +++++++++++++++++++ .../wm/shell/pip/phone/PipMenuView.java | 6 ++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 libs/WindowManager/Shell/res/drawable/pip_menu_background.xml diff --git a/libs/WindowManager/Shell/res/drawable/pip_menu_background.xml b/libs/WindowManager/Shell/res/drawable/pip_menu_background.xml new file mode 100644 index 0000000000000..29907a61b4cc4 --- /dev/null +++ b/libs/WindowManager/Shell/res/drawable/pip_menu_background.xml @@ -0,0 +1,22 @@ + + + + + + + \ No newline at end of file diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java index 7e594a43a52fe..3c25a13e94ebf 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java @@ -130,7 +130,11 @@ public class PipMenuView extends FrameLayout { mAccessibilityManager = context.getSystemService(AccessibilityManager.class); inflate(context, R.layout.pip_menu, this); - mBackgroundDrawable = new ColorDrawable(Color.BLACK); + final boolean enableCornerRadius = mContext.getResources() + .getBoolean(R.bool.config_pipEnableRoundCorner); + mBackgroundDrawable = enableCornerRadius + ? mContext.getDrawable(R.drawable.pip_menu_background) + : new ColorDrawable(Color.BLACK); mBackgroundDrawable.setAlpha(0); mViewRoot = findViewById(R.id.background); mViewRoot.setBackground(mBackgroundDrawable);