diff options
Diffstat (limited to 'core/java/android/widget/PopupWindow.java')
| -rw-r--r-- | core/java/android/widget/PopupWindow.java | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/core/java/android/widget/PopupWindow.java b/core/java/android/widget/PopupWindow.java index a10d6477c774..7fe6190c959c 100644 --- a/core/java/android/widget/PopupWindow.java +++ b/core/java/android/widget/PopupWindow.java @@ -85,6 +85,7 @@ public class PopupWindow { private boolean mTouchable = true; private boolean mOutsideTouchable = false; private boolean mClippingEnabled = true; + private boolean mSplitTouchEnabled; private OnTouchListener mTouchInterceptor; @@ -565,6 +566,36 @@ public class PopupWindow { } /** + * <p>Indicates whether the popup window supports splitting touches.</p> + * + * @return true if the touch splitting is enabled, false otherwise + * + * @see #setSplitTouchEnabled(boolean) + * @hide + */ + public boolean isSplitTouchEnabled() { + return mSplitTouchEnabled; + } + + /** + * <p>Allows the popup window to split touches across other windows that also + * support split touch. When this flag is not set, the first pointer + * that goes down determines the window to which all subsequent touches + * go until all pointers go up. When this flag is set, each pointer + * (not necessarily the first) that goes down determines the window + * to which all subsequent touches of that pointer will go until that + * pointer goes up thereby enabling touches with multiple pointers + * to be split across multiple windows.</p> + * + * @param enabled true if the split touches should be enabled, false otherwise + * @see #isSplitTouchEnabled() + * @hide + */ + public void setSplitTouchEnabled(boolean enabled) { + mSplitTouchEnabled = enabled; + } + + /** * <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 * the current width or height is requested as an explicit size from @@ -889,6 +920,9 @@ public class PopupWindow { if (!mClippingEnabled) { curFlags |= WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS; } + if (mSplitTouchEnabled) { + curFlags |= WindowManager.LayoutParams.FLAG_SPLIT_TOUCH; + } return curFlags; } |
