summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Tracy Zhou <tracyzhou@google.com> 2021-01-09 23:47:19 -0800
committer Tracy Zhou <tracyzhou@google.com> 2021-01-09 23:52:55 -0800
commit74cad9cfb49daa26e76dc00fe8ab8ac28cd199fe (patch)
treed6631c5428f21058f71bf15a97b41b1ae5074dc4
parent8337a179d400e8c24669111185c1b0495cc4b31f (diff)
Fix missing background where multiple KeyButtonViews are rendered in the
same window getLeft(), getRight(), getTop(), getBottom() return coords in the entire window, while drawOval asks for coords in the current view. This is not an issue where only one KeyButtonView is in the layout, but it is when there are more than one. Fixes: 177153730 Test: Manual test with ag/q/topic:"game-dashboard-entry-point" Change-Id: If781eb3cb98a3dfb6e51c431fec7f6ae909ef3a3
-rw-r--r--packages/SystemUI/src/com/android/systemui/navigationbar/buttons/KeyButtonView.java8
1 files changed, 1 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/buttons/KeyButtonView.java b/packages/SystemUI/src/com/android/systemui/navigationbar/buttons/KeyButtonView.java
index 4efe4d85156b..f0e4cce299ee 100644
--- a/packages/SystemUI/src/com/android/systemui/navigationbar/buttons/KeyButtonView.java
+++ b/packages/SystemUI/src/com/android/systemui/navigationbar/buttons/KeyButtonView.java
@@ -461,14 +461,8 @@ public class KeyButtonView extends ImageView implements ButtonInterface {
@Override
public void draw(Canvas canvas) {
if (mHasOvalBg) {
- canvas.save();
- int cx = (getLeft() + getRight()) / 2;
- int cy = (getTop() + getBottom()) / 2;
- canvas.translate(cx, cy);
int d = Math.min(getWidth(), getHeight());
- int r = d / 2;
- canvas.drawOval(-r, -r, r, r, mOvalBgPaint);
- canvas.restore();
+ canvas.drawOval(0, 0, d, d, mOvalBgPaint);
}
super.draw(canvas);
}