From c0053223bedf33581b0830fb87be32c1f26e5372 Mon Sep 17 00:00:00 2001 From: Fabrice Di Meglio Date: Mon, 13 Jun 2011 12:16:51 -0700 Subject: Add View.getResolvedLayoutDirection() - update Callback2 interface - update Gravity.getAbsoluteGravity() and Gravity.apply() to be more generic by changing "boolean isRtl" parameter to "int layoutDirection" - fix BiDiTests for RTL FrameLayout Change-Id: I97bb456c22d5fd3ecb34f08564ce4dbed37e7459 --- core/java/android/widget/FrameLayout.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'core/java/android/widget/FrameLayout.java') diff --git a/core/java/android/widget/FrameLayout.java b/core/java/android/widget/FrameLayout.java index 6b498fe..5eba1a0 100644 --- a/core/java/android/widget/FrameLayout.java +++ b/core/java/android/widget/FrameLayout.java @@ -364,7 +364,8 @@ public class FrameLayout extends ViewGroup { gravity = DEFAULT_CHILD_GRAVITY; } - final int absoluteGravity = Gravity.getAbsoluteGravity(gravity, isLayoutRtl()); + final int layoutDirection = getResolvedLayoutDirection(); + final int absoluteGravity = Gravity.getAbsoluteGravity(gravity, layoutDirection); final int verticalGravity = gravity & Gravity.VERTICAL_GRAVITY_MASK; switch (absoluteGravity & Gravity.HORIZONTAL_GRAVITY_MASK) { @@ -435,8 +436,10 @@ public class FrameLayout extends ViewGroup { selfBounds.set(mPaddingLeft, mPaddingTop, w - mPaddingRight, h - mPaddingBottom); } + final int layoutDirection = getResolvedLayoutDirection(); Gravity.apply(mForegroundGravity, foreground.getIntrinsicWidth(), - foreground.getIntrinsicHeight(), selfBounds, overlayBounds, isLayoutRtl()); + foreground.getIntrinsicHeight(), selfBounds, overlayBounds, + layoutDirection); foreground.setBounds(overlayBounds); } -- cgit v1.1