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

Commit 42a13865 authored by Svetoslav's avatar Svetoslav Committed by Android (Google) Code Review
Browse files

Merge "Accessibilty: Cannot click on views in a scrollable container covered...

Merge "Accessibilty: Cannot click on views in a scrollable container covered by the toolbar." into lmp-mr1-dev
parents 56c119ab 41fceb46
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -829,8 +829,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
        // Clip the bounds by our bounds.
        bounds.left = Math.max(bounds.left, 0);
        bounds.top = Math.max(bounds.top, 0);
        bounds.right = Math.min(bounds.right, mRight);
        bounds.bottom = Math.min(bounds.bottom, mBottom);
        bounds.right = Math.min(bounds.right, getWidth());
        bounds.bottom = Math.min(bounds.bottom, getHeight());

        Iterator<View> iterator = obtainOrderedChildIterator();
        while (iterator.hasNext()) {
+13 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.annotation.Nullable;
import android.app.ActionBar;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.os.Parcel;
import android.os.Parcelable;
@@ -1096,6 +1097,18 @@ public class Toolbar extends ViewGroup {
        return true;
    }

    /**
     * @hide
     */
    @Override
    public void addClickableRectsForAccessibility(List<RectF> outRects) {
        // This class always consumes touch events, therefore if it
        // covers a view we do not want to send a click over it.
        RectF bounds = new RectF();
        bounds.set(0, 0, getWidth(), getHeight());
        outRects.add(bounds);
    }

    /**
     * @hide
     */
+15 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Outline;
import android.graphics.PixelFormat;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.ActionMode;
@@ -31,6 +32,8 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;

import java.util.List;

/**
 * This class acts as a container for the action bar view and action mode context views.
 * It applies special styles as needed to help handle animated transitions between them.
@@ -224,6 +227,18 @@ public class ActionBarContainer extends FrameLayout {
        return true;
    }

    /**
     * @hide
     */
    @Override
    public void addClickableRectsForAccessibility(List<RectF> outRects) {
        // This class always consumes touch events, therefore if it
        // covers a view we do not want to send a click over it.
        RectF bounds = new RectF();
        bounds.set(0, 0, getWidth(), getHeight());
        outRects.add(bounds);
    }

    @Override
    public boolean onHoverEvent(MotionEvent ev) {
        super.onHoverEvent(ev);