Small optimizations for the All Apps transition
- don't set properties in animations if they don't
change
- don't recalculate visible pages on every frame
- don't require scroll indicator to be an
ImageView
Change-Id: I099b29e677da2d0e401f677d47cdb8b5df51224e
diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java
index 8aae809..e27345b 100644
--- a/src/com/android/launcher2/CellLayout.java
+++ b/src/com/android/launcher2/CellLayout.java
@@ -916,8 +916,10 @@
}
public void setBackgroundAlpha(float alpha) {
- mBackgroundAlpha = alpha;
- invalidate();
+ if (mBackgroundAlpha != alpha) {
+ mBackgroundAlpha = alpha;
+ invalidate();
+ }
}
// Need to return true to let the view system know we know how to handle alpha-- this is
@@ -928,6 +930,7 @@
return true;
}
+ @Override
public void setAlpha(float alpha) {
setChildrenAlpha(alpha);
super.setAlpha(alpha);