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
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (C) 2021 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.
|
||||
-->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#FF000000"/>
|
||||
|
||||
<corners android:radius="@dimen/pip_corner_radius" />
|
||||
</shape>
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user