summaryrefslogtreecommitdiffstats
path: root/core/java/android/view/ViewGroup.java
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2012-09-24 14:56:49 -0700
committerFabrice Di Meglio <fdimeglio@google.com>2012-09-25 12:50:17 -0700
commit1f88ba8bf67bb9264e39547ab1201aa3c5395d0e (patch)
tree1cca12d8475d8379da6c55d19a959e94ed8cb7a3 /core/java/android/view/ViewGroup.java
parent1a7d487380460b4aea37140baf6bf4bf7f92f8a5 (diff)
downloadframeworks_base-1f88ba8bf67bb9264e39547ab1201aa3c5395d0e.zip
frameworks_base-1f88ba8bf67bb9264e39547ab1201aa3c5395d0e.tar.gz
frameworks_base-1f88ba8bf67bb9264e39547ab1201aa3c5395d0e.tar.bz2
Fix bug #6427629 Clean up layout direction APIs
- getLayoutDirection() / getTextDirection() / getTextAligment() dont do resolution - resolution done into onMeasure() - use XX_RESOLVED bits to check if resolution needs to be done - code formatting Change-Id: Ie46a5535860e90f3449b96cfe0aa04dd7e3006d7
Diffstat (limited to 'core/java/android/view/ViewGroup.java')
-rw-r--r--core/java/android/view/ViewGroup.java82
1 files changed, 75 insertions, 7 deletions
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index 34411ea..41890d6 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -3391,11 +3391,6 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
if (child.hasTransientState()) {
childHasTransientStateChanged(child, true);
}
-
- if (child.isLayoutDirectionInherited()) {
- child.resetResolvedLayoutDirection();
- child.resolveRtlProperties();
- }
}
private void addInArray(View child, int index) {
@@ -3621,7 +3616,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
childHasTransientStateChanged(view, false);
}
- view.resetResolvedLayoutDirection();
+ view.resetRtlProperties();
onViewRemoved(view);
@@ -5261,19 +5256,92 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
* @hide
*/
@Override
+ public void resolveLayoutDirection() {
+ super.resolveLayoutDirection();
+
+ int count = getChildCount();
+ for (int i = 0; i < count; i++) {
+ final View child = getChildAt(i);
+ if (child.isLayoutDirectionInherited()) {
+ child.resolveLayoutDirection();
+ }
+ }
+ }
+
+ /**
+ * @hide
+ */
+ @Override
+ public void resolveTextDirection() {
+ super.resolveTextDirection();
+
+ int count = getChildCount();
+ for (int i = 0; i < count; i++) {
+ final View child = getChildAt(i);
+ if (child.isTextDirectionInherited()) {
+ child.resolveTextDirection();
+ }
+ }
+ }
+
+ /**
+ * @hide
+ */
+ @Override
+ public void resolveTextAlignment() {
+ super.resolveTextAlignment();
+
+ int count = getChildCount();
+ for (int i = 0; i < count; i++) {
+ final View child = getChildAt(i);
+ if (child.isTextAlignmentInherited()) {
+ child.resolveTextAlignment();
+ }
+ }
+ }
+
+ /**
+ * @hide
+ */
+ @Override
public void resetResolvedLayoutDirection() {
super.resetResolvedLayoutDirection();
- // Take care of resetting the children resolution too
int count = getChildCount();
for (int i = 0; i < count; i++) {
final View child = getChildAt(i);
if (child.isLayoutDirectionInherited()) {
child.resetResolvedLayoutDirection();
}
+ }
+ }
+
+ /**
+ * @hide
+ */
+ @Override
+ public void resetResolvedTextDirection() {
+ super.resetResolvedTextDirection();
+
+ int count = getChildCount();
+ for (int i = 0; i < count; i++) {
+ final View child = getChildAt(i);
if (child.isTextDirectionInherited()) {
child.resetResolvedTextDirection();
}
+ }
+ }
+
+ /**
+ * @hide
+ */
+ @Override
+ public void resetResolvedTextAlignment() {
+ super.resetResolvedTextAlignment();
+
+ int count = getChildCount();
+ for (int i = 0; i < count; i++) {
+ final View child = getChildAt(i);
if (child.isTextAlignmentInherited()) {
child.resetResolvedTextAlignment();
}