mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-28 15:56:49 +00:00
Fix wrong getIconBounds method inside BubbleTextView
Bug: 205065809 Test: screenshot on the bug TL;DR;; created two variants depending on the layout direction Change-Id: I9c5e74409c701b1f219ca450de0dca2291507045
This commit is contained in:
@@ -526,6 +526,18 @@ public final class Utilities {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Using the view's bounds and icon size, calculate where the icon bounds will
|
||||
* be if it was positioned at the center of the view.
|
||||
*/
|
||||
public static void setRectToViewCenter(View iconView, int iconSize, Rect outBounds) {
|
||||
int top = (iconView.getHeight() - iconSize) / 2;
|
||||
int left = (iconView.getWidth() - iconSize) / 2;
|
||||
int right = left + iconSize;
|
||||
int bottom = top + iconSize;
|
||||
outBounds.set(left, top, right, bottom);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that a value is within given bounds. Specifically:
|
||||
* If value is less than lowerBound, return lowerBound; else if value is greater than upperBound,
|
||||
|
||||
Reference in New Issue
Block a user