From 58d7f084afd3d135c3bebeacf1b1a88d3e50fa0b Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Thu, 7 May 2015 11:29:38 -0700 Subject: Fix issue with misaligned glowpad handle If the drawable for the handle changes, a new TargetDrawable is created (without the correct positional parameters). This causes it to be misaligned (e.g. during call waiting). To fix this, simply replace the drawable without creating the TargetDrawable from scratch. This preserves its positionX and positionY variables. Bug: 20860087 Change-Id: I696bddf2d6d92cd8f17a3818367e9c0ac71b4a63 --- .../com/android/incallui/widget/multiwaveview/GlowPadView.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'InCallUI/src/com/android/incallui/widget') diff --git a/InCallUI/src/com/android/incallui/widget/multiwaveview/GlowPadView.java b/InCallUI/src/com/android/incallui/widget/multiwaveview/GlowPadView.java index 812e883c0..4bd27db9c 100644 --- a/InCallUI/src/com/android/incallui/widget/multiwaveview/GlowPadView.java +++ b/InCallUI/src/com/android/incallui/widget/multiwaveview/GlowPadView.java @@ -637,11 +637,15 @@ public class GlowPadView extends View { } /** - * Sets teh handle drawable to the drawable specified by the resource ID. + * Sets the handle drawable to the drawable specified by the resource ID. * @param resourceId */ public void setHandleDrawable(int resourceId) { - mHandleDrawable = new TargetDrawable(getResources(), resourceId, 2); + if (mHandleDrawable != null) { + mHandleDrawable.setDrawable(getResources(), resourceId); + } else { + mHandleDrawable = new TargetDrawable(getResources(), resourceId, 1); + } mHandleDrawable.setState(TargetDrawable.STATE_INACTIVE); } -- cgit v1.2.3