summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/java/android/content/res/Configuration.java23
-rw-r--r--core/java/android/text/TextDirectionHeuristics.java3
-rw-r--r--core/java/android/util/LocaleUtil.java27
-rw-r--r--core/java/android/view/View.java4
-rw-r--r--core/tests/coretests/src/android/util/LocaleUtilTest.java119
5 files changed, 84 insertions, 92 deletions
diff --git a/core/java/android/content/res/Configuration.java b/core/java/android/content/res/Configuration.java
index e04b2f7..079f739 100644
--- a/core/java/android/content/res/Configuration.java
+++ b/core/java/android/content/res/Configuration.java
@@ -20,6 +20,7 @@ import android.content.pm.ActivityInfo;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.LocaleUtil;
+import android.view.View;
import java.util.Locale;
@@ -280,9 +281,9 @@ public final class Configuration implements Parcelable, Comparable<Configuration
public int compatSmallestScreenWidthDp;
/**
- * @hide The text layout direction associated to the current Locale
+ * @hide The layout direction associated to the current Locale
*/
- public int textLayoutDirection;
+ public int layoutDirection;
/**
* @hide Internal book-keeping.
@@ -310,7 +311,7 @@ public final class Configuration implements Parcelable, Comparable<Configuration
mnc = o.mnc;
if (o.locale != null) {
locale = (Locale) o.locale.clone();
- textLayoutDirection = o.textLayoutDirection;
+ layoutDirection = o.layoutDirection;
}
userSetLocale = o.userSetLocale;
touchscreen = o.touchscreen;
@@ -346,10 +347,10 @@ public final class Configuration implements Parcelable, Comparable<Configuration
} else {
sb.append(" (no locale)");
}
- switch (textLayoutDirection) {
- case LocaleUtil.TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE: /* ltr not interesting */ break;
- case LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE: sb.append(" rtl"); break;
- default: sb.append(" layoutdir="); sb.append(textLayoutDirection); break;
+ switch (layoutDirection) {
+ case View.LAYOUT_DIRECTION_LTR: /* ltr not interesting */ break;
+ case View.LAYOUT_DIRECTION_RTL: sb.append(" rtl"); break;
+ default: sb.append(" layoutDir="); sb.append(layoutDirection); break;
}
if (smallestScreenWidthDp != SMALLEST_SCREEN_WIDTH_DP_UNDEFINED) {
sb.append(" sw"); sb.append(smallestScreenWidthDp); sb.append("dp");
@@ -472,7 +473,7 @@ public final class Configuration implements Parcelable, Comparable<Configuration
screenWidthDp = compatScreenWidthDp = SCREEN_WIDTH_DP_UNDEFINED;
screenHeightDp = compatScreenHeightDp = SCREEN_HEIGHT_DP_UNDEFINED;
smallestScreenWidthDp = compatSmallestScreenWidthDp = SMALLEST_SCREEN_WIDTH_DP_UNDEFINED;
- textLayoutDirection = LocaleUtil.TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE;
+ layoutDirection = View.LAYOUT_DIRECTION_LTR;
seq = 0;
}
@@ -508,7 +509,7 @@ public final class Configuration implements Parcelable, Comparable<Configuration
changed |= ActivityInfo.CONFIG_LOCALE;
locale = delta.locale != null
? (Locale) delta.locale.clone() : null;
- textLayoutDirection = LocaleUtil.getLayoutDirectionFromLocale(locale);
+ layoutDirection = LocaleUtil.getLayoutDirectionFromLocale(locale);
}
if (delta.userSetLocale && (!userSetLocale || ((changed & ActivityInfo.CONFIG_LOCALE) != 0)))
{
@@ -776,7 +777,7 @@ public final class Configuration implements Parcelable, Comparable<Configuration
dest.writeInt(compatScreenWidthDp);
dest.writeInt(compatScreenHeightDp);
dest.writeInt(compatSmallestScreenWidthDp);
- dest.writeInt(textLayoutDirection);
+ dest.writeInt(layoutDirection);
dest.writeInt(seq);
}
@@ -804,7 +805,7 @@ public final class Configuration implements Parcelable, Comparable<Configuration
compatScreenWidthDp = source.readInt();
compatScreenHeightDp = source.readInt();
compatSmallestScreenWidthDp = source.readInt();
- textLayoutDirection = source.readInt();
+ layoutDirection = source.readInt();
seq = source.readInt();
}
diff --git a/core/java/android/text/TextDirectionHeuristics.java b/core/java/android/text/TextDirectionHeuristics.java
index ae41eab..6ca6161 100644
--- a/core/java/android/text/TextDirectionHeuristics.java
+++ b/core/java/android/text/TextDirectionHeuristics.java
@@ -18,6 +18,7 @@ package android.text;
import android.util.LocaleUtil;
+import android.view.View;
/**
* Some objects that implement TextDirectionHeuristic.
@@ -240,7 +241,7 @@ public class TextDirectionHeuristics {
@Override
protected boolean defaultIsRtl() {
final int dir = LocaleUtil.getLayoutDirectionFromLocale(java.util.Locale.getDefault());
- return (dir == LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE);
+ return (dir == View.LAYOUT_DIRECTION_RTL);
}
public static final TextDirectionHeuristicLocale INSTANCE =
diff --git a/core/java/android/util/LocaleUtil.java b/core/java/android/util/LocaleUtil.java
index 4d773f6..9953252 100644
--- a/core/java/android/util/LocaleUtil.java
+++ b/core/java/android/util/LocaleUtil.java
@@ -18,6 +18,7 @@ package android.util;
import java.util.Locale;
+import android.view.View;
import libcore.icu.ICU;
/**
@@ -29,16 +30,6 @@ public class LocaleUtil {
private LocaleUtil() { /* cannot be instantiated */ }
- /**
- * @hide Do not use. Implementation not finished.
- */
- public static final int TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE = 0;
-
- /**
- * @hide Do not use. Implementation not finished.
- */
- public static final int TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE = 1;
-
private static String ARAB_SCRIPT_SUBTAG = "Arab";
private static String HEBR_SCRIPT_SUBTAG = "Hebr";
@@ -47,8 +38,8 @@ public class LocaleUtil {
*
* @param locale the Locale for which we want the layout direction. Can be null.
* @return the layout direction. This may be one of:
- * {@link #TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE} or
- * {@link #TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE}.
+ * {@link View#LAYOUT_DIRECTION_LTR} or
+ * {@link View#LAYOUT_DIRECTION_RTL}.
*
* Be careful: this code will need to be changed when vertical scripts will be supported
*
@@ -61,11 +52,11 @@ public class LocaleUtil {
if (scriptSubtag.equalsIgnoreCase(ARAB_SCRIPT_SUBTAG) ||
scriptSubtag.equalsIgnoreCase(HEBR_SCRIPT_SUBTAG)) {
- return TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE;
+ return View.LAYOUT_DIRECTION_RTL;
}
}
- return TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE;
+ return View.LAYOUT_DIRECTION_LTR;
}
/**
@@ -75,8 +66,8 @@ public class LocaleUtil {
*
* @param locale
* @return the layout direction. This may be one of:
- * {@link #TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE} or
- * {@link #TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE}.
+ * {@link View#LAYOUT_DIRECTION_LTR} or
+ * {@link View#LAYOUT_DIRECTION_RTL}.
*
* Be careful: this code will need to be changed when vertical scripts will be supported
*
@@ -86,11 +77,11 @@ public class LocaleUtil {
switch(Character.getDirectionality(locale.getDisplayName(locale).charAt(0))) {
case Character.DIRECTIONALITY_RIGHT_TO_LEFT:
case Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC:
- return TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE;
+ return View.LAYOUT_DIRECTION_RTL;
case Character.DIRECTIONALITY_LEFT_TO_RIGHT:
default:
- return TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE;
+ return View.LAYOUT_DIRECTION_LTR;
}
}
}
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index e6b41da..5cf0459 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -40,7 +40,6 @@ import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.os.IBinder;
-import android.os.Message;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.RemoteException;
@@ -9711,8 +9710,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
* @hide
*/
protected static boolean isLayoutDirectionRtl(Locale locale) {
- return (LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE ==
- LocaleUtil.getLayoutDirectionFromLocale(locale));
+ return (LAYOUT_DIRECTION_RTL == LocaleUtil.getLayoutDirectionFromLocale(locale));
}
/**
diff --git a/core/tests/coretests/src/android/util/LocaleUtilTest.java b/core/tests/coretests/src/android/util/LocaleUtilTest.java
index ff3d539..0ca6043 100644
--- a/core/tests/coretests/src/android/util/LocaleUtilTest.java
+++ b/core/tests/coretests/src/android/util/LocaleUtilTest.java
@@ -22,7 +22,8 @@ import android.test.AndroidTestCase;
import dalvik.annotation.TestLevel;
import dalvik.annotation.TestTargetNew;
-import static android.util.LocaleUtil.TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE;
+import static android.view.View.LAYOUT_DIRECTION_LTR;
+import static android.view.View.LAYOUT_DIRECTION_RTL;
public class LocaleUtilTest extends AndroidTestCase {
@@ -32,168 +33,168 @@ public class LocaleUtilTest extends AndroidTestCase {
args = {Locale.class}
)
public void testGetLayoutDirectionFromLocale() {
- assertEquals(TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_LTR,
LocaleUtil.getLayoutDirectionFromLocale(null));
- assertEquals(TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_LTR,
LocaleUtil.getLayoutDirectionFromLocale(Locale.ENGLISH));
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_LTR,
LocaleUtil.getLayoutDirectionFromLocale(Locale.CANADA));
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_LTR,
LocaleUtil.getLayoutDirectionFromLocale(Locale.CANADA_FRENCH));
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_LTR,
LocaleUtil.getLayoutDirectionFromLocale(Locale.FRANCE));
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_LTR,
LocaleUtil.getLayoutDirectionFromLocale(Locale.FRENCH));
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_LTR,
LocaleUtil.getLayoutDirectionFromLocale(Locale.GERMAN));
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_LTR,
LocaleUtil.getLayoutDirectionFromLocale(Locale.GERMANY));
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_LTR,
LocaleUtil.getLayoutDirectionFromLocale(Locale.ITALIAN));
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_LTR,
LocaleUtil.getLayoutDirectionFromLocale(Locale.ITALY));
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_LTR,
LocaleUtil.getLayoutDirectionFromLocale(Locale.UK));
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_LTR,
LocaleUtil.getLayoutDirectionFromLocale(Locale.US));
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_LTR,
LocaleUtil.getLayoutDirectionFromLocale(Locale.ROOT));
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_LTR,
LocaleUtil.getLayoutDirectionFromLocale(Locale.CHINA));
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_LTR,
LocaleUtil.getLayoutDirectionFromLocale(Locale.CHINESE));
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_LTR,
LocaleUtil.getLayoutDirectionFromLocale(Locale.JAPAN));
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_LTR,
LocaleUtil.getLayoutDirectionFromLocale(Locale.JAPANESE));
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_LTR,
LocaleUtil.getLayoutDirectionFromLocale(Locale.KOREA));
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_LTR,
LocaleUtil.getLayoutDirectionFromLocale(Locale.KOREAN));
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_LTR,
LocaleUtil.getLayoutDirectionFromLocale(Locale.PRC));
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_LTR,
LocaleUtil.getLayoutDirectionFromLocale(Locale.SIMPLIFIED_CHINESE));
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_LTR,
LocaleUtil.getLayoutDirectionFromLocale(Locale.TAIWAN));
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_LTR,
LocaleUtil.getLayoutDirectionFromLocale(Locale.TRADITIONAL_CHINESE));
Locale locale = new Locale("ar");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("ar", "AE");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("ar", "BH");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("ar", "DZ");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("ar", "EG");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("ar", "IQ");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("ar", "JO");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("ar", "KW");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("ar", "LB");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("ar", "LY");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("ar", "MA");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("ar", "OM");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("ar", "QA");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("ar", "SA");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("ar", "SD");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("ar", "SY");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("ar", "TN");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("ar", "YE");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("fa");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("fa", "AF");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("fa", "IR");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("iw");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("iw", "IL");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("he");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("he", "IL");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("pa_Arab");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("pa_Arab", "PK");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("ps");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("ps", "AF");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("ur");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("ur", "IN");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("ur", "PK");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("uz_Arab");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
locale = new Locale("uz_Arab", "AF");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_RTL,
LocaleUtil.getLayoutDirectionFromLocale(locale));
// Locale without a real language
locale = new Locale("zz");
- assertEquals(LocaleUtil.TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE,
+ assertEquals(LAYOUT_DIRECTION_LTR,
LocaleUtil.getLayoutDirectionFromLocale(locale));
}
}