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

Commit a556abfb authored by Fabrice Di Meglio's avatar Fabrice Di Meglio Committed by Android (Google) Code Review
Browse files

Merge "Rename Gravity BEFORE/AFTER to START/END"

parents 42975391 9e3b002d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -20436,14 +20436,12 @@ package android.view {
    method public static int getAbsoluteGravity(int, boolean);
    method public static boolean isHorizontal(int);
    method public static boolean isVertical(int);
    field public static final int AFTER = 8388613; // 0x800005
    field public static final int AXIS_CLIP = 8; // 0x8
    field public static final int AXIS_PULL_AFTER = 4; // 0x4
    field public static final int AXIS_PULL_BEFORE = 2; // 0x2
    field public static final int AXIS_SPECIFIED = 1; // 0x1
    field public static final int AXIS_X_SHIFT = 0; // 0x0
    field public static final int AXIS_Y_SHIFT = 4; // 0x4
    field public static final int BEFORE = 8388611; // 0x800003
    field public static final int BOTTOM = 80; // 0x50
    field public static final int CENTER = 17; // 0x11
    field public static final int CENTER_HORIZONTAL = 1; // 0x1
@@ -20452,6 +20450,7 @@ package android.view {
    field public static final int CLIP_VERTICAL = 128; // 0x80
    field public static final int DISPLAY_CLIP_HORIZONTAL = 16777216; // 0x1000000
    field public static final int DISPLAY_CLIP_VERTICAL = 268435456; // 0x10000000
    field public static final int END = 8388613; // 0x800005
    field public static final int FILL = 119; // 0x77
    field public static final int FILL_HORIZONTAL = 7; // 0x7
    field public static final int FILL_VERTICAL = 112; // 0x70
@@ -20461,6 +20460,7 @@ package android.view {
    field public static final int RELATIVE_HORIZONTAL_DIRECTION = 8388608; // 0x800000
    field public static final int RELATIVE_HORIZONTAL_GRAVITY_MASK = 8388615; // 0x800007
    field public static final int RIGHT = 5; // 0x5
    field public static final int START = 8388611; // 0x800003
    field public static final int TOP = 48; // 0x30
    field public static final int VERTICAL_GRAVITY_MASK = 112; // 0x70
  }
+14 −14
Original line number Diff line number Diff line
@@ -109,16 +109,16 @@ public class Gravity
     */
    public static final int DISPLAY_CLIP_HORIZONTAL = 0x01000000;
    
    /** Push object to x-axis position before its container, not changing its size. */
    public static final int BEFORE = RELATIVE_HORIZONTAL_DIRECTION | LEFT;
    /** Push object to x-axis position at the start of its container, not changing its size. */
    public static final int START = RELATIVE_HORIZONTAL_DIRECTION | LEFT;

    /** Push object to x-axis position after its container, not changing its size. */
    public static final int AFTER = RELATIVE_HORIZONTAL_DIRECTION | RIGHT;
    /** Push object to x-axis position at the end of its container, not changing its size. */
    public static final int END = RELATIVE_HORIZONTAL_DIRECTION | RIGHT;

    /**
     * Binary mask for the horizontal gravity and script specific direction bit.
     */
    public static final int RELATIVE_HORIZONTAL_GRAVITY_MASK = BEFORE | AFTER;
    public static final int RELATIVE_HORIZONTAL_GRAVITY_MASK = START | END;

    /**
     * Apply a gravity constant to an object. This suppose that the layout direction is LTR.
@@ -342,8 +342,8 @@ public class Gravity
    /**
     * <p>Convert script specific gravity to absolute horizontal value.</p>
     *
     * if horizontal direction is LTR, then BEFORE will set LEFT and AFTER will set RIGHT.
     * if horizontal direction is RTL, then BEFORE will set RIGHT and AFTER will set LEFT.
     * if horizontal direction is LTR, then START will set LEFT and END will set RIGHT.
     * if horizontal direction is RTL, then START will set RIGHT and END will set LEFT.
     *
     * @param gravity The gravity to convert to absolute (horizontal) values.
     * @param isRtl Whether the layout is right-to-left.
@@ -351,11 +351,11 @@ public class Gravity
     */
    public static int getAbsoluteGravity(int gravity, boolean isRtl) {
        int result = gravity;
        // If layout is script specific and gravity is horizontal relative (BEFORE or AFTER)
        // If layout is script specific and gravity is horizontal relative (START or END)
        if ((result & RELATIVE_HORIZONTAL_DIRECTION) > 0) {
            if ((result & Gravity.BEFORE) == Gravity.BEFORE) {
                // Remove the BEFORE bit
                result &= ~BEFORE;
            if ((result & Gravity.START) == Gravity.START) {
                // Remove the START bit
                result &= ~START;
                if (isRtl) {
                    // Set the RIGHT bit
                    result |= RIGHT;
@@ -363,9 +363,9 @@ public class Gravity
                    // Set the LEFT bit
                    result |= LEFT;
                }
            } else if ((result & Gravity.AFTER) == Gravity.AFTER) {
                // Remove the AFTER bit
                result &= ~AFTER;
            } else if ((result & Gravity.END) == Gravity.END) {
                // Remove the END bit
                result &= ~END;
                if (isRtl) {
                    // Set the LEFT bit
                    result |= LEFT;
+2 −2
Original line number Diff line number Diff line
@@ -77,8 +77,8 @@ public interface WindowManager extends ViewManager {
            implements Parcelable {
        /**
         * X position for this window.  With the default gravity it is ignored.
         * When using {@link Gravity#LEFT} or {@link Gravity#BEFORE} or {@link Gravity#RIGHT} or
         * {@link Gravity#AFTER} it provides an offset from the given edge.
         * When using {@link Gravity#LEFT} or {@link Gravity#START} or {@link Gravity#RIGHT} or
         * {@link Gravity#END} it provides an offset from the given edge.
         */
        @ViewDebug.ExportedProperty
        public int x;
+2 −2
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ public class FrameLayout extends ViewGroup {
    }

    /**
     * Describes how the foreground is positioned. Defaults to BEFORE and TOP.
     * Describes how the foreground is positioned. Defaults to START and TOP.
     *
     * @param foregroundGravity See {@link android.view.Gravity}
     *
@@ -125,7 +125,7 @@ public class FrameLayout extends ViewGroup {
    public void setForegroundGravity(int foregroundGravity) {
        if (mForegroundGravity != foregroundGravity) {
            if ((foregroundGravity & Gravity.RELATIVE_HORIZONTAL_GRAVITY_MASK) == 0) {
                foregroundGravity |= Gravity.BEFORE;
                foregroundGravity |= Gravity.START;
            }

            if ((foregroundGravity & Gravity.VERTICAL_GRAVITY_MASK) == 0) {
+8 −8
Original line number Diff line number Diff line
@@ -116,10 +116,10 @@ public class LinearLayout extends ViewGroup {
                equals = Gravity.LEFT, name = "LEFT"),
            @ViewDebug.FlagToString(mask = Gravity.RIGHT,
                equals = Gravity.RIGHT, name = "RIGHT"),
            @ViewDebug.FlagToString(mask = Gravity.BEFORE,
                equals = Gravity.BEFORE, name = "BEFORE"),
            @ViewDebug.FlagToString(mask = Gravity.AFTER,
                equals = Gravity.AFTER, name = "AFTER"),
            @ViewDebug.FlagToString(mask = Gravity.START,
                equals = Gravity.START, name = "START"),
            @ViewDebug.FlagToString(mask = Gravity.END,
                equals = Gravity.END, name = "END"),
            @ViewDebug.FlagToString(mask = Gravity.CENTER_VERTICAL,
                equals = Gravity.CENTER_VERTICAL, name = "CENTER_VERTICAL"),
            @ViewDebug.FlagToString(mask = Gravity.FILL_VERTICAL,
@@ -135,7 +135,7 @@ public class LinearLayout extends ViewGroup {
            @ViewDebug.FlagToString(mask = Gravity.RELATIVE_HORIZONTAL_DIRECTION,
                equals = Gravity.RELATIVE_HORIZONTAL_DIRECTION, name = "RELATIVE")
        })
    private int mGravity = Gravity.BEFORE | Gravity.TOP;
    private int mGravity = Gravity.START | Gravity.TOP;

    @ViewDebug.ExportedProperty(category = "measurement")
    private int mTotalLength;
@@ -1649,7 +1649,7 @@ public class LinearLayout extends ViewGroup {
    public void setGravity(int gravity) {
        if (mGravity != gravity) {
            if ((gravity & Gravity.RELATIVE_HORIZONTAL_GRAVITY_MASK) == 0) {
                gravity |= Gravity.BEFORE;
                gravity |= Gravity.START;
            }

            if ((gravity & Gravity.VERTICAL_GRAVITY_MASK) == 0) {
@@ -1742,8 +1742,8 @@ public class LinearLayout extends ViewGroup {
            @ViewDebug.IntToString(from = Gravity.BOTTOM,            to = "BOTTOM"),
            @ViewDebug.IntToString(from = Gravity.LEFT,              to = "LEFT"),
            @ViewDebug.IntToString(from = Gravity.RIGHT,             to = "RIGHT"),
            @ViewDebug.IntToString(from = Gravity.BEFORE,            to = "BEFORE"),
            @ViewDebug.IntToString(from = Gravity.AFTER,             to = "AFTER"),
            @ViewDebug.IntToString(from = Gravity.START,            to = "START"),
            @ViewDebug.IntToString(from = Gravity.END,             to = "END"),
            @ViewDebug.IntToString(from = Gravity.CENTER_VERTICAL,   to = "CENTER_VERTICAL"),
            @ViewDebug.IntToString(from = Gravity.FILL_VERTICAL,     to = "FILL_VERTICAL"),
            @ViewDebug.IntToString(from = Gravity.CENTER_HORIZONTAL, to = "CENTER_HORIZONTAL"),
Loading