From 594558d7e9a5dc2ff1ce7b5f42c53afb23f85a1f Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Thu, 18 Sep 2014 18:22:29 -0700 Subject: [PATCH] Make panel menu windows respect elevation Bug 17430536 Change-Id: I962dfa10d3cb4f735dcaa68f17e7ff278d1580a2 --- core/res/res/values/themes_material.xml | 2 ++ .../src/com/android/internal/policy/impl/PhoneWindow.java | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/core/res/res/values/themes_material.xml b/core/res/res/values/themes_material.xml index ebff9655b1c91..615ef52d33173 100644 --- a/core/res/res/values/themes_material.xml +++ b/core/res/res/values/themes_material.xml @@ -978,6 +978,7 @@ please see themes_device_defaults.xml. @style/Widget.Material.ListView @style/Animation.DropDownUp @null + @dimen/floating_window_z diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java index 341911950e271..1bdb931b4f404 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java @@ -1241,6 +1241,13 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { st.decorView = new DecorView(getContext(), st.featureId); st.gravity = Gravity.CENTER | Gravity.BOTTOM; st.setStyle(getContext()); + TypedArray a = getContext().obtainStyledAttributes(null, + R.styleable.Window, 0, st.listPresenterTheme); + final float elevation = a.getDimension(R.styleable.Window_windowElevation, 0); + if (elevation != 0) { + st.decorView.setElevation(elevation); + } + a.recycle(); return true; }