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

Commit a6471e88 authored by Romain Guy's avatar Romain Guy Committed by Android (Google) Code Review
Browse files

Merge "Make sure textviews draw in layers"

parents f406e230 21f42302
Loading
Loading
Loading
Loading
+14 −3
Original line number Diff line number Diff line
@@ -6976,6 +6976,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * @hide
     */
    public boolean includeForAccessibility() {
        //noinspection SimplifiableIfStatement
        if (mAttachInfo != null) {
            return (mAttachInfo.mAccessibilityFetchFlags
                    & AccessibilityNodeInfo.FLAG_INCLUDE_NOT_IMPORTANT_VIEWS) != 0
@@ -7564,8 +7565,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * @return True if the event was handled by the view, false otherwise.
     */
    protected boolean dispatchHoverEvent(MotionEvent event) {
        //noinspection SimplifiableIfStatement
        ListenerInfo li = mListenerInfo;
        //noinspection SimplifiableIfStatement
        if (li != null && li.mOnHoverListener != null
                && (mViewFlags & ENABLED_MASK) == ENABLED
                && li.mOnHoverListener.onHover(this, event)) {
@@ -12625,8 +12626,16 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                        attachInfo.mHardwareRenderer.isEnabled() &&
                        attachInfo.mHardwareRenderer.validate()) {
                    getHardwareLayer();
                    // TODO: We need a better way to handle this case
                    // If views have registered pre-draw listeners they need
                    // to be notified before we build the layer. Those listeners
                    // may however rely on other events to happen first so we
                    // cannot just invoke them here until they don't cancel the
                    // current frame
                    if (!attachInfo.mTreeObserver.hasOnPreDrawListeners()) {
                        attachInfo.mViewRootImpl.dispatchFlushHardwareLayerUpdates();
                    }
                }
                break;
            case LAYER_TYPE_SOFTWARE:
                buildDrawingCache(true);
@@ -15251,6 +15260,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * @param selected true if the view must be selected, false otherwise
     */
    public void setSelected(boolean selected) {
        //noinspection DoubleNegation
        if (((mPrivateFlags & PFLAG_SELECTED) != 0) != selected) {
            mPrivateFlags = (mPrivateFlags & ~PFLAG_SELECTED) | (selected ? PFLAG_SELECTED : 0);
            if (!selected) resetPressedState();
@@ -15295,6 +15305,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * @param activated true if the view must be activated, false otherwise
     */
    public void setActivated(boolean activated) {
        //noinspection DoubleNegation
        if (((mPrivateFlags & PFLAG_ACTIVATED) != 0) != activated) {
            mPrivateFlags = (mPrivateFlags & ~PFLAG_ACTIVATED) | (activated ? PFLAG_ACTIVATED : 0);
            invalidate(true);
@@ -16804,8 +16815,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * </p>
     */
    public boolean dispatchDragEvent(DragEvent event) {
        //noinspection SimplifiableIfStatement
        ListenerInfo li = mListenerInfo;
        //noinspection SimplifiableIfStatement
        if (li != null && li.mOnDragListener != null && (mViewFlags & ENABLED_MASK) == ENABLED
                && li.mOnDragListener.onDrag(this, event)) {
            return true;
+10 −3
Original line number Diff line number Diff line
@@ -243,9 +243,9 @@ public final class ViewTreeObserver {

        @Override
        public int hashCode() {
            int result = contentInsets != null ? contentInsets.hashCode() : 0;
            result = 31 * result + (visibleInsets != null ? visibleInsets.hashCode() : 0);
            result = 31 * result + (touchableRegion != null ? touchableRegion.hashCode() : 0);
            int result = contentInsets.hashCode();
            result = 31 * result + visibleInsets.hashCode();
            result = 31 * result + touchableRegion.hashCode();
            result = 31 * result + mTouchableInsets;
            return result;
        }
@@ -813,6 +813,13 @@ public final class ViewTreeObserver {
        }
    }

    /**
     * Returns whether there are listeners for on pre-draw events.
     */
    final boolean hasOnPreDrawListeners() {
        return mOnPreDrawListeners != null && mOnPreDrawListeners.size() > 0;
    }

    /**
     * Notifies registered listeners that the drawing pass is about to start. If a
     * listener returns true, then the drawing pass is canceled and rescheduled. This can