summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2011-08-08 15:52:14 -0700
committerMichael Jurka <mikejurka@google.com>2011-08-08 15:52:14 -0700
commit430e8a5f5b06181addfd37223518fc21c5c41b69 (patch)
tree4568e96d4374b018576da0a32f7f7580ba0c4df5 /src
parentc29c8462b1f56558a4e357975fa7463e66bce47e (diff)
downloadandroid_packages_apps_Trebuchet-430e8a5f5b06181addfd37223518fc21c5c41b69.tar.gz
android_packages_apps_Trebuchet-430e8a5f5b06181addfd37223518fc21c5c41b69.tar.bz2
android_packages_apps_Trebuchet-430e8a5f5b06181addfd37223518fc21c5c41b69.zip
Flash scroll indicators a bit earlier on transitions
Change-Id: I456b61480299b1177d9d275f2cb4459bab02d63e
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher2/AppsCustomizeTabHost.java5
-rw-r--r--src/com/android/launcher2/Launcher.java3
-rw-r--r--src/com/android/launcher2/PagedView.java20
3 files changed, 19 insertions, 9 deletions
diff --git a/src/com/android/launcher2/AppsCustomizeTabHost.java b/src/com/android/launcher2/AppsCustomizeTabHost.java
index 2f5cc4074..cd60cda21 100644
--- a/src/com/android/launcher2/AppsCustomizeTabHost.java
+++ b/src/com/android/launcher2/AppsCustomizeTabHost.java
@@ -238,6 +238,9 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
// blip early in the animation
buildLayer();
}
+ if (!toWorkspace && !LauncherApplication.isScreenLarge()) {
+ mAppsCustomizePane.showScrollingIndicator(false);
+ }
}
@Override
@@ -247,7 +250,7 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
}
if (!toWorkspace && !LauncherApplication.isScreenLarge()) {
- mAppsCustomizePane.flashScrollingIndicator();
+ mAppsCustomizePane.hideScrollingIndicator(false);
}
}
}
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index bb7bdf53d..1b105d23a 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -2119,6 +2119,7 @@ public final class Launcher extends Activity
if (!springLoaded) {
mWorkspace.showDockDivider(false);
}
+ mWorkspace.showScrollingIndicator(false);
}
@Override
public void onAnimationEnd(Animator animation) {
@@ -2126,7 +2127,7 @@ public final class Launcher extends Activity
if (fromView instanceof LauncherTransitionable) {
((LauncherTransitionable) fromView).onLauncherTransitionEnd(alphaAnim,true);
}
- mWorkspace.flashScrollingIndicator();
+ mWorkspace.hideScrollingIndicator(false);
}
});
diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java
index 24feb4148..0321e3f1c 100644
--- a/src/com/android/launcher2/PagedView.java
+++ b/src/com/android/launcher2/PagedView.java
@@ -323,7 +323,7 @@ public abstract class PagedView extends ViewGroup {
// a method that subclasses can override to add behavior
protected void onPageBeginMoving() {
- showScrollingIndicator();
+ showScrollingIndicator(false);
}
// a method that subclasses can override to add behavior
@@ -478,6 +478,8 @@ public abstract class PagedView extends ViewGroup {
mMaxScrollX = 0;
}
+ updateScrollingIndicatorPosition();
+
setMeasuredDimension(widthSize, heightSize);
}
@@ -1685,11 +1687,11 @@ public abstract class PagedView extends ViewGroup {
};
protected void flashScrollingIndicator() {
removeCallbacks(hideScrollingIndicatorRunnable);
- showScrollingIndicator();
+ showScrollingIndicator(false);
postDelayed(hideScrollingIndicatorRunnable, sScrollIndicatorFlashDuration);
}
- protected void showScrollingIndicator() {
+ protected void showScrollingIndicator(boolean immediately) {
if (getChildCount() <= 1) return;
if (!isScrollingIndicatorEnabled()) return;
@@ -1701,9 +1703,13 @@ public abstract class PagedView extends ViewGroup {
if (mScrollIndicatorAnimator != null) {
mScrollIndicatorAnimator.cancel();
}
- mScrollIndicatorAnimator = ObjectAnimator.ofFloat(mScrollIndicator, "alpha", 1f);
- mScrollIndicatorAnimator.setDuration(sScrollIndicatorFadeInDuration);
- mScrollIndicatorAnimator.start();
+ if (immediately) {
+ mScrollIndicator.setAlpha(1f);
+ } else {
+ mScrollIndicatorAnimator = ObjectAnimator.ofFloat(mScrollIndicator, "alpha", 1f);
+ mScrollIndicatorAnimator.setDuration(sScrollIndicatorFadeInDuration);
+ mScrollIndicatorAnimator.start();
+ }
}
}
@@ -1762,7 +1768,7 @@ public abstract class PagedView extends ViewGroup {
private void updateScrollingIndicatorPosition() {
if (!isScrollingIndicatorEnabled()) return;
-
+ if (mScrollIndicator == null) return;
int numPages = getChildCount();
int pageWidth = getMeasuredWidth();
int maxPageWidth = (numPages * getChildWidth(0)) + ((numPages - 1) * mPageSpacing);