summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/PagedView.java
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2012-02-14 22:51:29 -0800
committerMichael Jurka <mikejurka@google.com>2012-02-15 20:22:50 -0800
commitbed61d22bdbfcdbe04f92675c7751b83c7a8947c (patch)
tree648c41db7bc49430e839d20b481904e507eb400d /src/com/android/launcher2/PagedView.java
parent3a58b88901f6c504837dc47f01dace6d0bacaed0 (diff)
downloadandroid_packages_apps_Trebuchet-bed61d22bdbfcdbe04f92675c7751b83c7a8947c.tar.gz
android_packages_apps_Trebuchet-bed61d22bdbfcdbe04f92675c7751b83c7a8947c.tar.bz2
android_packages_apps_Trebuchet-bed61d22bdbfcdbe04f92675c7751b83c7a8947c.zip
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
Diffstat (limited to 'src/com/android/launcher2/PagedView.java')
-rw-r--r--src/com/android/launcher2/PagedView.java12
1 files changed, 10 insertions, 2 deletions
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() {