summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/java/android/widget/TextView.java6
-rw-r--r--tests/BiDiTests/res/layout/basic.xml30
2 files changed, 32 insertions, 4 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 6b4e454..51eee20 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -6571,11 +6571,11 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
scrollx = left;
}
}
- } else if (a == Layout.Alignment.ALIGN_LEFT) {
- scrollx = (int) FloatMath.floor(mLayout.getLineLeft(line));
- } else { // a == Layout.Alignment.ALIGN_RIGHT
+ } else if (a == Layout.Alignment.ALIGN_RIGHT) {
int right = (int) FloatMath.ceil(mLayout.getLineRight(line));
scrollx = right - hspace;
+ } else { // a == Layout.Alignment.ALIGN_LEFT (will also be the default)
+ scrollx = (int) FloatMath.floor(mLayout.getLineLeft(line));
}
if (ht < vspace) {
diff --git a/tests/BiDiTests/res/layout/basic.xml b/tests/BiDiTests/res/layout/basic.xml
index d438b2c..c1ebd20 100644
--- a/tests/BiDiTests/res/layout/basic.xml
+++ b/tests/BiDiTests/res/layout/basic.xml
@@ -40,7 +40,7 @@
android:textSize="32dip"
android:text="@string/textview_text"
/>
-
+
<EditText android:id="@+id/edittext"
android:layout_height="wrap_content"
android:layout_width="match_parent"
@@ -51,4 +51,32 @@
</LinearLayout>
+ <LinearLayout
+ android:layout_width="600dip"
+ android:layout_height="128dip"
+ android:layout_gravity="center_vertical"
+ android:orientation="horizontal"
+ style="@android:style/Widget.Holo.Spinner"
+ >
+ <LinearLayout
+ android:layout_width="0dip"
+ android:layout_weight="1"
+ android:layout_height="match_parent"
+ android:layout_gravity="center_vertical"
+ android:orientation="vertical"
+ >
+ <TextView
+ android:id="@+id/spinner_line_1"
+ android:layout_width="match_parent"
+ android:layout_height="0dip"
+ android:layout_weight="1"
+ android:textSize="16dip"
+ android:singleLine="true"
+ android:ellipsize="end"
+ android:gravity="left|center_vertical"
+ android:text="@string/button_text"
+ />
+ </LinearLayout>
+ </LinearLayout>
+
</FrameLayout> \ No newline at end of file