Pass text direction from StaticLayout to Layout
Previously, the text direction was not passed from StaticLayout to
Layout when a StaticLayout was constructed using a builder, resulting
in inconsistency between the direction of a StaticLayout and the
Layout itself. Now we pass the text direction to Layout.
Fixes: 66463721
Test: bit CtsTextTestCases:android.text.cts.DynamicLayoutTest
Test: bit CtsTextTestCases:android.text.cts.StaticLayoutTest
Test: bit CtsWidgetTestCases:android.widget.cts.EditTextTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: bit FrameworksCoreTests:android.text.DynamicLayoutTest
Test: bit FrameworksCoreTests:android.text.StaticLayoutTest
Test: bit FrameworksCoreTests:android.widget.TextViewTest
Change-Id: Ifaa9d108283292469f0f41c80350162b1d042a93
diff --git a/core/java/android/text/StaticLayout.java b/core/java/android/text/StaticLayout.java
index c124c7f..3303b54 100644
--- a/core/java/android/text/StaticLayout.java
+++ b/core/java/android/text/StaticLayout.java
@@ -616,7 +616,7 @@
: (b.mText instanceof Spanned)
? new SpannedEllipsizer(b.mText)
: new Ellipsizer(b.mText),
- b.mPaint, b.mWidth, b.mAlignment, b.mSpacingMult, b.mSpacingAdd);
+ b.mPaint, b.mWidth, b.mAlignment, b.mTextDir, b.mSpacingMult, b.mSpacingAdd);
if (b.mEllipsize != null) {
Ellipsizer e = (Ellipsizer) getText();