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

Commit dcb33f16 authored by Siyamed Sinir's avatar Siyamed Sinir
Browse files

Fix maxLines/lines properties for BoringLayout

Line height calculation with maxLines set to zero displayed a single
line when BoringLayout was used. This CL fixes it to show zero lines.

Test: Added related CTS tests to TextViewTest and EditTextText
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: bit CtsWidgetTestCases:android.widget.cts.EditTextTest

Bug: 65435738
Change-Id: Ic21eb50b31666b2dcc2398278010fa072ea1ff67
parent 4562eceb
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -8409,7 +8409,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener

        if (mMaxMode != LINES) {
            desired = Math.min(desired, mMaximum);
        } else if (cap && linecount > mMaximum && layout instanceof DynamicLayout) {
        } else if (cap && linecount > mMaximum && (layout instanceof DynamicLayout
                || layout instanceof BoringLayout)) {
            desired = layout.getLineTop(mMaximum);

            if (dr != null) {