diff options
author | Yorke Lee <yorkelee@google.com> | 2015-05-07 11:29:38 -0700 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2015-05-07 11:51:31 -0700 |
commit | ba924736333be480e7956aaf555f75b562ad0175 (patch) | |
tree | 5cc474701de14093a82e5850b9cbbd01b23f7639 | |
parent | f2f2d2d1c1e325272738bad429dc0c1000d82f35 (diff) |
DO NOT MERGE 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
-rw-r--r-- | InCallUI/src/com/android/incallui/widget/multiwaveview/GlowPadView.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/InCallUI/src/com/android/incallui/widget/multiwaveview/GlowPadView.java b/InCallUI/src/com/android/incallui/widget/multiwaveview/GlowPadView.java index fe008f3df..a250f6703 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); } |