Set top and bottom of lock icon to be global rect.

We no longer set the center when we migrate the lock icon. We can
achieve the same thing by getting the top and bottom of the global rect.

Test: Show ambient indication with flag on and off.
Test: Add a ton of notifications.
Fixes: 294871771
Change-Id: I113f5a3b14b2c48a1b415a03efac47a789a43a79
This commit is contained in:
Aaron Liu
2023-08-07 11:48:06 -07:00
parent ebe33c2c84
commit 116aa758da

View File

@@ -22,6 +22,7 @@ import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
@@ -154,11 +155,16 @@ public class LockIconView extends FrameLayout implements Dumpable {
}
float getLocationTop() {
return mLockIconCenter.y - mRadius;
Rect r = new Rect();
mLockIcon.getGlobalVisibleRect(r);
return r.top;
}
float getLocationBottom() {
return mLockIconCenter.y + mRadius;
Rect r = new Rect();
mLockIcon.getGlobalVisibleRect(r);
return r.bottom;
}
/**