diff options
| author | Fabrice Di Meglio <fdimeglio@google.com> | 2011-06-01 17:40:11 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-06-01 17:40:11 -0700 |
| commit | 77c1cc0aa4d088f54c3b36a05a19acfa5295c4da (patch) | |
| tree | 71e7d8d67b4b8b9bef3360962cf723de831d531e /core/java/android | |
| parent | df357caf3128fdfb17b0a4b34b6d441144ed03cc (diff) | |
| parent | de35ceeeb9f8855c72dfd70593e917aa75b43770 (diff) | |
| download | frameworks_base-77c1cc0aa4d088f54c3b36a05a19acfa5295c4da.zip frameworks_base-77c1cc0aa4d088f54c3b36a05a19acfa5295c4da.tar.gz frameworks_base-77c1cc0aa4d088f54c3b36a05a19acfa5295c4da.tar.bz2 | |
Merge "Fix bug #4509967 (layout_gravity not always respected)"
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/widget/FrameLayout.java | 10 | ||||
| -rw-r--r-- | core/java/android/widget/LinearLayout.java | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/core/java/android/widget/FrameLayout.java b/core/java/android/widget/FrameLayout.java index 2a1398d..4ee16e7 100644 --- a/core/java/android/widget/FrameLayout.java +++ b/core/java/android/widget/FrameLayout.java @@ -16,6 +16,8 @@ package android.widget; +import java.util.ArrayList; + import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; @@ -23,14 +25,12 @@ import android.graphics.Rect; import android.graphics.Region; import android.graphics.drawable.Drawable; import android.util.AttributeSet; +import android.view.Gravity; import android.view.View; import android.view.ViewDebug; import android.view.ViewGroup; -import android.view.Gravity; import android.widget.RemoteViews.RemoteView; -import java.util.ArrayList; - /** * FrameLayout is designed to block out an area on the screen to display @@ -364,10 +364,10 @@ public class FrameLayout extends ViewGroup { gravity = DEFAULT_CHILD_GRAVITY; } - final int horizontalGravity = Gravity.getAbsoluteGravity(gravity, isLayoutRtl()); + final int absoluteGravity = Gravity.getAbsoluteGravity(gravity, isLayoutRtl()); final int verticalGravity = gravity & Gravity.VERTICAL_GRAVITY_MASK; - switch (horizontalGravity) { + switch (absoluteGravity & Gravity.HORIZONTAL_GRAVITY_MASK) { case Gravity.LEFT: childLeft = parentLeft + lp.leftMargin; break; diff --git a/core/java/android/widget/LinearLayout.java b/core/java/android/widget/LinearLayout.java index 8d449e0..298fe00 100644 --- a/core/java/android/widget/LinearLayout.java +++ b/core/java/android/widget/LinearLayout.java @@ -1430,8 +1430,8 @@ public class LinearLayout extends ViewGroup { if (gravity < 0) { gravity = minorGravity; } - gravity = Gravity.getAbsoluteGravity(gravity, isLayoutRtl()); - switch (gravity & Gravity.HORIZONTAL_GRAVITY_MASK) { + final int absoluteGravity = Gravity.getAbsoluteGravity(gravity, isLayoutRtl()); + switch (absoluteGravity & Gravity.HORIZONTAL_GRAVITY_MASK) { case Gravity.CENTER_HORIZONTAL: childLeft = paddingLeft + ((childSpace - childWidth) / 2) + lp.leftMargin - lp.rightMargin; |
