From bed61d22bdbfcdbe04f92675c7751b83c7a8947c Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Tue, 14 Feb 2012 22:51:29 -0800 Subject: Revert "Revert "Speed up All Apps -> Workspace transition"" - also, undo enabling hardware layers for scroll indicator, which could have caused slowness - fix bug where scroll indicator was not seen after the first visit to all apps - eliminate a some needless hardware layer redraws - making items under All Apps invisible when we're in All Apps - making workspace spaces invisible if their alpha is 0 to prevent more hardware layer rebuilding This reverts commit 9753d13c7bda09c1203c611ac6717021037f39c3. Change-Id: Ib908ae0b456b2d4b8a171991a95f20aea4749da1 --- src/com/android/launcher2/PagedView.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/com/android/launcher2/PagedView.java') diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java index 9a140d288..184ea7a3c 100644 --- a/src/com/android/launcher2/PagedView.java +++ b/src/com/android/launcher2/PagedView.java @@ -176,6 +176,8 @@ public abstract class PagedView extends ViewGroup { private int mScrollIndicatorPaddingLeft; private int mScrollIndicatorPaddingRight; private boolean mHasScrollIndicator = true; + private boolean mShouldShowScrollIndicator = false; + private boolean mShouldShowScrollIndicatorImmediately = false; protected static final int sScrollIndicatorFadeInDuration = 150; protected static final int sScrollIndicatorFadeOutDuration = 650; protected static final int sScrollIndicatorFlashDuration = 650; @@ -767,7 +769,8 @@ public abstract class PagedView extends ViewGroup { for (int i = getChildCount() - 1; i >= 0; i--) { final View v = getPageAt(i); - if (leftScreen <= i && i <= rightScreen) { + if (leftScreen <= i && i <= rightScreen && + v.getAlpha() > ViewConfiguration.ALPHA_THRESHOLD) { v.setVisibility(VISIBLE); drawChild(canvas, v, drawingTime); } else { @@ -1705,9 +1708,12 @@ public abstract class PagedView extends ViewGroup { } protected void showScrollingIndicator(boolean immediately) { + mShouldShowScrollIndicator = true; + mShouldShowScrollIndicatorImmediately = true; if (getChildCount() <= 1) return; if (!isScrollingIndicatorEnabled()) return; + mShouldShowScrollIndicator = false; getScrollingIndicator(); if (mScrollIndicator != null) { // Fade the indicator in @@ -1779,6 +1785,9 @@ public abstract class PagedView extends ViewGroup { if (mScrollIndicator != null) { updateScrollingIndicatorPosition(); } + if (mShouldShowScrollIndicator) { + showScrollingIndicator(mShouldShowScrollIndicatorImmediately); + } } private void updateScrollingIndicatorPosition() { @@ -1805,7 +1814,6 @@ public abstract class PagedView extends ViewGroup { indicatorPos += indicatorCenterOffset; } mScrollIndicator.setTranslationX(indicatorPos); - mScrollIndicator.invalidate(); } public void showScrollIndicatorTrack() { -- cgit v1.2.3