Commit 9313b7e3 authored by Theresa Wellington's avatar Theresa Wellington Committed by Commit Bot

[Android] Fix app menu z-index on N/M

BUG=738798

Change-Id: Ic89d30a7ed94e110553712f84b5d02c283522604
Reviewed-on: https://chromium-review.googlesource.com/565341Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Commit-Queue: Theresa <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#485323}
parent 3f975c26
...@@ -13,6 +13,7 @@ import android.content.res.Resources; ...@@ -13,6 +13,7 @@ import android.content.res.Resources;
import android.graphics.Rect; import android.graphics.Rect;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.graphics.drawable.LayerDrawable; import android.graphics.drawable.LayerDrawable;
import android.os.Build;
import android.support.annotation.IdRes; import android.support.annotation.IdRes;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.view.Gravity; import android.view.Gravity;
...@@ -26,6 +27,7 @@ import android.view.View.MeasureSpec; ...@@ -26,6 +27,7 @@ import android.view.View.MeasureSpec;
import android.view.View.OnKeyListener; import android.view.View.OnKeyListener;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.ViewStub; import android.view.ViewStub;
import android.view.WindowManager;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener; import android.widget.AdapterView.OnItemClickListener;
import android.widget.ImageButton; import android.widget.ImageButton;
...@@ -163,6 +165,11 @@ public class AppMenu implements OnItemClickListener, OnKeyListener { ...@@ -163,6 +165,11 @@ public class AppMenu implements OnItemClickListener, OnKeyListener {
mPopup.setFocusable(true); mPopup.setFocusable(true);
mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NOT_NEEDED); mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NOT_NEEDED);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
// The window layout type affects the z-index of the popup window on M+.
mPopup.setWindowLayoutType(WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL);
}
boolean anchorAtBottom = isAnchorAtBottom(anchorView, visibleDisplayFrame); boolean anchorAtBottom = isAnchorAtBottom(anchorView, visibleDisplayFrame);
int footerHeight = 0; int footerHeight = 0;
mPopup.setOnDismissListener(new OnDismissListener() { mPopup.setOnDismissListener(new OnDismissListener() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment