diff options
author | Winson Chung <winsonc@google.com> | 2010-08-17 14:28:06 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2010-08-17 14:28:06 -0700 |
commit | 6935ffd45069d1f514509e7bc403514686762148 (patch) | |
tree | 37787309a7f2f1a53e5cce19d78a89067a388e35 | |
parent | b2c838c2ebe8c05a5c031e6b202cb192f238ac38 (diff) | |
download | packages_apps_trebuchet-6935ffd45069d1f514509e7bc403514686762148.zip packages_apps_trebuchet-6935ffd45069d1f514509e7bc403514686762148.tar.gz packages_apps_trebuchet-6935ffd45069d1f514509e7bc403514686762148.tar.bz2 |
Adding check before setting alpha of side pages in a PagedView to prevent constant invalidations.
Change-Id: I4fbb66a851d6cbcd916212e86ed8ba85a9226b02
-rw-r--r-- | src/com/android/launcher2/PagedView.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java index 0e8ffa0..289a48d 100644 --- a/src/com/android/launcher2/PagedView.java +++ b/src/com/android/launcher2/PagedView.java @@ -271,7 +271,9 @@ public abstract class PagedView extends ViewGroup { dimAlpha = (float) (distanceFromScreenCenter - halfChildWidth) / halfChildWidth; dimAlpha = (dimAlpha * dimAlpha); } - layout.setDimmedBitmapAlpha(Math.max(0.0f, Math.min(1.0f, dimAlpha))); + dimAlpha = Math.max(0.0f, Math.min(1.0f, dimAlpha)); + if (Float.compare(dimAlpha, layout.getDimmedBitmapAlpha()) != 0) + layout.setDimmedBitmapAlpha(dimAlpha); } } super.dispatchDraw(canvas); |