Merge "Preventing the text on ButtonDropTarget.resizeTextToFit size to go below 0" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
9f775cab1a
@@ -423,14 +423,15 @@ public abstract class ButtonDropTarget extends TextView
|
||||
float textSize = Utilities.pxToSp(getTextSize());
|
||||
|
||||
int availableWidth = getMeasuredWidth();
|
||||
while (textSize > minSize) {
|
||||
if (isTextTruncated(availableWidth)) {
|
||||
textSize -= step;
|
||||
while (isTextTruncated(availableWidth)) {
|
||||
textSize -= step;
|
||||
if (textSize < minSize) {
|
||||
textSize = minSize;
|
||||
setTextSize(textSize);
|
||||
} else {
|
||||
return textSize;
|
||||
break;
|
||||
}
|
||||
setTextSize(textSize);
|
||||
}
|
||||
return minSize;
|
||||
return textSize;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user