Cleaning Utilities.java

> Removing some unused methods
> Moving some specialized methods to corresponding classes
> Removing GridProvider check as it is released

Bug: 257555083
Test: Presubmit
Change-Id: Ib0f8c673d018071d3f4b7d9247e0a35718ab009c
Merged-In: Ib0f8c673d018071d3f4b7d9247e0a35718ab009c
This commit is contained in:
Sunny Goyal
2022-11-04 16:43:42 -07:00
parent 50306445a1
commit 47d4d81b4f
12 changed files with 110 additions and 269 deletions

View File

@@ -607,15 +607,16 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
* Get the icon bounds on the view depending on the layout type.
*/
public void getIconBounds(int iconSize, Rect outBounds) {
Utilities.setRectToViewCenter(this, iconSize, outBounds);
outBounds.set(0, 0, iconSize, iconSize);
if (mLayoutHorizontal) {
int top = (getHeight() - iconSize) / 2;
if (mIsRtl) {
outBounds.offsetTo(getWidth() - iconSize - getPaddingRight(), outBounds.top);
outBounds.offsetTo(getWidth() - iconSize - getPaddingRight(), top);
} else {
outBounds.offsetTo(getPaddingLeft(), outBounds.top);
outBounds.offsetTo(getPaddingLeft(), top);
}
} else {
outBounds.offsetTo(outBounds.left, getPaddingTop());
outBounds.offset((getWidth() - iconSize) / 2, getPaddingTop());
}
}