diff options
Diffstat (limited to 'core/java/android')
-rw-r--r-- | core/java/android/view/Gravity.java | 28 | ||||
-rw-r--r-- | core/java/android/view/WindowManager.java | 4 | ||||
-rw-r--r-- | core/java/android/widget/FrameLayout.java | 4 | ||||
-rw-r--r-- | core/java/android/widget/LinearLayout.java | 16 | ||||
-rw-r--r-- | core/java/android/widget/RelativeLayout.java | 19 | ||||
-rw-r--r-- | core/java/android/widget/TextView.java | 4 |
6 files changed, 38 insertions, 37 deletions
diff --git a/core/java/android/view/Gravity.java b/core/java/android/view/Gravity.java index b2a35d3..ba06795 100644 --- a/core/java/android/view/Gravity.java +++ b/core/java/android/view/Gravity.java @@ -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; diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java index a1ddd08..b0181bb 100644 --- a/core/java/android/view/WindowManager.java +++ b/core/java/android/view/WindowManager.java @@ -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; diff --git a/core/java/android/widget/FrameLayout.java b/core/java/android/widget/FrameLayout.java index 4ee16e7..6b498fe 100644 --- a/core/java/android/widget/FrameLayout.java +++ b/core/java/android/widget/FrameLayout.java @@ -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) { diff --git a/core/java/android/widget/LinearLayout.java b/core/java/android/widget/LinearLayout.java index f843574..3876735 100644 --- a/core/java/android/widget/LinearLayout.java +++ b/core/java/android/widget/LinearLayout.java @@ -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"), diff --git a/core/java/android/widget/RelativeLayout.java b/core/java/android/widget/RelativeLayout.java index acd8539..5562bf7 100644 --- a/core/java/android/widget/RelativeLayout.java +++ b/core/java/android/widget/RelativeLayout.java @@ -16,6 +16,15 @@ package android.widget; +import com.android.internal.R; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.SortedSet; +import java.util.TreeSet; + import android.content.Context; import android.content.res.Resources; import android.content.res.TypedArray; @@ -32,14 +41,6 @@ import android.view.ViewDebug; import android.view.ViewGroup; import android.view.accessibility.AccessibilityEvent; import android.widget.RemoteViews.RemoteView; -import com.android.internal.R; - -import java.util.ArrayList; -import java.util.Comparator; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.SortedSet; -import java.util.TreeSet; import static android.util.Log.d; @@ -222,7 +223,7 @@ public class RelativeLayout 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) { diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 88ab442..f18ddd2 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -2094,7 +2094,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener */ public void setGravity(int gravity) { if ((gravity & Gravity.RELATIVE_HORIZONTAL_GRAVITY_MASK) == 0) { - gravity |= Gravity.BEFORE; + gravity |= Gravity.START; } if ((gravity & Gravity.VERTICAL_GRAVITY_MASK) == 0) { gravity |= Gravity.TOP; @@ -10010,7 +10010,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener private boolean mSelectAllOnFocus = false; - private int mGravity = Gravity.TOP | Gravity.BEFORE; + private int mGravity = Gravity.TOP | Gravity.START; private boolean mHorizontallyScrolling; private int mAutoLinkMask; |