From 290947bbf830a1ea335b01bcd8155c699b6713ca Mon Sep 17 00:00:00 2001
From: Mike Cleron
+ * The animation starts only if at least one of the scrollbars is enabled, + * as specified by {@link #isHorizontalScrollBarEnabled()} and + * {@link #isVerticalScrollBarEnabled()}. When the animation is started, + * this method returns true, and false otherwise. If the animation is + * started, this method calls {@link #invalidate()} if the invalidate parameter + * is set to true; in that case the caller + * should not call {@link #invalidate()}. + *
+ * + *+ * This method should be invoked everytime a subclass directly updates the + * scroll parameters. + *
+ * + * @param startDelay the delay, in milliseconds, after which the animation + * should start; when the delay is 0, the animation starts + * immediately + * + * @param invalidate Wheter this method should call invalidate + * + * @return true if the animation is played, false otherwise + * + * @see #scrollBy(int, int) + * @see #scrollTo(int, int) + * @see #isHorizontalScrollBarEnabled() + * @see #isVerticalScrollBarEnabled() + * @see #setHorizontalScrollBarEnabled(boolean) + * @see #setVerticalScrollBarEnabled(boolean) + */ + protected boolean awakenScrollBars(int startDelay, boolean invalidate) { final ScrollabilityCache scrollCache = mScrollCache; if (scrollCache == null || !scrollCache.fadeScrollBars) { @@ -4790,8 +4832,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility if (isHorizontalScrollBarEnabled() || isVerticalScrollBarEnabled()) { - // Invalidate to show the scrollbars - invalidate(); + if (invalidate) { + // Invalidate to show the scrollbars + invalidate(); + } if (scrollCache.state == ScrollabilityCache.OFF) { // FIXME: this is copied from WindowManagerService.