diff options
author | Fabrice Di Meglio <fdimeglio@google.com> | 2011-07-15 16:52:03 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-07-15 16:52:03 -0700 |
commit | 9703ac8e6f98346a659fd4dbd112f82b558b6de1 (patch) | |
tree | 8da62d32e7a92b1f079297247a634d0c31517e01 | |
parent | 9189c2ea750d3292aa6e04dbef3be7aeac8a8b68 (diff) | |
parent | d2b5d1cf4aaa5ce95803a837f563292763184302 (diff) | |
download | frameworks_base-9703ac8e6f98346a659fd4dbd112f82b558b6de1.zip frameworks_base-9703ac8e6f98346a659fd4dbd112f82b558b6de1.tar.gz frameworks_base-9703ac8e6f98346a659fd4dbd112f82b558b6de1.tar.bz2 |
Merge "Some code refactoring"
-rw-r--r-- | core/java/android/widget/TextView.java | 6 | ||||
-rw-r--r-- | tests/BiDiTests/res/layout/basic.xml | 30 |
2 files changed, 32 insertions, 4 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index ecbd997..5a5fae4 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -6586,11 +6586,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 |