diff options
| author | Fabrice Di Meglio <fdimeglio@google.com> | 2011-05-27 17:41:36 -0700 |
|---|---|---|
| committer | Fabrice Di Meglio <fdimeglio@google.com> | 2011-05-27 17:52:37 -0700 |
| commit | c05aace48af1104dd917e8b5ad2dd76a02645ada (patch) | |
| tree | 523c08c3c911dc287e72e29c03d2ea57b52e5ccc /core/java/android/view/Gravity.java | |
| parent | 6e10b08ba9ac7ba4ee1884f9e5cccfd509d76165 (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.java | 6 |
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) { |
