summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2012-04-12 11:35:58 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-04-12 11:35:58 -0700
commitdecd3039ca71e5340ec01027170941637bf9876e (patch)
treee3d51cff1dd3d4179465f25af7ce3c3b487a07b3 /core
parent2b23adbc33c888a2c9fa22dd2e967227baa27e5c (diff)
parenteb3788907132eec5724bbb78f20711c4ffe35b1b (diff)
downloadframeworks_base-decd3039ca71e5340ec01027170941637bf9876e.zip
frameworks_base-decd3039ca71e5340ec01027170941637bf9876e.tar.gz
frameworks_base-decd3039ca71e5340ec01027170941637bf9876e.tar.bz2
Merge "Don't wait for screen on to finish animations"
Diffstat (limited to 'core')
-rw-r--r--core/java/android/view/View.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 0be7a87..adc6dda 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -9792,7 +9792,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
* @attr ref android.R.styleable#View_scrollbarSize
*/
public int getScrollBarSize() {
- return mScrollCache == null ? ViewConfiguration.getScrollBarSize() :
+ return mScrollCache == null ? ViewConfiguration.get(mContext).getScaledScrollBarSize() :
mScrollCache.scrollBarSize;
}
@@ -12971,6 +12971,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
* background
*/
public void setBackground(Drawable background) {
+ //noinspection deprecation
setBackgroundDrawable(background);
}
@@ -14296,7 +14297,15 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
*/
public void setAnimation(Animation animation) {
mCurrentAnimation = animation;
+
if (animation != null) {
+ // If the screen is off assume the animation start time is now instead of
+ // the next frame we draw. Keeping the START_ON_FIRST_FRAME start time
+ // would cause the animation to start when the screen turns back on
+ if (mAttachInfo != null && !mAttachInfo.mScreenOn &&
+ animation.getStartTime() == Animation.START_ON_FIRST_FRAME) {
+ animation.setStartTime(AnimationUtils.currentAnimationTimeMillis());
+ }
animation.reset();
}
}