diff options
author | Fabrice Di Meglio <fdimeglio@google.com> | 2011-07-01 15:35:52 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-07-01 15:35:52 -0700 |
commit | f03712bf540db15d0594b848e63c207fd50e9379 (patch) | |
tree | 0538aa3b741d751d5c1f1aa8d433eba8ed1037d6 | |
parent | 82376c826775f353b10c20d53fe34aa4f61cadb7 (diff) | |
parent | 0b28c757adfec4302b144d8230c01c04ae00ca2b (diff) | |
download | frameworks_base-f03712bf540db15d0594b848e63c207fd50e9379.zip frameworks_base-f03712bf540db15d0594b848e63c207fd50e9379.tar.gz frameworks_base-f03712bf540db15d0594b848e63c207fd50e9379.tar.bz2 |
Merge "Fix default TextView textDirection heuristic"
-rw-r--r-- | core/java/android/view/ViewGroup.java | 7 | ||||
-rw-r--r-- | core/java/android/widget/TextView.java | 1 | ||||
-rwxr-xr-x | core/res/res/values/attrs.xml | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index 9f4ecbc..41412de 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -5027,10 +5027,9 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager if (mParent != null && mParent instanceof ViewGroup) { resolvedTextDirection = ((ViewGroup) mParent).getResolvedTextDirection(); } else { - // We reached the top of the View hierarchy, so get the direction from - // the Locale - resolvedTextDirection = isLayoutDirectionRtl(Locale.getDefault()) ? - TEXT_DIRECTION_RTL : TEXT_DIRECTION_LTR; + // We reached the top of the View hierarchy, so set the text direction + // heuristic to "first strong" + resolvedTextDirection = TEXT_DIRECTION_FIRST_STRONG; } break; // Pass down the hierarchy the following text direction values diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 6154b42..c91f1a6 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -10177,6 +10177,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener foundStrongLtr = true; } else if (isStrongRtlChar(dir)) { foundStrongRtl = true; + break; } } if (foundStrongRtl) { diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index e9b845d..c84a591 100755 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -1978,7 +1978,7 @@ <!-- Default --> <enum name="inherit" value="0" /> <!-- Default for the root view. The first strong directional character determines the - paragraph direction. If there is o strong directional character, the paragraph + paragraph direction. If there is no strong directional character, the paragraph direction is the view’s resolved layout direction. --> <enum name="firstStrong" value="1" /> <!-- The paragraph direction is RTL if it contains any strong RTL character, otherwise |