Loading core/java/android/util/LocaleUtil.java +0 −2 Original line number Diff line number Diff line Loading @@ -39,8 +39,6 @@ public class LocaleUtil { */ public static final int TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE = 1; private static final char UNDERSCORE_CHAR = '_'; private static String ARAB_SCRIPT_SUBTAG = "Arab"; private static String HEBR_SCRIPT_SUBTAG = "Hebr"; Loading core/java/android/view/View.java +16 −4 Original line number Diff line number Diff line Loading @@ -2626,7 +2626,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal /** * Text direction is using "first strong algorithm". The first strong directional character * determines the paragraph direction. If there is no strong directional character, the * paragraph direction is the view's resolved ayout direction. * paragraph direction is the view's resolved layout direction. * * @hide */ Loading Loading @@ -2655,6 +2655,13 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal */ public static final int TEXT_DIRECTION_RTL = 4; /** * Text direction is coming from the system Locale. * * @hide */ public static final int TEXT_DIRECTION_LOCALE = 5; /** * Default text direction is inherited * Loading @@ -2672,13 +2679,14 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal @ViewDebug.IntToString(from = TEXT_DIRECTION_FIRST_STRONG, to = "FIRST_STRONG"), @ViewDebug.IntToString(from = TEXT_DIRECTION_ANY_RTL, to = "ANY_RTL"), @ViewDebug.IntToString(from = TEXT_DIRECTION_LTR, to = "LTR"), @ViewDebug.IntToString(from = TEXT_DIRECTION_RTL, to = "RTL") @ViewDebug.IntToString(from = TEXT_DIRECTION_RTL, to = "RTL"), @ViewDebug.IntToString(from = TEXT_DIRECTION_LOCALE, to = "LOCALE") }) private int mTextDirection = DEFAULT_TEXT_DIRECTION; /** * The resolved text direction. This needs resolution if the value is * TEXT_DIRECTION_INHERIT. The resolution matches mTextDirection if that is * TEXT_DIRECTION_INHERIT. The resolution matches mTextDirection if it is * not TEXT_DIRECTION_INHERIT, otherwise resolution proceeds up the parent * chain of the view. * Loading @@ -2689,7 +2697,8 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal @ViewDebug.IntToString(from = TEXT_DIRECTION_FIRST_STRONG, to = "FIRST_STRONG"), @ViewDebug.IntToString(from = TEXT_DIRECTION_ANY_RTL, to = "ANY_RTL"), @ViewDebug.IntToString(from = TEXT_DIRECTION_LTR, to = "LTR"), @ViewDebug.IntToString(from = TEXT_DIRECTION_RTL, to = "RTL") @ViewDebug.IntToString(from = TEXT_DIRECTION_RTL, to = "RTL"), @ViewDebug.IntToString(from = TEXT_DIRECTION_LOCALE, to = "LOCALE") }) private int mResolvedTextDirection = TEXT_DIRECTION_INHERIT; Loading Loading @@ -13791,6 +13800,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal * {@link #TEXT_DIRECTION_ANY_RTL}, * {@link #TEXT_DIRECTION_LTR}, * {@link #TEXT_DIRECTION_RTL}, * {@link #TEXT_DIRECTION_LOCALE}, * * @hide */ Loading @@ -13808,6 +13818,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal * {@link #TEXT_DIRECTION_ANY_RTL}, * {@link #TEXT_DIRECTION_LTR}, * {@link #TEXT_DIRECTION_RTL}, * {@link #TEXT_DIRECTION_LOCALE}, * * @hide */ Loading @@ -13828,6 +13839,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal * {@link #TEXT_DIRECTION_ANY_RTL}, * {@link #TEXT_DIRECTION_LTR}, * {@link #TEXT_DIRECTION_RTL}, * {@link #TEXT_DIRECTION_LOCALE}, * * @hide */ Loading core/java/android/widget/TextView.java +3 −0 Original line number Diff line number Diff line Loading @@ -11378,6 +11378,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener case TEXT_DIRECTION_RTL: mTextDir = TextDirectionHeuristics.RTL; break; case TEXT_DIRECTION_LOCALE: mTextDir = TextDirectionHeuristics.LOCALE; break; } } Loading core/res/res/values/attrs.xml +2 −0 Original line number Diff line number Diff line Loading @@ -2066,6 +2066,8 @@ <enum name="ltr" value="4" /> <!-- The paragraph direction is right to left. --> <enum name="rtl" value="5" /> <!-- The paragraph direction is coming from the system Locale. --> <enum name="locale" value="6" /> </attr> </declare-styleable> Loading core/tests/coretests/src/android/widget/TextViewTest.java +37 −14 Original line number Diff line number Diff line Loading @@ -86,6 +86,9 @@ public class TextViewTest extends ActivityInstrumentationTestCase2<TextViewTestA tv.setTextDirection(View.TEXT_DIRECTION_RTL); assertEquals(View.TEXT_DIRECTION_RTL, tv.getTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_LOCALE); assertEquals(View.TEXT_DIRECTION_LOCALE, tv.getTextDirection()); } @SmallTest Loading @@ -93,45 +96,53 @@ public class TextViewTest extends ActivityInstrumentationTestCase2<TextViewTestA TextView tv = new TextView(getActivity()); tv.setText("this is a test"); assertEquals(View.TEXT_DIRECTION_FIRST_STRONG, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_FIRST_STRONG); assertEquals(View.TEXT_DIRECTION_LTR, tv.getResolvedTextDirection()); assertEquals(View.TEXT_DIRECTION_FIRST_STRONG, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_ANY_RTL); assertEquals(View.TEXT_DIRECTION_LTR, tv.getResolvedTextDirection()); assertEquals(View.TEXT_DIRECTION_ANY_RTL, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_INHERIT); assertEquals(View.TEXT_DIRECTION_LTR, tv.getResolvedTextDirection()); assertEquals(View.TEXT_DIRECTION_FIRST_STRONG, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_LTR); assertEquals(View.TEXT_DIRECTION_LTR, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_RTL); assertEquals(View.TEXT_DIRECTION_RTL, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_LOCALE); assertEquals(View.TEXT_DIRECTION_LOCALE, tv.getResolvedTextDirection()); } @SmallTest public void testGetResolvedTextDirectionLtrWithInheritance() { LinearLayout ll = new LinearLayout(getActivity()); ll.setTextDirection(View.TEXT_DIRECTION_RTL); ll.setTextDirection(View.TEXT_DIRECTION_ANY_RTL); TextView tv = new TextView(getActivity()); tv.setText("this is a test"); ll.addView(tv); tv.setTextDirection(View.TEXT_DIRECTION_FIRST_STRONG); assertEquals(View.TEXT_DIRECTION_LTR, tv.getResolvedTextDirection()); assertEquals(View.TEXT_DIRECTION_FIRST_STRONG, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_ANY_RTL); assertEquals(View.TEXT_DIRECTION_LTR, tv.getResolvedTextDirection()); assertEquals(View.TEXT_DIRECTION_ANY_RTL, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_INHERIT); assertEquals(View.TEXT_DIRECTION_RTL, tv.getResolvedTextDirection()); assertEquals(View.TEXT_DIRECTION_ANY_RTL, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_LTR); assertEquals(View.TEXT_DIRECTION_LTR, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_RTL); assertEquals(View.TEXT_DIRECTION_RTL, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_LOCALE); assertEquals(View.TEXT_DIRECTION_LOCALE, tv.getResolvedTextDirection()); } @SmallTest Loading @@ -139,35 +150,41 @@ public class TextViewTest extends ActivityInstrumentationTestCase2<TextViewTestA TextView tv = new TextView(getActivity()); tv.setText("\u05DD\u05DE"); // hebrew assertEquals(View.TEXT_DIRECTION_FIRST_STRONG, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_FIRST_STRONG); assertEquals(View.TEXT_DIRECTION_RTL, tv.getResolvedTextDirection()); assertEquals(View.TEXT_DIRECTION_FIRST_STRONG, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_ANY_RTL); assertEquals(View.TEXT_DIRECTION_RTL, tv.getResolvedTextDirection()); assertEquals(View.TEXT_DIRECTION_ANY_RTL, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_INHERIT); assertEquals(View.TEXT_DIRECTION_LTR, tv.getResolvedTextDirection()); assertEquals(View.TEXT_DIRECTION_FIRST_STRONG, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_LTR); assertEquals(View.TEXT_DIRECTION_LTR, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_RTL); assertEquals(View.TEXT_DIRECTION_RTL, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_LOCALE); assertEquals(View.TEXT_DIRECTION_LOCALE, tv.getResolvedTextDirection()); } @SmallTest public void testGetResolvedTextDirectionRtlWithInheritance() { LinearLayout ll = new LinearLayout(getActivity()); ll.setTextDirection(View.TEXT_DIRECTION_FIRST_STRONG); TextView tv = new TextView(getActivity()); tv.setText("\u05DD\u05DE"); // hebrew ll.addView(tv); tv.setTextDirection(View.TEXT_DIRECTION_FIRST_STRONG); assertEquals(View.TEXT_DIRECTION_RTL, tv.getResolvedTextDirection()); assertEquals(View.TEXT_DIRECTION_FIRST_STRONG, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_ANY_RTL); assertEquals(View.TEXT_DIRECTION_RTL, tv.getResolvedTextDirection()); assertEquals(View.TEXT_DIRECTION_ANY_RTL, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_INHERIT); assertEquals(View.TEXT_DIRECTION_FIRST_STRONG, tv.getResolvedTextDirection()); Loading @@ -178,14 +195,17 @@ public class TextViewTest extends ActivityInstrumentationTestCase2<TextViewTestA tv.setTextDirection(View.TEXT_DIRECTION_RTL); assertEquals(View.TEXT_DIRECTION_RTL, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_LOCALE); assertEquals(View.TEXT_DIRECTION_LOCALE, tv.getResolvedTextDirection()); // Force to RTL text direction on the layout ll.setTextDirection(View.TEXT_DIRECTION_RTL); tv.setTextDirection(View.TEXT_DIRECTION_FIRST_STRONG); assertEquals(View.TEXT_DIRECTION_RTL, tv.getResolvedTextDirection()); assertEquals(View.TEXT_DIRECTION_FIRST_STRONG, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_ANY_RTL); assertEquals(View.TEXT_DIRECTION_RTL, tv.getResolvedTextDirection()); assertEquals(View.TEXT_DIRECTION_ANY_RTL, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_INHERIT); assertEquals(View.TEXT_DIRECTION_RTL, tv.getResolvedTextDirection()); Loading @@ -195,6 +215,9 @@ public class TextViewTest extends ActivityInstrumentationTestCase2<TextViewTestA tv.setTextDirection(View.TEXT_DIRECTION_RTL); assertEquals(View.TEXT_DIRECTION_RTL, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_LOCALE); assertEquals(View.TEXT_DIRECTION_LOCALE, tv.getResolvedTextDirection()); } @SmallTest Loading Loading
core/java/android/util/LocaleUtil.java +0 −2 Original line number Diff line number Diff line Loading @@ -39,8 +39,6 @@ public class LocaleUtil { */ public static final int TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE = 1; private static final char UNDERSCORE_CHAR = '_'; private static String ARAB_SCRIPT_SUBTAG = "Arab"; private static String HEBR_SCRIPT_SUBTAG = "Hebr"; Loading
core/java/android/view/View.java +16 −4 Original line number Diff line number Diff line Loading @@ -2626,7 +2626,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal /** * Text direction is using "first strong algorithm". The first strong directional character * determines the paragraph direction. If there is no strong directional character, the * paragraph direction is the view's resolved ayout direction. * paragraph direction is the view's resolved layout direction. * * @hide */ Loading Loading @@ -2655,6 +2655,13 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal */ public static final int TEXT_DIRECTION_RTL = 4; /** * Text direction is coming from the system Locale. * * @hide */ public static final int TEXT_DIRECTION_LOCALE = 5; /** * Default text direction is inherited * Loading @@ -2672,13 +2679,14 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal @ViewDebug.IntToString(from = TEXT_DIRECTION_FIRST_STRONG, to = "FIRST_STRONG"), @ViewDebug.IntToString(from = TEXT_DIRECTION_ANY_RTL, to = "ANY_RTL"), @ViewDebug.IntToString(from = TEXT_DIRECTION_LTR, to = "LTR"), @ViewDebug.IntToString(from = TEXT_DIRECTION_RTL, to = "RTL") @ViewDebug.IntToString(from = TEXT_DIRECTION_RTL, to = "RTL"), @ViewDebug.IntToString(from = TEXT_DIRECTION_LOCALE, to = "LOCALE") }) private int mTextDirection = DEFAULT_TEXT_DIRECTION; /** * The resolved text direction. This needs resolution if the value is * TEXT_DIRECTION_INHERIT. The resolution matches mTextDirection if that is * TEXT_DIRECTION_INHERIT. The resolution matches mTextDirection if it is * not TEXT_DIRECTION_INHERIT, otherwise resolution proceeds up the parent * chain of the view. * Loading @@ -2689,7 +2697,8 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal @ViewDebug.IntToString(from = TEXT_DIRECTION_FIRST_STRONG, to = "FIRST_STRONG"), @ViewDebug.IntToString(from = TEXT_DIRECTION_ANY_RTL, to = "ANY_RTL"), @ViewDebug.IntToString(from = TEXT_DIRECTION_LTR, to = "LTR"), @ViewDebug.IntToString(from = TEXT_DIRECTION_RTL, to = "RTL") @ViewDebug.IntToString(from = TEXT_DIRECTION_RTL, to = "RTL"), @ViewDebug.IntToString(from = TEXT_DIRECTION_LOCALE, to = "LOCALE") }) private int mResolvedTextDirection = TEXT_DIRECTION_INHERIT; Loading Loading @@ -13791,6 +13800,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal * {@link #TEXT_DIRECTION_ANY_RTL}, * {@link #TEXT_DIRECTION_LTR}, * {@link #TEXT_DIRECTION_RTL}, * {@link #TEXT_DIRECTION_LOCALE}, * * @hide */ Loading @@ -13808,6 +13818,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal * {@link #TEXT_DIRECTION_ANY_RTL}, * {@link #TEXT_DIRECTION_LTR}, * {@link #TEXT_DIRECTION_RTL}, * {@link #TEXT_DIRECTION_LOCALE}, * * @hide */ Loading @@ -13828,6 +13839,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal * {@link #TEXT_DIRECTION_ANY_RTL}, * {@link #TEXT_DIRECTION_LTR}, * {@link #TEXT_DIRECTION_RTL}, * {@link #TEXT_DIRECTION_LOCALE}, * * @hide */ Loading
core/java/android/widget/TextView.java +3 −0 Original line number Diff line number Diff line Loading @@ -11378,6 +11378,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener case TEXT_DIRECTION_RTL: mTextDir = TextDirectionHeuristics.RTL; break; case TEXT_DIRECTION_LOCALE: mTextDir = TextDirectionHeuristics.LOCALE; break; } } Loading
core/res/res/values/attrs.xml +2 −0 Original line number Diff line number Diff line Loading @@ -2066,6 +2066,8 @@ <enum name="ltr" value="4" /> <!-- The paragraph direction is right to left. --> <enum name="rtl" value="5" /> <!-- The paragraph direction is coming from the system Locale. --> <enum name="locale" value="6" /> </attr> </declare-styleable> Loading
core/tests/coretests/src/android/widget/TextViewTest.java +37 −14 Original line number Diff line number Diff line Loading @@ -86,6 +86,9 @@ public class TextViewTest extends ActivityInstrumentationTestCase2<TextViewTestA tv.setTextDirection(View.TEXT_DIRECTION_RTL); assertEquals(View.TEXT_DIRECTION_RTL, tv.getTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_LOCALE); assertEquals(View.TEXT_DIRECTION_LOCALE, tv.getTextDirection()); } @SmallTest Loading @@ -93,45 +96,53 @@ public class TextViewTest extends ActivityInstrumentationTestCase2<TextViewTestA TextView tv = new TextView(getActivity()); tv.setText("this is a test"); assertEquals(View.TEXT_DIRECTION_FIRST_STRONG, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_FIRST_STRONG); assertEquals(View.TEXT_DIRECTION_LTR, tv.getResolvedTextDirection()); assertEquals(View.TEXT_DIRECTION_FIRST_STRONG, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_ANY_RTL); assertEquals(View.TEXT_DIRECTION_LTR, tv.getResolvedTextDirection()); assertEquals(View.TEXT_DIRECTION_ANY_RTL, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_INHERIT); assertEquals(View.TEXT_DIRECTION_LTR, tv.getResolvedTextDirection()); assertEquals(View.TEXT_DIRECTION_FIRST_STRONG, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_LTR); assertEquals(View.TEXT_DIRECTION_LTR, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_RTL); assertEquals(View.TEXT_DIRECTION_RTL, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_LOCALE); assertEquals(View.TEXT_DIRECTION_LOCALE, tv.getResolvedTextDirection()); } @SmallTest public void testGetResolvedTextDirectionLtrWithInheritance() { LinearLayout ll = new LinearLayout(getActivity()); ll.setTextDirection(View.TEXT_DIRECTION_RTL); ll.setTextDirection(View.TEXT_DIRECTION_ANY_RTL); TextView tv = new TextView(getActivity()); tv.setText("this is a test"); ll.addView(tv); tv.setTextDirection(View.TEXT_DIRECTION_FIRST_STRONG); assertEquals(View.TEXT_DIRECTION_LTR, tv.getResolvedTextDirection()); assertEquals(View.TEXT_DIRECTION_FIRST_STRONG, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_ANY_RTL); assertEquals(View.TEXT_DIRECTION_LTR, tv.getResolvedTextDirection()); assertEquals(View.TEXT_DIRECTION_ANY_RTL, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_INHERIT); assertEquals(View.TEXT_DIRECTION_RTL, tv.getResolvedTextDirection()); assertEquals(View.TEXT_DIRECTION_ANY_RTL, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_LTR); assertEquals(View.TEXT_DIRECTION_LTR, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_RTL); assertEquals(View.TEXT_DIRECTION_RTL, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_LOCALE); assertEquals(View.TEXT_DIRECTION_LOCALE, tv.getResolvedTextDirection()); } @SmallTest Loading @@ -139,35 +150,41 @@ public class TextViewTest extends ActivityInstrumentationTestCase2<TextViewTestA TextView tv = new TextView(getActivity()); tv.setText("\u05DD\u05DE"); // hebrew assertEquals(View.TEXT_DIRECTION_FIRST_STRONG, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_FIRST_STRONG); assertEquals(View.TEXT_DIRECTION_RTL, tv.getResolvedTextDirection()); assertEquals(View.TEXT_DIRECTION_FIRST_STRONG, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_ANY_RTL); assertEquals(View.TEXT_DIRECTION_RTL, tv.getResolvedTextDirection()); assertEquals(View.TEXT_DIRECTION_ANY_RTL, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_INHERIT); assertEquals(View.TEXT_DIRECTION_LTR, tv.getResolvedTextDirection()); assertEquals(View.TEXT_DIRECTION_FIRST_STRONG, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_LTR); assertEquals(View.TEXT_DIRECTION_LTR, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_RTL); assertEquals(View.TEXT_DIRECTION_RTL, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_LOCALE); assertEquals(View.TEXT_DIRECTION_LOCALE, tv.getResolvedTextDirection()); } @SmallTest public void testGetResolvedTextDirectionRtlWithInheritance() { LinearLayout ll = new LinearLayout(getActivity()); ll.setTextDirection(View.TEXT_DIRECTION_FIRST_STRONG); TextView tv = new TextView(getActivity()); tv.setText("\u05DD\u05DE"); // hebrew ll.addView(tv); tv.setTextDirection(View.TEXT_DIRECTION_FIRST_STRONG); assertEquals(View.TEXT_DIRECTION_RTL, tv.getResolvedTextDirection()); assertEquals(View.TEXT_DIRECTION_FIRST_STRONG, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_ANY_RTL); assertEquals(View.TEXT_DIRECTION_RTL, tv.getResolvedTextDirection()); assertEquals(View.TEXT_DIRECTION_ANY_RTL, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_INHERIT); assertEquals(View.TEXT_DIRECTION_FIRST_STRONG, tv.getResolvedTextDirection()); Loading @@ -178,14 +195,17 @@ public class TextViewTest extends ActivityInstrumentationTestCase2<TextViewTestA tv.setTextDirection(View.TEXT_DIRECTION_RTL); assertEquals(View.TEXT_DIRECTION_RTL, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_LOCALE); assertEquals(View.TEXT_DIRECTION_LOCALE, tv.getResolvedTextDirection()); // Force to RTL text direction on the layout ll.setTextDirection(View.TEXT_DIRECTION_RTL); tv.setTextDirection(View.TEXT_DIRECTION_FIRST_STRONG); assertEquals(View.TEXT_DIRECTION_RTL, tv.getResolvedTextDirection()); assertEquals(View.TEXT_DIRECTION_FIRST_STRONG, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_ANY_RTL); assertEquals(View.TEXT_DIRECTION_RTL, tv.getResolvedTextDirection()); assertEquals(View.TEXT_DIRECTION_ANY_RTL, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_INHERIT); assertEquals(View.TEXT_DIRECTION_RTL, tv.getResolvedTextDirection()); Loading @@ -195,6 +215,9 @@ public class TextViewTest extends ActivityInstrumentationTestCase2<TextViewTestA tv.setTextDirection(View.TEXT_DIRECTION_RTL); assertEquals(View.TEXT_DIRECTION_RTL, tv.getResolvedTextDirection()); tv.setTextDirection(View.TEXT_DIRECTION_LOCALE); assertEquals(View.TEXT_DIRECTION_LOCALE, tv.getResolvedTextDirection()); } @SmallTest Loading