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

Commit 6ee8379d authored by Andrey Kulikov's avatar Andrey Kulikov
Browse files

Made View.setLeftTopRightBottom() public

It will allow to call this method in AndroidX Transition without reflection.
ChangeBounds#BOTTOM_RIGHT_ONLY_PROPERTY,POSITION_PROPERTY are restricted now as well as developers can just use setLeftTopRightBottom method instead (it was used as a performance optimization in third-party transitions backport)

Bug: 117521189
Bug: 117521197
Bug: 117521053
Test: new test added for the method
Change-Id: I0a29bc8cf0b3357e49f6be14270993a21a6dfeee
parent ec7eeb59
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -49280,6 +49280,7 @@ package android.view {
    method public void setLayoutDirection(int);
    method public void setLayoutParams(android.view.ViewGroup.LayoutParams);
    method public final void setLeft(int);
    method public void setLeftTopRightBottom(int, int, int, int);
    method public void setLongClickable(boolean);
    method protected final void setMeasuredDimension(int, int);
    method public void setMinimumHeight(int);
+3 −2
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import android.graphics.PointF;
import android.graphics.Rect;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.AttributeSet;
import android.util.Property;
import android.view.View;
@@ -109,7 +110,7 @@ public class ChangeBounds extends Transition {
                }
            };

    @UnsupportedAppUsage
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
    private static final Property<View, PointF> BOTTOM_RIGHT_ONLY_PROPERTY =
            new Property<View, PointF>(PointF.class, "bottomRight") {
                @Override
@@ -144,7 +145,7 @@ public class ChangeBounds extends Transition {
                }
            };

    @UnsupportedAppUsage
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
    private static final Property<View, PointF> POSITION_PROPERTY =
            new Property<View, PointF>(PointF.class, "position") {
                @Override
+11 −3
Original line number Diff line number Diff line
@@ -21525,10 +21525,18 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    }
    /**
     * Same as setFrame, but public and hidden. For use in {@link android.transition.ChangeBounds}.
     * @hide
     * Assign a size and position to this view.
     *
     * This method is meant to be used in animations only as it applies this position and size
     * for the view only temporary and it can be changed back at any time by the layout.
     *
     * @param left Left position, relative to parent
     * @param top Top position, relative to parent
     * @param right Right position, relative to parent
     * @param bottom Bottom position, relative to parent
     *
     * @see #setLeft(int), #setRight(int), #setTop(int), #setBottom(int)
     */
    @UnsupportedAppUsage
    public void setLeftTopRightBottom(int left, int top, int right, int bottom) {
        setFrame(left, top, right, bottom);
    }