summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/java/android/widget/MediaController.java3
-rw-r--r--core/java/android/widget/PopupWindow.java16
-rwxr-xr-xcore/res/res/values/attrs.xml13
-rw-r--r--core/res/res/values/public.xml5
4 files changed, 27 insertions, 10 deletions
diff --git a/core/java/android/widget/MediaController.java b/core/java/android/widget/MediaController.java
index 27a6ad3..690164c 100644
--- a/core/java/android/widget/MediaController.java
+++ b/core/java/android/widget/MediaController.java
@@ -298,7 +298,8 @@ public class MediaController extends FrameLayout {
p.y = anchorpos[1] + mAnchor.getHeight() - p.height;
p.format = PixelFormat.TRANSLUCENT;
p.type = WindowManager.LayoutParams.TYPE_APPLICATION_PANEL;
- p.flags |= WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
+ p.flags |= WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM
+ | WindowManager.LayoutParams.FLAG_SPLIT_TOUCH;
p.token = null;
p.windowAnimations = 0; // android.R.style.DropDownAnimationDown;
mWindowManager.addView(mDecor, p);
diff --git a/core/java/android/widget/PopupWindow.java b/core/java/android/widget/PopupWindow.java
index 95678c6..0f61cd4 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) {
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index d305260..d6684fe 100755
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -345,6 +345,18 @@
because there will be no such interaction coming. -->
<attr name="windowNoDisplay" format="boolean" />
+ <!-- Flag indicating that this window should allow touches to be split
+ across other windows that also support split touch.
+ The default value is true for applications with a targetSdkVersion
+ of Honeycomb or newer; false otherwise.
+ 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 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 pointers go up thereby enabling touches
+ with multiple pointers to be split across multiple windows. -->
+ <attr name="windowEnableSplitTouch" format="boolean" />
+
<!-- ============ -->
<!-- Alert Dialog styles -->
<!-- ============ -->
@@ -1227,6 +1239,7 @@
<attr name="windowActionBar" />
<attr name="windowActionModeOverlay" />
<attr name="windowActionBarOverlay" />
+ <attr name="windowEnableSplitTouch" />
</declare-styleable>
<!-- The set of attributes that describe a AlertDialog's theme. -->
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index cecf470..28df995 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -1365,12 +1365,13 @@
<public type="attr" name="selectableItemBackground" />
<public type="attr" name="autoAdvanceViewId" />
<public type="attr" name="useIntrinsicSizeAsMinimum" />
-
<public type="attr" name="actionModeCutDrawable" />
<public type="attr" name="actionModeCopyDrawable" />
<public type="attr" name="actionModePasteDrawable" />
<public type="attr" name="textEditPasteWindowLayout" />
<public type="attr" name="textEditNoPasteWindowLayout" />
+ <public type="attr" name="textIsSelectable" />
+ <public type="attr" name="windowEnableSplitTouch" />
<public type="anim" name="animator_fade_in" />
<public type="anim" name="animator_fade_out" />
@@ -1440,6 +1441,4 @@
<public type="style" name="Theme.Holo.DialogWhenLarge" />
<public type="string" name="selectTextMode" />
-
- <public type="attr" name="textIsSelectable" />
</resources>