Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 995e7743 authored by Jeff Brown's avatar Jeff Brown
Browse files

Enable touch splitting by default for Honeycomb apps.

Also fixed some bad comments I noticed along the way.

Change-Id: I4328c8aaa22f48a5c1fd274e889abb7823747330
parent 93e7d00f
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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.
     *
+8 −1
Original line number Diff line number Diff line
@@ -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() {