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

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

Fix bug #5387832 [UI/Visual] Address of the website is not displayed...

Fix bug #5387832 [UI/Visual] Address of the website is not displayed properly(second line of the address is partly shown)

- finally get ride of VERY_WIDE constant ...
- compute the text width on the fly (we cannot cache it as the paint properties can be changed)

Change-Id: I07a0df15202ad3f61eabf62da9658fc301422be7
parent 9b61778d
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -6081,13 +6081,18 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        int physicalWidth = width;

        if (mHorizontallyScrolling) {
            width = VERY_WIDE;
            width = getTextWidth();
        }

        makeNewLayout(width, physicalWidth, UNKNOWN_BORING, UNKNOWN_BORING,
                      physicalWidth, false);
    }

    private int getTextWidth() {
        final int length = mText.length();
        return (length == 0) ? 0 : (int) (getPaint().measureText(mText, 0, length) + 0.5f);
    }

    @Override
    protected void resetResolvedLayoutDirection() {
        super.resetResolvedLayoutDirection();
@@ -6533,7 +6538,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        int want = width - getCompoundPaddingLeft() - getCompoundPaddingRight();
        int unpaddedWidth = want;

        if (mHorizontallyScrolling) want = VERY_WIDE;
        if (mHorizontallyScrolling) want = getTextWidth();

        int hintWant = want;
        int hintWidth = (mHintLayout == null) ? hintWant : mHintLayout.getWidth();
@@ -11591,9 +11596,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
    private boolean                 mHighlightPathBogus = true;
    private static final RectF      sTempRect = new RectF();

    // XXX should be much larger
    private static final int        VERY_WIDE = 1024*1024;

    private static final int        BLINK = 500;

    private static final int ANIMATED_SCROLL_GAP = 250;