diff options
author | Patrick Dubroy <dubroy@google.com> | 2011-03-10 17:17:23 -0800 |
---|---|---|
committer | Patrick Dubroy <dubroy@google.com> | 2011-03-14 14:50:01 -0700 |
commit | 3499d8c89d6b5989579880bf80df31df46483304 (patch) | |
tree | 0e65923c45702c2ca00295e0a4754c1df6ec32ad /src/com/android/launcher2/CellLayout.java | |
parent | ec4ff67723df00e2641b5d77b486518234217c0b (diff) | |
download | android_packages_apps_Trebuchet-3499d8c89d6b5989579880bf80df31df46483304.tar.gz android_packages_apps_Trebuchet-3499d8c89d6b5989579880bf80df31df46483304.tar.bz2 android_packages_apps_Trebuchet-3499d8c89d6b5989579880bf80df31df46483304.zip |
Fix 4081795: Blue glow gone wild. DO NOT MERGE
Change-Id: I9038ed322811987e69045602f438cdf2bbd946e9
Diffstat (limited to 'src/com/android/launcher2/CellLayout.java')
-rw-r--r-- | src/com/android/launcher2/CellLayout.java | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java index c1c12b5ed..1111c53c7 100644 --- a/src/com/android/launcher2/CellLayout.java +++ b/src/com/android/launcher2/CellLayout.java @@ -113,6 +113,8 @@ public class CellLayout extends ViewGroup { private int mDragOutlineCurrent = 0; private final Paint mDragOutlinePaint = new Paint(); + private BubbleTextView mPressedOrFocusedIcon; + private Drawable mCrosshairsDrawable = null; private InterruptibleInOutAnimator mCrosshairsAnimator = null; private float mCrosshairsVisibility = 0.0f; @@ -267,6 +269,27 @@ public class CellLayout extends ViewGroup { addView(mChildren); } + private void invalidateBubbleTextView(BubbleTextView icon) { + final int padding = icon.getPressedOrFocusedBackgroundPadding(); + invalidate(icon.getLeft() - padding, + icon.getTop() - padding, + icon.getRight() + padding, + icon.getBottom() + padding); + } + + void setPressedOrFocusedIcon(BubbleTextView icon) { + // We draw the pressed or focused BubbleTextView's background in CellLayout because it + // requires an expanded clip rect (due to the glow's blur radius) + BubbleTextView oldIcon = mPressedOrFocusedIcon; + mPressedOrFocusedIcon = icon; + if (oldIcon != null) { + invalidateBubbleTextView(oldIcon); + } + if (mPressedOrFocusedIcon != null) { + invalidateBubbleTextView(mPressedOrFocusedIcon); + } + } + public CellLayoutChildren getChildrenLayout() { if (getChildCount() > 0) { return (CellLayoutChildren) getChildAt(0); @@ -457,6 +480,19 @@ public class CellLayout extends ViewGroup { canvas.drawBitmap(b, p.x, p.y, paint); } } + + // We draw the pressed or focused BubbleTextView's background in CellLayout because it + // requires an expanded clip rect (due to the glow's blur radius) + if (mPressedOrFocusedIcon != null) { + final int padding = mPressedOrFocusedIcon.getPressedOrFocusedBackgroundPadding(); + final Bitmap b = mPressedOrFocusedIcon.getPressedOrFocusedBackground(); + if (b != null) { + canvas.drawBitmap(b, + mPressedOrFocusedIcon.getLeft() - padding, + mPressedOrFocusedIcon.getTop() - padding, + null); + } + } } @Override |