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

Commit 879fb6b5 authored by Adam Powell's avatar Adam Powell
Browse files

Text selection anchors changed to use windows

Manually cherry-picked

Change-Id: Id080dfad0e2f324fef3a5175abc78f76c8bad4c8
parent dab59d15
Loading
Loading
Loading
Loading
+11 −139
Original line number Diff line number Diff line
@@ -6268,17 +6268,6 @@
 visibility="public"
>
</field>
<field name="kraken_resource_pad57"
 type="int"
 transient="false"
 volatile="false"
 value="16843464"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="kraken_resource_pad6"
 type="int"
 transient="false"
@@ -10129,6 +10118,17 @@
 visibility="public"
>
</field>
<field name="textSelectHandleWindowStyle"
 type="int"
 transient="false"
 volatile="false"
 value="16843464"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="textSize"
 type="int"
 transient="false"
@@ -178473,19 +178473,6 @@
<parameter name="event" type="android.view.MotionEvent">
</parameter>
</method>
<method name="setCursorController"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="cursorController" type="android.widget.TextView.CursorController">
</parameter>
</method>
</class>
<class name="BaseKeyListener"
 extends="android.text.method.MetaKeyKeyListener"
@@ -239255,121 +239242,6 @@
>
</method>
</class>
<interface name="TextView.CursorController"
 abstract="true"
 static="true"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<method name="draw"
 return="void"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="canvas" type="android.graphics.Canvas">
</parameter>
</method>
<method name="getOffsetX"
 return="float"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="getOffsetY"
 return="float"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="hide"
 return="void"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="isShowing"
 return="boolean"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="onTouchEvent"
 return="boolean"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="event" type="android.view.MotionEvent">
</parameter>
</method>
<method name="show"
 return="void"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="updatePosition"
 return="void"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="x" type="int">
</parameter>
<parameter name="y" type="int">
</parameter>
</method>
<field name="FADE_OUT_DURATION"
 type="int"
 transient="false"
 volatile="false"
 value="400"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
</interface>
<interface name="TextView.OnEditorActionListener"
 abstract="true"
 static="true"
