diff options
author | Fabrice Di Meglio <fdimeglio@google.com> | 2011-06-13 12:16:51 -0700 |
---|---|---|
committer | Fabrice Di Meglio <fdimeglio@google.com> | 2011-06-14 16:16:39 -0700 |
commit | c0053223bedf33581b0830fb87be32c1f26e5372 (patch) | |
tree | 2ad4905ec68202ba4331f49c0efdb30d966cceeb /core/java/android/widget/FrameLayout.java | |
parent | f0b517d9d287e86e6e57a372ddcb070cec1fe1c0 (diff) | |
download | frameworks_base-c0053223bedf33581b0830fb87be32c1f26e5372.zip frameworks_base-c0053223bedf33581b0830fb87be32c1f26e5372.tar.gz frameworks_base-c0053223bedf33581b0830fb87be32c1f26e5372.tar.bz2 |
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
Diffstat (limited to 'core/java/android/widget/FrameLayout.java')
-rw-r--r-- | core/java/android/widget/FrameLayout.java | 7 |
1 files changed, 5 insertions, 2 deletions
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); } |