diff options
author | Jeff Brown <jeffbrown@google.com> | 2010-12-22 18:29:19 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-12-22 18:29:19 -0800 |
commit | 182f7950b83a4aa6df8e080232c63571f20daabc (patch) | |
tree | 81eccbae636431c4c45441cf9b999fce778cedf8 /core/java | |
parent | 00ee5b46854404a91d903e8bf42d9f900326326c (diff) | |
parent | 995e77431982f9a320451dbe6132a62e69f73bab (diff) | |
download | frameworks_base-182f7950b83a4aa6df8e080232c63571f20daabc.zip frameworks_base-182f7950b83a4aa6df8e080232c63571f20daabc.tar.gz frameworks_base-182f7950b83a4aa6df8e080232c63571f20daabc.tar.bz2 |
Merge "Enable touch splitting by default for Honeycomb apps."
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/view/View.java | 8 | ||||
-rw-r--r-- | core/java/android/view/ViewGroup.java | 9 |
2 files changed, 12 insertions, 5 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index a4ad97b..33ea66c 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -4674,8 +4674,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility } /** - * Default implementation of {@link KeyEvent.Callback#onKeyMultiple(int, int, KeyEvent) - * KeyEvent.Callback.onKeyMultiple()}: perform press of the view + * Default implementation of {@link KeyEvent.Callback#onKeyDown(int, KeyEvent) + * KeyEvent.Callback.onKeyDown()}: perform press of the view * when {@link KeyEvent#KEYCODE_DPAD_CENTER} or {@link KeyEvent#KEYCODE_ENTER} * is released, if the view is enabled and clickable. * @@ -4718,8 +4718,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility } /** - * Default implementation of {@link KeyEvent.Callback#onKeyMultiple(int, int, KeyEvent) - * KeyEvent.Callback.onKeyMultiple()}: perform clicking of the view + * Default implementation of {@link KeyEvent.Callback#onKeyUp(int, KeyEvent) + * KeyEvent.Callback.onKeyUp()}: perform clicking of the view * when {@link KeyEvent#KEYCODE_DPAD_CENTER} or * {@link KeyEvent#KEYCODE_ENTER} is released. * diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index 7b3cc6c..58fadb9 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -31,6 +31,7 @@ import android.graphics.PointF; import android.graphics.Rect; import android.graphics.RectF; import android.graphics.Region; +import android.os.Build; import android.os.Parcelable; import android.os.SystemClock; import android.util.AttributeSet; @@ -350,6 +351,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager mGroupFlags |= FLAG_ANIMATION_CACHE; mGroupFlags |= FLAG_ALWAYS_DRAWN_WITH_CACHE; + if (mContext.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.HONEYCOMB) { + mGroupFlags |= FLAG_SPLIT_MOTION_EVENTS; + } + setDescendantFocusability(FOCUS_BEFORE_DESCENDANTS); mChildren = new View[ARRAY_INITIAL_CAPACITY]; @@ -1568,7 +1573,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager /** * Enable or disable the splitting of MotionEvents to multiple children during touch event - * dispatch. This behavior is disabled by default. + * dispatch. This behavior is enabled by default for applications that target an + * SDK version of {@link Build.VERSION_CODES#HONEYCOMB} or newer. * * <p>When this option is enabled MotionEvents may be split and dispatched to different child * views depending on where each pointer initially went down. This allows for user interactions @@ -1591,6 +1597,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager } /** + * Returns true if MotionEvents dispatched to this ViewGroup can be split to multiple children. * @return true if MotionEvents dispatched to this ViewGroup can be split to multiple children. */ public boolean isMotionEventSplittingEnabled() { |