summaryrefslogtreecommitdiffstats
path: root/core/java/android/view/Gravity.java
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2011-06-06 18:23:10 -0700
committerFabrice Di Meglio <fdimeglio@google.com>2011-06-07 14:21:31 -0700
commitc46f7ffa9079f3ae8a5204e7519ed7a1250116d0 (patch)
tree627572fff083f36ef56c8f3c1c10b9b5cafac264 /core/java/android/view/Gravity.java
parentfd65e00d629a58077eba18a9414a60f6bc3d0336 (diff)
downloadframeworks_base-c46f7ffa9079f3ae8a5204e7519ed7a1250116d0.zip
frameworks_base-c46f7ffa9079f3ae8a5204e7519ed7a1250116d0.tar.gz
frameworks_base-c46f7ffa9079f3ae8a5204e7519ed7a1250116d0.tar.bz2
Rename atribute View horizontalDirection to layoutDirection and update unit tests
- update before/after to start/end in unit test app Change-Id: Id7286ef5d9390540faf8ecd5f0b1c140d04bb364
Diffstat (limited to 'core/java/android/view/Gravity.java')
-rw-r--r--core/java/android/view/Gravity.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/core/java/android/view/Gravity.java b/core/java/android/view/Gravity.java
index ba06795..69e6489 100644
--- a/core/java/android/view/Gravity.java
+++ b/core/java/android/view/Gravity.java
@@ -81,8 +81,10 @@ public class Gravity
* horizontal axis. */
public static final int CLIP_HORIZONTAL = AXIS_CLIP<<AXIS_X_SHIFT;
- /** Raw bit controlling whether the horizontal direction is relative (before/after) or not. */
- public static final int RELATIVE_HORIZONTAL_DIRECTION = 0x00800000;
+ /** Raw bit controlling whether the layout direction is relative or not (START/END instead of
+ * absolute LEFT/RIGHT).
+ */
+ public static final int RELATIVE_LAYOUT_DIRECTION = 0x00800000;
/**
* Binary mask to get the absolute horizontal gravity of a gravity.
@@ -110,10 +112,10 @@ public class Gravity
public static final int DISPLAY_CLIP_HORIZONTAL = 0x01000000;
/** 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;
+ public static final int START = RELATIVE_LAYOUT_DIRECTION | LEFT;
/** 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;
+ public static final int END = RELATIVE_LAYOUT_DIRECTION | RIGHT;
/**
* Binary mask for the horizontal gravity and script specific direction bit.
@@ -352,7 +354,7 @@ public class Gravity
public static int getAbsoluteGravity(int gravity, boolean isRtl) {
int result = gravity;
// If layout is script specific and gravity is horizontal relative (START or END)
- if ((result & RELATIVE_HORIZONTAL_DIRECTION) > 0) {
+ if ((result & RELATIVE_LAYOUT_DIRECTION) > 0) {
if ((result & Gravity.START) == Gravity.START) {
// Remove the START bit
result &= ~START;
@@ -376,7 +378,7 @@ public class Gravity
}
// Don't need the script specific bit any more, so remove it as we are converting to
// absolute values (LEFT or RIGHT)
- result &= ~RELATIVE_HORIZONTAL_DIRECTION;
+ result &= ~RELATIVE_LAYOUT_DIRECTION;
}
return result;
}