Merge "Flash scroll indicators a bit earlier on transitions"

This commit is contained in:
Michael Jurka
2011-08-08 16:07:32 -07:00
committed by Android (Google) Code Review
3 changed files with 19 additions and 9 deletions
@@ -237,6 +237,9 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
// blip early in the animation
buildLayer();
}
if (!toWorkspace && !LauncherApplication.isScreenLarge()) {
mAppsCustomizePane.showScrollingIndicator(false);
}
}
@Override
@@ -246,7 +249,7 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
}
if (!toWorkspace && !LauncherApplication.isScreenLarge()) {
mAppsCustomizePane.flashScrollingIndicator();
mAppsCustomizePane.hideScrollingIndicator(false);
}
}
}
+2 -1
View File
@@ -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);
}
});
+13 -7
View File
@@ -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);