summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Cleron <mcleron@google.com>2009-09-29 22:33:22 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2009-09-29 22:33:22 -0700
commit90183823b00ad5ce04948cf03d827a47c82ca445 (patch)
tree38fb820bd4ba1e8af1216b5058f9b36185be658b
parentf1fa1eacaa36c80c2094ba679b8384d9f4541e11 (diff)
parentb4ee8349cc7e64a264335ee2dfecc00980eca07a (diff)
downloadframeworks_base-90183823b00ad5ce04948cf03d827a47c82ca445.zip
frameworks_base-90183823b00ad5ce04948cf03d827a47c82ca445.tar.gz
frameworks_base-90183823b00ad5ce04948cf03d827a47c82ca445.tar.bz2
am b4ee8349: Merge change I290947bb into eclair
Merge commit 'b4ee8349cc7e64a264335ee2dfecc00980eca07a' into eclair-plus-aosp * commit 'b4ee8349cc7e64a264335ee2dfecc00980eca07a': Git sucks
-rw-r--r--api/current.xml15
-rw-r--r--core/java/android/view/View.java50
2 files changed, 62 insertions, 3 deletions
diff --git a/api/current.xml b/api/current.xml
index 4d4a24d..201e20a 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -155345,6 +155345,21 @@
<parameter name="startDelay" type="int">
</parameter>
</method>
+<method name="awakenScrollBars"
+ return="boolean"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="protected"
+>
+<parameter name="startDelay" type="int">
+</parameter>
+<parameter name="invalidate" type="boolean">
+</parameter>
+</method>
<method name="bringToFront"
return="void"
abstract="false"
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index ed32af2..048f857 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -4740,7 +4740,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
*/
protected boolean awakenScrollBars() {
return mScrollCache != null &&
- awakenScrollBars(mScrollCache.scrollBarDefaultDelayBeforeFade);
+ awakenScrollBars(mScrollCache.scrollBarDefaultDelayBeforeFade, true);
}
/**
@@ -4778,6 +4778,48 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
* @see #setVerticalScrollBarEnabled(boolean)
*/
protected boolean awakenScrollBars(int startDelay) {
+ return awakenScrollBars(startDelay, true);
+ }
+
+ /**
+ * <p>
+ * Trigger the scrollbars to draw. When invoked this method starts an
+ * animation to fade the scrollbars out after a fixed delay. If a subclass
+ * provides animated scrolling, the start delay should equal the duration of
+ * the scrolling animation.
+ * </p>
+ *
+ * <p>
+ * 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()}.
+ * </p>
+ *
+ * <p>
+ * This method should be invoked everytime a subclass directly updates the
+ * scroll parameters.
+ * </p>
+ *
+ * @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.