diff options
| author | Fabrice Di Meglio <fdimeglio@google.com> | 2011-05-23 14:43:23 -0700 |
|---|---|---|
| committer | Fabrice Di Meglio <fdimeglio@google.com> | 2011-05-27 11:23:15 -0700 |
| commit | 6a03640539405afbdefe72894759281b98aa6e6f (patch) | |
| tree | b3326ddd1c7ab343f55de949f6d4a34fa2accc4e /core/java/android/widget/FrameLayout.java | |
| parent | 4c74c03fd19cfd151eafabb8da653d943af96abb (diff) | |
Add support for Gravity BEFORE and AFTER
- update layouts
- add Callback2 for RTL aware Drawable
- add unit tests
Change-Id: Ic64d0291e262170aff7297c6580b0b422eaa8d89
Diffstat (limited to 'core/java/android/widget/FrameLayout.java')
| -rw-r--r-- | core/java/android/widget/FrameLayout.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/java/android/widget/FrameLayout.java b/core/java/android/widget/FrameLayout.java index 0659063bbafe..2a1398d084ac 100644 --- a/core/java/android/widget/FrameLayout.java +++ b/core/java/android/widget/FrameLayout.java @@ -115,7 +115,7 @@ public class FrameLayout extends ViewGroup { } /** - * Describes how the foreground is positioned. Defaults to FILL. + * Describes how the foreground is positioned. Defaults to BEFORE and TOP. * * @param foregroundGravity See {@link android.view.Gravity} * @@ -124,8 +124,8 @@ public class FrameLayout extends ViewGroup { @android.view.RemotableViewMethod public void setForegroundGravity(int foregroundGravity) { if (mForegroundGravity != foregroundGravity) { - if ((foregroundGravity & Gravity.HORIZONTAL_GRAVITY_MASK) == 0) { - foregroundGravity |= Gravity.LEFT; + if ((foregroundGravity & Gravity.RELATIVE_HORIZONTAL_GRAVITY_MASK) == 0) { + foregroundGravity |= Gravity.BEFORE; } if ((foregroundGravity & Gravity.VERTICAL_GRAVITY_MASK) == 0) { @@ -364,7 +364,7 @@ public class FrameLayout extends ViewGroup { gravity = DEFAULT_CHILD_GRAVITY; } - final int horizontalGravity = gravity & Gravity.HORIZONTAL_GRAVITY_MASK; + final int horizontalGravity = Gravity.getAbsoluteGravity(gravity, isLayoutRtl()); final int verticalGravity = gravity & Gravity.VERTICAL_GRAVITY_MASK; switch (horizontalGravity) { @@ -436,7 +436,7 @@ public class FrameLayout extends ViewGroup { } Gravity.apply(mForegroundGravity, foreground.getIntrinsicWidth(), - foreground.getIntrinsicHeight(), selfBounds, overlayBounds); + foreground.getIntrinsicHeight(), selfBounds, overlayBounds, isLayoutRtl()); foreground.setBounds(overlayBounds); } |
