if (!springLoaded) {
mWorkspace.showDockDivider(false);
}
+ mWorkspace.showScrollingIndicator(false);
}
@Override
public void onAnimationEnd(Animator animation) {
if (fromView instanceof LauncherTransitionable) {
((LauncherTransitionable) fromView).onLauncherTransitionEnd(alphaAnim,true);
}
- mWorkspace.flashScrollingIndicator();
+ mWorkspace.hideScrollingIndicator(false);
}
});
// a method that subclasses can override to add behavior
protected void onPageBeginMoving() {
- showScrollingIndicator();
+ showScrollingIndicator(false);
}
// a method that subclasses can override to add behavior
mMaxScrollX = 0;
}
+ updateScrollingIndicatorPosition();
+
setMeasuredDimension(widthSize, heightSize);
}
};
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;
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();
+ }
}
}
private void updateScrollingIndicatorPosition() {
if (!isScrollingIndicatorEnabled()) return;
-
+ if (mScrollIndicator == null) return;
int numPages = getChildCount();
int pageWidth = getMeasuredWidth();
int maxPageWidth = (numPages * getChildWidth(0)) + ((numPages - 1) * mPageSpacing);