diff options
| author | Jeff Brown <jeffbrown@google.com> | 2010-11-10 16:53:45 -0800 |
|---|---|---|
| committer | Jeff Brown <jeffbrown@google.com> | 2010-11-12 14:53:43 -0800 |
| commit | 46e75294d540fe807d78aec2582ae02cc38c7d42 (patch) | |
| tree | 260678b7532242c8dd31e3aba47710e9516a3c12 /core/java/android/widget/PopupWindow.java | |
| parent | 1a22bdb01ac4068c2876fe2d02f3c4c729669a1c (diff) | |
Enable touch splitting for all windows by default.
New default only applies to applications with targetSdkVersion >=
HONEYCOMB. Old applications default to no touch splitting for
their windows.
In addition, enabled split touch for various system windows.
Bug: 3049580
Change-Id: Idc8da9baa2cd8e1e4e76af8967d7b6a5ccb94427
Diffstat (limited to 'core/java/android/widget/PopupWindow.java')
| -rw-r--r-- | core/java/android/widget/PopupWindow.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/core/java/android/widget/PopupWindow.java b/core/java/android/widget/PopupWindow.java index 95678c6add04..0f61cd4b59fe 100644 --- a/core/java/android/widget/PopupWindow.java +++ b/core/java/android/widget/PopupWindow.java @@ -25,6 +25,7 @@ import android.graphics.PixelFormat; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.graphics.drawable.StateListDrawable; +import android.os.Build; import android.os.IBinder; import android.util.AttributeSet; import android.util.DisplayMetrics; @@ -87,7 +88,7 @@ public class PopupWindow { private boolean mTouchable = true; private boolean mOutsideTouchable = false; private boolean mClippingEnabled = true; - private boolean mSplitTouchEnabled; + private int mSplitTouchEnabled = -1; private boolean mLayoutInScreen; private boolean mClipToScreen; @@ -602,14 +603,17 @@ public class PopupWindow { * @hide */ public boolean isSplitTouchEnabled() { - return mSplitTouchEnabled; + if (mSplitTouchEnabled < 0 && mContext != null) { + return mContext.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.HONEYCOMB; + } + return mSplitTouchEnabled == 1; } /** * <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 + * support split touch. When this flag is false, 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 + * go until all pointers go up. When this flag is true, 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 @@ -620,7 +624,7 @@ public class PopupWindow { * @hide */ public void setSplitTouchEnabled(boolean enabled) { - mSplitTouchEnabled = enabled; + mSplitTouchEnabled = enabled ? 1 : 0; } /** @@ -993,7 +997,7 @@ public class PopupWindow { if (!mClippingEnabled) { curFlags |= WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS; } - if (mSplitTouchEnabled) { + if (isSplitTouchEnabled()) { curFlags |= WindowManager.LayoutParams.FLAG_SPLIT_TOUCH; } if (mLayoutInScreen) { |
