summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/widget/FrameLayout.java10
-rw-r--r--core/java/android/widget/LinearLayout.java4
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;