From e22a8e9d3eafe569fe0f4d284c77af08c6e2fe28 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Fri, 12 Nov 2010 13:40:58 -0800 Subject: Minor fixes to Launcher - Adding checks to prevent multiple onSetAlpha's to be called (especially now that we are using display lists) - Removing an old change to keep artificially make the last page wider - Fixing issue where you could click on an item in the paged view while the page it was on is being faded out Change-Id: I9b194565602b5200c0688da2caec9c3c829b3bb0 --- src/com/android/launcher2/PagedViewIcon.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/com/android/launcher2/PagedViewIcon.java') diff --git a/src/com/android/launcher2/PagedViewIcon.java b/src/com/android/launcher2/PagedViewIcon.java index 50ba8d459..b9b9b377e 100644 --- a/src/com/android/launcher2/PagedViewIcon.java +++ b/src/com/android/launcher2/PagedViewIcon.java @@ -52,7 +52,7 @@ public class PagedViewIcon extends TextView implements Checkable { private Object mIconCacheKey; private PagedViewIconCache mIconCache; - private int mAlpha; + private int mAlpha = -1; private int mHolographicAlpha; private boolean mIsChecked; @@ -162,9 +162,13 @@ public class PagedViewIcon extends TextView implements Checkable { public void setAlpha(float alpha) { final float viewAlpha = sHolographicOutlineHelper.viewAlphaInterpolator(alpha); final float holographicAlpha = sHolographicOutlineHelper.highlightAlphaInterpolator(alpha); - mAlpha = (int) (viewAlpha * 255); - mHolographicAlpha = (int) (holographicAlpha * 255); - super.setAlpha(viewAlpha); + int newViewAlpha = (int) (viewAlpha * 255); + int newHolographicAlpha = (int) (holographicAlpha * 255); + if ((mAlpha != newViewAlpha) || (mHolographicAlpha != newHolographicAlpha)) { + mAlpha = newViewAlpha; + mHolographicAlpha = newHolographicAlpha; + super.setAlpha(viewAlpha); + } } public void invalidateCheckedImage() { -- cgit v1.2.3