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

Commit 9f775cab authored by Sebastián Franco's avatar Sebastián Franco Committed by Android (Google) Code Review
Browse files

Merge "Preventing the text on ButtonDropTarget.resizeTextToFit size to go below 0" into tm-qpr-dev

parents f6de6e36 5bf936ac
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -423,14 +423,15 @@ public abstract class ButtonDropTarget extends TextView
        float textSize = Utilities.pxToSp(getTextSize());

        int availableWidth = getMeasuredWidth();
        while (textSize > minSize) {
            if (isTextTruncated(availableWidth)) {
        while (isTextTruncated(availableWidth)) {
            textSize -= step;
            if (textSize < minSize) {
                textSize = minSize;
                setTextSize(textSize);
            } else {
                return textSize;
                break;
            }
            setTextSize(textSize);
        }
        return minSize;
        return textSize;
    }
}