diff options
| -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 25ca42178417..5ebe4e5c64ed 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -5030,10 +5030,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 04b79c5ef8e6..f6b71f8b9415 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -10112,6 +10112,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 65f58421c9b3..4ff8fafdfccd 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 |