summaryrefslogtreecommitdiff
path: root/core/java/android/view/Gravity.java
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2011-05-27 17:41:36 -0700
committerFabrice Di Meglio <fdimeglio@google.com>2011-05-27 17:52:37 -0700
commitc05aace48af1104dd917e8b5ad2dd76a02645ada (patch)
tree523c08c3c911dc287e72e29c03d2ea57b52e5ccc /core/java/android/view/Gravity.java
parent6e10b08ba9ac7ba4ee1884f9e5cccfd509d76165 (diff)
Fix default for getAbsoluteGravity()
- remove LEFT as default, keep it as it is given (because apply() is doing CENTER_HORIZONTAL) - update unit tests Change-Id: I294621c5d5c7d675a715c15cb10947d026539b21
Diffstat (limited to 'core/java/android/view/Gravity.java')
-rw-r--r--core/java/android/view/Gravity.java6
1 files changed, 0 insertions, 6 deletions
diff --git a/core/java/android/view/Gravity.java b/core/java/android/view/Gravity.java
index 176c4877bbf1..b2a35d346e9f 100644
--- a/core/java/android/view/Gravity.java
+++ b/core/java/android/view/Gravity.java
@@ -345,18 +345,12 @@ public class Gravity
* 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 no horizontal direction is found, then just add LEFT to the existing gravity
- *
* @param gravity The gravity to convert to absolute (horizontal) values.
* @param isRtl Whether the layout is right-to-left.
* @return gravity converted to absolute (horizontal) values.
*/
public static int getAbsoluteGravity(int gravity, boolean isRtl) {
int result = gravity;
- // Set default gravity, if no horizontal gravity is specified
- if ((result & HORIZONTAL_GRAVITY_MASK) == 0) {
- result |= Gravity.LEFT;
- }
// If layout is script specific and gravity is horizontal relative (BEFORE or AFTER)
if ((result & RELATIVE_HORIZONTAL_DIRECTION) > 0) {
if ((result & Gravity.BEFORE) == Gravity.BEFORE) {