+2 −0
Original line number Diff line number Diff line
@@ -314,6 +314,8 @@ public class ArrowKeyMovementMethod implements MovementMethod {
     * {@link MotionEvent#ACTION_CANCEL} event), the controller is reset to null.
     *
     * @param cursorController A cursor controller implementation
     *
     * @hide
     */
    public void setCursorController(CursorController cursorController) {
        mCursorController = cursorController;
+0 −57
Original line number Diff line number Diff line
@@ -1612,12 +1612,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
     */
    private static final int AWAKEN_SCROLL_BARS_ON_ATTACH = 0x08000000;

    /**
     * Indicates that this view has a visible/touchable overlay.
     * @hide
     */
    static final int HAS_OVERLAY = 0x10000000;

    /**
     * Indicates that pivotX or pivotY were explicitly set and we should not assume the center
     * for transform operations
@@ -3040,57 +3034,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
        resetPressedState();
    }

    /**
     * Enable or disable drawing overlays after a full drawing pass. This enables a view to
     * draw on a topmost overlay layer after normal drawing completes and get right of first
     * refusal for touch events in the window.
     * 
     * <em>Warning:</em> Views that use this feature should take care to disable/enable overlay
     * appropriately when they are attached/detached from their window. All overlays should be
     * disabled when detached.
     * 
     * @param enabled true if overlay drawing should be enabled for this view, false otherwise
     * 
     * @see #onDrawOverlay(Canvas)
     * 
     * @hide
     */
    protected void setOverlayEnabled(boolean enabled) {
        final boolean oldValue = (mPrivateFlags & HAS_OVERLAY) == HAS_OVERLAY;
        mPrivateFlags = (mPrivateFlags & ~HAS_OVERLAY) | (enabled ? HAS_OVERLAY : 0);
        if (enabled != oldValue) {
            final ViewParent parent = getParent();
            if (parent != null) {
                try {
                    parent.childOverlayStateChanged(this);
                } catch (AbstractMethodError e) {
                    Log.e(VIEW_LOG_TAG, "Could not propagate hasOverlay state", e);
                }
            }
        }
    }

    /**
     * @return true if this View has an overlay enabled.
     * 
     * @see #setOverlayEnabled(boolean)
     * @see #onDrawOverlay(Canvas)
     * 
     * @hide
     */
    public boolean isOverlayEnabled() {
        return (mPrivateFlags & HAS_OVERLAY) == HAS_OVERLAY;
    }

    /**
     * Override this method to draw on an overlay layer above all other views in the window
     * after the standard drawing pass is complete. This allows a view to draw outside its
     * normal boundaries.
     * @hide
     */
    public void onDrawOverlay(Canvas canvas) {
    }

    private void resetPressedState() {
        if ((mViewFlags & ENABLED_MASK) == DISABLED) {
            return;
+1 −99
Original line number Diff line number Diff line
@@ -244,11 +244,6 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
     */
    protected static final int FLAG_DISALLOW_INTERCEPT = 0x80000;

    /**
     * When set, at least one child of this ViewGroup will return true from hasOverlay.
     */
    private static final int FLAG_CHILD_HAS_OVERLAY = 0x100000;

    /**
     * When set, this ViewGroup will split MotionEvents to multiple child Views when appropriate.
     */
@@ -910,33 +905,6 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
                final View[] children = mChildren;
                final int count = mChildrenCount;

                // Check for children with overlays first. They don't rely on hit rects to determine
                // if they can accept a new touch event.
                if ((mGroupFlags & FLAG_CHILD_HAS_OVERLAY) == FLAG_CHILD_HAS_OVERLAY) {
                    for (int i = count - 1; i >= 0; i--) {
                        final View child = children[i];
                        // Don't let children respond to events as an overlay during an animation.
                        if ((child.mViewFlags & VISIBILITY_MASK) == VISIBLE
                                && child.getAnimation() == null
                                && child.isOverlayEnabled()) {
                            // offset the event to the view's coordinate system
                            final float xc = scrolledXFloat - child.mLeft;
                            final float yc = scrolledYFloat - child.mTop;
                            ev.setLocation(xc, yc);
                            child.mPrivateFlags &= ~CANCEL_NEXT_UP_EVENT;
                            if (child.dispatchTouchEvent(ev))  {
                                // Event handled, we have a target now.
                                mMotionTarget = child;
                                return true;
                            }
                            // The event didn't get handled, try the next view.
                            // Don't reset the event's location, it's not
                            // necessary here.
                        }
                    }
                }

                // Now check views normally.
                for (int i = count - 1; i >= 0; i--) {
                    final View child = children[i];
                    if ((child.mViewFlags & VISIBILITY_MASK) == VISIBLE
@@ -2774,8 +2742,6 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
        if (clearChildFocus != null) {
            clearChildFocus(clearChildFocus);
        }

        mGroupFlags &= ~FLAG_CHILD_HAS_OVERLAY;
    }

    /**
@@ -3024,8 +2990,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
                final int left = mLeft;
                final int top = mTop;

                if ((mGroupFlags & FLAG_CHILD_HAS_OVERLAY) == FLAG_CHILD_HAS_OVERLAY ||
                        dirty.intersect(0, 0, mRight - left, mBottom - top) ||
                if (dirty.intersect(0, 0, mRight - left, mBottom - top) ||
                        (mPrivateFlags & DRAW_ANIMATION) == DRAW_ANIMATION) {
                    mPrivateFlags &= ~DRAWING_CACHE_VALID;

@@ -4012,69 +3977,6 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
        mAnimationListener = animationListener;
    }

    /**
     * Called when a child's overlay state changes between enabled/disabled.
     * @param child Child view whose state has changed or null
     * @hide
     */
    public void childOverlayStateChanged(View child) {
        boolean childHasOverlay = false;
        if (child != null) {
            childHasOverlay = child.isOverlayEnabled();
        } else {
            final int childCount = getChildCount();
            for (int i = 0; i < childCount; i++) {
                if (childHasOverlay |= getChildAt(i).isOverlayEnabled()) {
                    break;
                }
            }
        }
        
        final boolean hasChildWithOverlay = childHasOverlay ||
                (mGroupFlags & FLAG_CHILD_HAS_OVERLAY) == FLAG_CHILD_HAS_OVERLAY;

        final boolean oldValue = isOverlayEnabled();
        mGroupFlags = (mGroupFlags & ~FLAG_CHILD_HAS_OVERLAY) |
                (hasChildWithOverlay ? FLAG_CHILD_HAS_OVERLAY : 0);
        if (isOverlayEnabled() != oldValue) {
            final ViewParent parent = getParent();
            if (parent != null) {
                try {
                    parent.childOverlayStateChanged(this);
                } catch (AbstractMethodError e) {
                    Log.e("ViewGroup", "Could not propagate hasOverlay state", e);
                }
            }
        }
    }

    /**
     * @hide
     */
    public boolean isOverlayEnabled() {
        return super.isOverlayEnabled() ||
                ((mGroupFlags & FLAG_CHILD_HAS_OVERLAY) == FLAG_CHILD_HAS_OVERLAY);
    }

    /**
     * @hide
     */
    @Override
    public void onDrawOverlay(Canvas canvas) {
        if ((mGroupFlags & FLAG_CHILD_HAS_OVERLAY) == FLAG_CHILD_HAS_OVERLAY) {
            final int childCount = getChildCount();
            for (int i = 0; i < childCount; i++) {
                final View child = getChildAt(i);
                if (child.isOverlayEnabled()) {
                    canvas.translate(child.mLeft - child.mScrollX, child.mTop - child.mScrollY);
                    child.onDrawOverlay(canvas);
                    canvas.translate(-(child.mLeft - child.mScrollX),
                            -(child.mTop - child.mScrollY));
                }
            }
        }
    }

    /**
     * LayoutParams are used by views to tell their parents how they want to be
     * laid out. See
+0 −7
Original line number Diff line number Diff line
@@ -222,11 +222,4 @@ public interface ViewParent {
     */
    public boolean requestChildRectangleOnScreen(View child, Rect rectangle,
            boolean immediate);

    /**
     * Called when a child view's overlay state changes between enabled/disabled.
     * @param child Child view whose state changed or null.
     * @hide
     */
    public void childOverlayStateChanged(View child);
}
Loading