summaryrefslogtreecommitdiff
path: root/core/java/android/widget/PopupWindow.java
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2010-09-27 12:37:03 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-09-27 12:37:03 -0700
commit9785bf0f2b6b8758aed7ded3b996a2ef0be89919 (patch)
treee444042c55ec1f06c8997a37b920d6d6b130d73d /core/java/android/widget/PopupWindow.java
parent761427f85b7b7478801dcb4e0fb2f1b824cf1268 (diff)
parent14a288da6a372230d9af41da12241fe500eec837 (diff)
am 14a288da: Merge "Add suuport for splitting touch events across windows." into gingerbread
Merge commit '14a288da6a372230d9af41da12241fe500eec837' into gingerbread-plus-aosp * commit '14a288da6a372230d9af41da12241fe500eec837': Add suuport for splitting touch events across windows.
Diffstat (limited to 'core/java/android/widget/PopupWindow.java')
-rw-r--r--core/java/android/widget/PopupWindow.java34
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;
}