diff options
| author | Fabrice Di Meglio <fdimeglio@google.com> | 2012-10-18 15:23:40 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-10-18 15:23:41 -0700 |
| commit | 07f85fecdd9f13a617953c7377ff62b4133b4e30 (patch) | |
| tree | 07148538b9609677a56341352d3e5136c205851e /core/java/android/view | |
| parent | 80ce3d8746e9bb727ebf37a8963b96be84d82413 (diff) | |
| parent | fcc3348f61b2992f0b84e8e8dcb3535fc715298f (diff) | |
| download | frameworks_base-07f85fecdd9f13a617953c7377ff62b4133b4e30.zip frameworks_base-07f85fecdd9f13a617953c7377ff62b4133b4e30.tar.gz frameworks_base-07f85fecdd9f13a617953c7377ff62b4133b4e30.tar.bz2 | |
Merge "Fix bug #7374285 GridLayout layout param margins are broken in RTL mode" into jb-mr1-dev
Diffstat (limited to 'core/java/android/view')
| -rw-r--r-- | core/java/android/view/View.java | 4 | ||||
| -rw-r--r-- | core/java/android/view/ViewGroup.java | 15 |
2 files changed, 18 insertions, 1 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index b4ba871..b36db7f 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -10002,8 +10002,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, /** * Resolve the layout parameters depending on the resolved layout direction + * + * @hide */ - private void resolveLayoutParams() { + public void resolveLayoutParams() { if (mLayoutParams != null) { mLayoutParams.resolveLayoutDirection(getLayoutDirection()); } diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index b95e1bd..f49a839 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -5358,6 +5358,16 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager } } + @Override + public void resolveLayoutParams() { + super.resolveLayoutParams(); + int count = getChildCount(); + for (int i = 0; i < count; i++) { + final View child = getChildAt(i); + child.resolveLayoutParams(); + } + } + /** * @hide */ @@ -5981,6 +5991,11 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager */ @Override public void resolveLayoutDirection(int layoutDirection) { + // No need to resolve if it is the same layout direction as before + if (this.layoutDirection == layoutDirection) { + return; + } + setLayoutDirection(layoutDirection); if (!isMarginRelative()) return; |
