summaryrefslogtreecommitdiffstats
path: root/core/java/android/view/ViewGroup.java
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2012-10-11 16:27:37 -0700
committerFabrice Di Meglio <fdimeglio@google.com>2012-10-12 15:54:10 -0700
commit84ebb35f392478600ddf8f08107fb345f13ef91c (patch)
tree8157d3e423bfb7d4f0e84c6e1e7813c9f7d033a6 /core/java/android/view/ViewGroup.java
parent4c38e24afb0fe68d6e9f6e924e6426808be2611a (diff)
downloadframeworks_base-84ebb35f392478600ddf8f08107fb345f13ef91c.zip
frameworks_base-84ebb35f392478600ddf8f08107fb345f13ef91c.tar.gz
frameworks_base-84ebb35f392478600ddf8f08107fb345f13ef91c.tar.bz2
Fix bug #7334966 Padding is still broken in RTL languages
- do correct resolution and reset propagation for all RTL properties (padding and drawables included) - fix CheckedTextView padding too Change-Id: Ie603683a2324b2a6ef2c03633d01d5726c883b90
Diffstat (limited to 'core/java/android/view/ViewGroup.java')
-rw-r--r--core/java/android/view/ViewGroup.java92
1 files changed, 92 insertions, 0 deletions
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index 0661992..9ce7df9 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -5263,6 +5263,21 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
* @hide
*/
@Override
+ public void resolveRtlPropertiesIfNeeded() {
+ super.resolveRtlPropertiesIfNeeded();
+ int count = getChildCount();
+ for (int i = 0; i < count; i++) {
+ final View child = getChildAt(i);
+ if (child.isLayoutDirectionInherited()) {
+ child.resolveRtlPropertiesIfNeeded();
+ }
+ }
+ }
+
+ /**
+ * @hide
+ */
+ @Override
public boolean resolveLayoutDirection() {
final boolean result = super.resolveLayoutDirection();
if (result) {
@@ -5317,6 +5332,51 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
* @hide
*/
@Override
+ public void resolvePadding() {
+ super.resolvePadding();
+ int count = getChildCount();
+ for (int i = 0; i < count; i++) {
+ final View child = getChildAt(i);
+ if (child.isLayoutDirectionInherited()) {
+ child.resolvePadding();
+ }
+ }
+ }
+
+ /**
+ * @hide
+ */
+ @Override
+ protected void resolveDrawables() {
+ super.resolveDrawables();
+ int count = getChildCount();
+ for (int i = 0; i < count; i++) {
+ final View child = getChildAt(i);
+ if (child.isLayoutDirectionInherited()) {
+ child.resolveDrawables();
+ }
+ }
+ }
+
+ /**
+ * @hide
+ */
+ @Override
+ public void resetRtlProperties() {
+ super.resetRtlProperties();
+ int count = getChildCount();
+ for (int i = 0; i < count; i++) {
+ final View child = getChildAt(i);
+ if (child.isLayoutDirectionInherited()) {
+ child.resetRtlProperties();
+ }
+ }
+ }
+
+ /**
+ * @hide
+ */
+ @Override
public void resetResolvedLayoutDirection() {
super.resetResolvedLayoutDirection();
@@ -5362,6 +5422,38 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
}
/**
+ * @hide
+ */
+ @Override
+ public void resetResolvedPadding() {
+ super.resetResolvedPadding();
+
+ int count = getChildCount();
+ for (int i = 0; i < count; i++) {
+ final View child = getChildAt(i);
+ if (child.isLayoutDirectionInherited()) {
+ child.resetResolvedPadding();
+ }
+ }
+ }
+
+ /**
+ * @hide
+ */
+ @Override
+ protected void resetResolvedDrawables() {
+ super.resetResolvedDrawables();
+
+ int count = getChildCount();
+ for (int i = 0; i < count; i++) {
+ final View child = getChildAt(i);
+ if (child.isLayoutDirectionInherited()) {
+ child.resetResolvedDrawables();
+ }
+ }
+ }
+
+ /**
* Return true if the pressed state should be delayed for children or descendants of this
* ViewGroup. Generally, this should be done for containers that can scroll, such as a List.
* This prevents the pressed state from appearing when the user is actually trying to scroll