Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f03712bf authored by Fabrice Di Meglio's avatar Fabrice Di Meglio Committed by Android (Google) Code Review
Browse files

Merge "Fix default TextView textDirection heuristic"

parents 82376c82 0b28c757
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -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
+1 −0
Original line number Diff line number Diff line
@@ -10177,6 +10177,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                foundStrongLtr = true;
            } else if (isStrongRtlChar(dir)) {
                foundStrongRtl = true;
                break;
            }
        }
        if (foundStrongRtl) {
+1 −1
Original line number Diff line number Diff line
@@ -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