Skip to content

Commit decd303

Browse files
Romain GuyAndroid (Google) Code Review
authored andcommitted
Merge "Don't wait for screen on to finish animations"
2 parents 2b23adb + eb37889 commit decd303

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

core/java/android/view/View.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9792,7 +9792,7 @@ public void setScrollBarFadeDuration(int scrollBarFadeDuration) {
97929792
* @attr ref android.R.styleable#View_scrollbarSize
97939793
*/
97949794
public int getScrollBarSize() {
9795-
return mScrollCache == null ? ViewConfiguration.getScrollBarSize() :
9795+
return mScrollCache == null ? ViewConfiguration.get(mContext).getScaledScrollBarSize() :
97969796
mScrollCache.scrollBarSize;
97979797
}
97989798

@@ -12971,6 +12971,7 @@ public void setBackgroundResource(int resid) {
1297112971
* background
1297212972
*/
1297312973
public void setBackground(Drawable background) {
12974+
//noinspection deprecation
1297412975
setBackgroundDrawable(background);
1297512976
}
1297612977

@@ -14296,7 +14297,15 @@ public void clearAnimation() {
1429614297
*/
1429714298
public void setAnimation(Animation animation) {
1429814299
mCurrentAnimation = animation;
14300+
1429914301
if (animation != null) {
14302+
// If the screen is off assume the animation start time is now instead of
14303+
// the next frame we draw. Keeping the START_ON_FIRST_FRAME start time
14304+
// would cause the animation to start when the screen turns back on
14305+
if (mAttachInfo != null && !mAttachInfo.mScreenOn &&
14306+
animation.getStartTime() == Animation.START_ON_FIRST_FRAME) {
14307+
animation.setStartTime(AnimationUtils.currentAnimationTimeMillis());
14308+
}
1430014309
animation.reset();
1430114310
}
1430214311
}

0 commit comments

Comments
 (0)