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
diff --git a/src/com/android/launcher2/PagedViewIcon.java b/src/com/android/launcher2/PagedViewIcon.java
index 50ba8d4..b9b9b37 100644
--- a/src/com/android/launcher2/PagedViewIcon.java
+++ b/src/com/android/launcher2/PagedViewIcon.java
@@ -52,7 +52,7 @@
private Object mIconCacheKey;
private PagedViewIconCache mIconCache;
- private int mAlpha;
+ private int mAlpha = -1;
private int mHolographicAlpha;
private boolean mIsChecked;
@@ -162,9 +162,13 @@
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() {