Controls popup background

The dropdowns used for structure selection and the add/edit menu need
to use fixed colors. Create a separate background drawable that will
guarantee this.

Fixes: 192441913
Test: manual (open control popup menus)
Change-Id: Iae9d5eaf6f728c1e97edc37d563b440d64e20bcf
This commit is contained in:
Matt Pietal
2021-06-30 09:35:28 -04:00
parent c8bbb99a44
commit db895ae7f4
2 changed files with 27 additions and 4 deletions

View File

@@ -0,0 +1,26 @@
<?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="?android:attr/colorBackgroundFloating" />
<corners
android:bottomLeftRadius="?android:attr/dialogCornerRadius"
android:topLeftRadius="?android:attr/dialogCornerRadius"
android:bottomRightRadius="?android:attr/dialogCornerRadius"
android:topRightRadius="?android:attr/dialogCornerRadius"
/>
</shape>

View File

@@ -22,7 +22,6 @@ import android.content.res.Resources;
import android.util.LayoutDirection;
import android.view.View;
import android.view.View.MeasureSpec;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.ListAdapter;
import android.widget.ListPopupWindow;
@@ -49,11 +48,9 @@ public class GlobalActionsPopupMenu extends ListPopupWindow {
mContext = context;
Resources res = mContext.getResources();
setBackgroundDrawable(
res.getDrawable(R.drawable.rounded_bg_full, context.getTheme()));
res.getDrawable(R.drawable.global_actions_popup_bg, context.getTheme()));
mIsDropDownMode = isDropDownMode;
// required to show above the global actions dialog
setWindowLayoutType(WindowManager.LayoutParams.TYPE_VOLUME_OVERLAY);
setInputMethodMode(INPUT_METHOD_NOT_NEEDED);
setModal(true);