Loading core/java/android/view/View.java +24 −10 Original line number Diff line number Diff line Loading @@ -21115,7 +21115,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * should start; when the delay is 0, the animation starts * immediately * * @param invalidate Whether this method should call invalidate * @param invalidate Whether this method should call invalidate if an animation * is scheduled * * @return true if the animation is played, false otherwise * Loading @@ -21141,11 +21142,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, if (isHorizontalScrollBarEnabled() || isVerticalScrollBarEnabled()) { if (invalidate) { // Invalidate to show the scrollbars postInvalidateOnAnimation(); } if (scrollCache.state == ScrollabilityCache.OFF) { // FIXME: this is copied from WindowManagerService. // We should get this value from the system when it Loading @@ -21160,10 +21156,18 @@ public class View implements Drawable.Callback, KeyEvent.Callback, scrollCache.fadeStartTime = fadeStartTime; scrollCache.state = ScrollabilityCache.ON; // Schedule our fader to run, unscheduling any old ones first // Schedule our fader to run if it's not already scheduled if (!scrollCache.fadeScrollBarsScheduled) { if (invalidate) { // Invalidate to show the scrollbars postInvalidateOnAnimation(); } if (mAttachInfo != null) { mAttachInfo.mHandler.removeCallbacks(scrollCache); mAttachInfo.mHandler.postAtTime(scrollCache, fadeStartTime); final Handler handler = mAttachInfo.mHandler; scrollCache.handler = handler; scrollCache.fadeScrollBarsScheduled = true; handler.postAtTime(scrollCache, fadeStartTime); } } return true; Loading Loading @@ -32842,6 +32846,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, public static final int FADING = 2; public boolean fadeScrollBars; public boolean fadeScrollBarsScheduled; public int fadingEdgeLength; public int scrollBarDefaultDelayBeforeFade; Loading Loading @@ -32870,6 +32875,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ public long fadeStartTime; /** * Handler used for scheduling fade animations. */ Handler handler; /** * The current state of the scrollbars: ON, OFF, or FADING Loading Loading @@ -32928,6 +32937,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, public void run() { long now = AnimationUtils.currentAnimationTimeMillis(); if (now >= fadeStartTime) { fadeScrollBarsScheduled = false; handler = null; // the animation fades the scrollbars out by changing // the opacity (alpha) from fully opaque to fully Loading @@ -32948,6 +32959,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, // Kick off the fade animation host.invalidate(true); } else if (handler != null) { // Reschedule the fade animation handler.postAtTime(this, fadeStartTime); } } } Loading
core/java/android/view/View.java +24 −10 Original line number Diff line number Diff line Loading @@ -21115,7 +21115,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * should start; when the delay is 0, the animation starts * immediately * * @param invalidate Whether this method should call invalidate * @param invalidate Whether this method should call invalidate if an animation * is scheduled * * @return true if the animation is played, false otherwise * Loading @@ -21141,11 +21142,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, if (isHorizontalScrollBarEnabled() || isVerticalScrollBarEnabled()) { if (invalidate) { // Invalidate to show the scrollbars postInvalidateOnAnimation(); } if (scrollCache.state == ScrollabilityCache.OFF) { // FIXME: this is copied from WindowManagerService. // We should get this value from the system when it Loading @@ -21160,10 +21156,18 @@ public class View implements Drawable.Callback, KeyEvent.Callback, scrollCache.fadeStartTime = fadeStartTime; scrollCache.state = ScrollabilityCache.ON; // Schedule our fader to run, unscheduling any old ones first // Schedule our fader to run if it's not already scheduled if (!scrollCache.fadeScrollBarsScheduled) { if (invalidate) { // Invalidate to show the scrollbars postInvalidateOnAnimation(); } if (mAttachInfo != null) { mAttachInfo.mHandler.removeCallbacks(scrollCache); mAttachInfo.mHandler.postAtTime(scrollCache, fadeStartTime); final Handler handler = mAttachInfo.mHandler; scrollCache.handler = handler; scrollCache.fadeScrollBarsScheduled = true; handler.postAtTime(scrollCache, fadeStartTime); } } return true; Loading Loading @@ -32842,6 +32846,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, public static final int FADING = 2; public boolean fadeScrollBars; public boolean fadeScrollBarsScheduled; public int fadingEdgeLength; public int scrollBarDefaultDelayBeforeFade; Loading Loading @@ -32870,6 +32875,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ public long fadeStartTime; /** * Handler used for scheduling fade animations. */ Handler handler; /** * The current state of the scrollbars: ON, OFF, or FADING Loading Loading @@ -32928,6 +32937,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, public void run() { long now = AnimationUtils.currentAnimationTimeMillis(); if (now >= fadeStartTime) { fadeScrollBarsScheduled = false; handler = null; // the animation fades the scrollbars out by changing // the opacity (alpha) from fully opaque to fully Loading @@ -32948,6 +32959,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, // Kick off the fade animation host.invalidate(true); } else if (handler != null) { // Reschedule the fade animation handler.postAtTime(this, fadeStartTime); } } }