Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d2b5d1cf authored by Fabrice Di Meglio's avatar Fabrice Di Meglio
Browse files

Some code refactoring

- make Layout.Alignment.ALIGN_LEFT as the default case
- update unit tests for reproducing bug #5002512

Change-Id: Id7ec17abd115bcda7f3434e6d64dbbba6915f108
parent c1df573a
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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) {
+29 −1
Original line number Diff line number Diff line
@@ -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