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

Commit 1244815e authored by Andrei Stingaceanu's avatar Andrei Stingaceanu
Browse files

Remove @hide from ViewGroup debug methods

Allow developers to easily add their own debugging info
when developing custom ViewGroups.

Bug: 30117235
Test: tests still pass
Change-Id: Ia83005b4dc727c7b959a50e7b0130582f6e89762
parent 913d8e93
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -46387,6 +46387,8 @@ package android.view {
    method public void notifySubtreeAccessibilityStateChanged(android.view.View, android.view.View, int);
    method public final void offsetDescendantRectToMyCoords(android.view.View, android.graphics.Rect);
    method public final void offsetRectIntoDescendantCoords(android.view.View, android.graphics.Rect);
    method protected void onDebugDraw(android.graphics.Canvas);
    method protected void onDebugDrawMargins(android.graphics.Canvas, android.graphics.Paint);
    method public boolean onInterceptHoverEvent(android.view.MotionEvent);
    method public boolean onInterceptTouchEvent(android.view.MotionEvent);
    method protected abstract void onLayout(boolean, int, int, int, int);
@@ -46460,6 +46462,7 @@ package android.view {
    ctor public ViewGroup.LayoutParams(android.content.Context, android.util.AttributeSet);
    ctor public ViewGroup.LayoutParams(int, int);
    ctor public ViewGroup.LayoutParams(android.view.ViewGroup.LayoutParams);
    method public void onDebugDraw(android.view.View, android.graphics.Canvas, android.graphics.Paint);
    method public void resolveLayoutDirection(int);
    method protected void setBaseAttributes(android.content.res.TypedArray, int, int);
    field public static final deprecated int FILL_PARENT = -1; // 0xffffffff
+3 −0
Original line number Diff line number Diff line
@@ -50046,6 +50046,8 @@ package android.view {
    method public void notifySubtreeAccessibilityStateChanged(android.view.View, android.view.View, int);
    method public final void offsetDescendantRectToMyCoords(android.view.View, android.graphics.Rect);
    method public final void offsetRectIntoDescendantCoords(android.view.View, android.graphics.Rect);
    method protected void onDebugDraw(android.graphics.Canvas);
    method protected void onDebugDrawMargins(android.graphics.Canvas, android.graphics.Paint);
    method public boolean onInterceptHoverEvent(android.view.MotionEvent);
    method public boolean onInterceptTouchEvent(android.view.MotionEvent);
    method protected abstract void onLayout(boolean, int, int, int, int);
@@ -50119,6 +50121,7 @@ package android.view {
    ctor public ViewGroup.LayoutParams(android.content.Context, android.util.AttributeSet);
    ctor public ViewGroup.LayoutParams(int, int);
    ctor public ViewGroup.LayoutParams(android.view.ViewGroup.LayoutParams);
    method public void onDebugDraw(android.view.View, android.graphics.Canvas, android.graphics.Paint);
    method public void resolveLayoutDirection(int);
    method protected void setBaseAttributes(android.content.res.TypedArray, int, int);
    field public static final deprecated int FILL_PARENT = -1; // 0xffffffff
+3 −0
Original line number Diff line number Diff line
@@ -46809,6 +46809,8 @@ package android.view {
    method public void notifySubtreeAccessibilityStateChanged(android.view.View, android.view.View, int);
    method public final void offsetDescendantRectToMyCoords(android.view.View, android.graphics.Rect);
    method public final void offsetRectIntoDescendantCoords(android.view.View, android.graphics.Rect);
    method protected void onDebugDraw(android.graphics.Canvas);
    method protected void onDebugDrawMargins(android.graphics.Canvas, android.graphics.Paint);
    method public boolean onInterceptHoverEvent(android.view.MotionEvent);
    method public boolean onInterceptTouchEvent(android.view.MotionEvent);
    method protected abstract void onLayout(boolean, int, int, int, int);
@@ -46882,6 +46884,7 @@ package android.view {
    ctor public ViewGroup.LayoutParams(android.content.Context, android.util.AttributeSet);
    ctor public ViewGroup.LayoutParams(int, int);
    ctor public ViewGroup.LayoutParams(android.view.ViewGroup.LayoutParams);
    method public void onDebugDraw(android.view.View, android.graphics.Canvas, android.graphics.Paint);
    method public void resolveLayoutDirection(int);
    method protected void setBaseAttributes(android.content.res.TypedArray, int, int);
    field public static final deprecated int FILL_PARENT = -1; // 0xffffffff
+28 −7
Original line number Diff line number Diff line
@@ -3865,7 +3865,15 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
    }

    /**
     * @hide
     * Layout debugging code which draws rectangles around layout params.
     *
     * <p>This function is called automatically when the developer setting is enabled.<p/>
     *
     * <p>It is strongly advised to only call this function from debug builds as there is
     * a risk of leaking unwanted layout information.<p/>
     *
     * @param canvas the canvas on which to draw
     * @param paint the paint used to draw through
     */
    protected void onDebugDrawMargins(Canvas canvas, Paint paint) {
        for (int i = 0; i < getChildCount(); i++) {
@@ -3875,7 +3883,19 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
    }

    /**
     * @hide
     * Layout debugging code which draws rectangles around:
     * <ul>
     *     <li>optical bounds<li/>
     *     <li>margins<li/>
     *     <li>clip bounds<li/>
     * <ul/>
     *
     * <p>This function is called automatically when the developer setting is enabled.<p/>
     *
     * <p>It is strongly advised to only call this function from debug builds as there is
     * a risk of leaking unwanted layout information.<p/>
     *
     * @param canvas the canvas on which to draw
     */
    protected void onDebugDraw(Canvas canvas) {
        Paint paint = getDebugPaint();
@@ -7564,10 +7584,14 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
        /**
         * Use {@code canvas} to draw suitable debugging annotations for these LayoutParameters.
         *
         * <p>This function is called automatically when the developer setting is enabled.<p/>
         *
         * <p>It is strongly advised to only call this function from debug builds as there is
         * a risk of leaking unwanted layout information.<p/>
         *
         * @param view the view that contains these layout parameters
         * @param canvas the canvas on which to draw
         *
         * @hide
         * @param paint the paint used to draw through
         */
        public void onDebugDraw(View view, Canvas canvas, Paint paint) {
        }
@@ -8071,9 +8095,6 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
            return ((mMarginFlags & LAYOUT_DIRECTION_MASK) == View.LAYOUT_DIRECTION_RTL);
        }

        /**
         * @hide
         */
        @Override
        public void onDebugDraw(View view, Canvas canvas, Paint paint) {
            Insets oi = isLayoutModeOptical(view.mParent) ? view.getOpticalInsets() : Insets.NONE;
+0 −6
Original line number Diff line number Diff line
@@ -898,9 +898,6 @@ public class GridLayout extends ViewGroup {
        }
    }

    /**
     * @hide
     */
    @Override
    protected void onDebugDrawMargins(Canvas canvas, Paint paint) {
        // Apply defaults, so as to remove UNDEFINED values
@@ -916,9 +913,6 @@ public class GridLayout extends ViewGroup {
        }
    }

    /**
     * @hide
     */
    @Override
    protected void onDebugDraw(Canvas canvas) {
        Paint paint = new Paint();