Merge "Fix bug 5386915 - Action mode is intercepting touches it shouldn't be"

This commit is contained in:
Adam Powell
2011-09-28 22:47:08 -07:00
committed by Android (Google) Code Review
2 changed files with 15 additions and 0 deletions

View File

@@ -92,6 +92,7 @@ public class PopupWindow {
private boolean mClipToScreen; private boolean mClipToScreen;
private boolean mAllowScrollingAnchorParent = true; private boolean mAllowScrollingAnchorParent = true;
private boolean mLayoutInsetDecor = false; private boolean mLayoutInsetDecor = false;
private boolean mNotTouchModal;
private OnTouchListener mTouchInterceptor; private OnTouchListener mTouchInterceptor;
@@ -693,6 +694,15 @@ public class PopupWindow {
return mWindowLayoutType; return mWindowLayoutType;
} }
/**
* Set whether this window is touch modal or if outside touches will be sent to
* other windows behind it.
* @hide
*/
public void setTouchModal(boolean touchModal) {
mNotTouchModal = !touchModal;
}
/** /**
* <p>Change the width and height measure specs that are given to the * <p>Change the width and height measure specs that are given to the
* window manager by the popup. By default these are 0, meaning that * window manager by the popup. By default these are 0, meaning that
@@ -1048,6 +1058,9 @@ public class PopupWindow {
if (mLayoutInsetDecor) { if (mLayoutInsetDecor) {
curFlags |= WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR; curFlags |= WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR;
} }
if (mNotTouchModal) {
curFlags |= WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;
}
return curFlags; return curFlags;
} }

View File

@@ -2154,6 +2154,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
mActionModePopup.setLayoutInScreenEnabled(true); mActionModePopup.setLayoutInScreenEnabled(true);
mActionModePopup.setLayoutInsetDecor(true); mActionModePopup.setLayoutInsetDecor(true);
mActionModePopup.setFocusable(true); mActionModePopup.setFocusable(true);
mActionModePopup.setOutsideTouchable(false);
mActionModePopup.setTouchModal(false);
mActionModePopup.setWindowLayoutType( mActionModePopup.setWindowLayoutType(
WindowManager.LayoutParams.TYPE_APPLICATION); WindowManager.LayoutParams.TYPE_APPLICATION);
mActionModePopup.setContentView(mActionModeView); mActionModePopup.setContentView(mActionModeView);