Merge "Preventing the text on ButtonDropTarget.resizeTextToFit size to go below 0" into tm-qpr-dev am: 9f775cab1a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20610916 Change-Id: I636ec04af1eaac8be8793a05e8a44f0bd213afac Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -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