Skip to content

Commit 9caeb14

Browse files
author
George Mount
committed
Fix stack overflow during animation of action bar.
Bug 6366482 The animation engine now notifies onAnimationStart() and onAnimationEnd() even when it does no action. This CL prevents the setVisiblity call from causing an infinite loop of triggering animation notifications. Change-Id: I009217a42debf1a1495da222199ca8f599fa7bcf
1 parent 5b086eb commit 9caeb14

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

core/java/com/android/internal/widget/AbsActionBarView.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,12 @@ public void animateToVisibility(int visibility) {
161161

162162
@Override
163163
public void setVisibility(int visibility) {
164-
if (mVisibilityAnim != null) {
165-
mVisibilityAnim.end();
164+
if (visibility != getVisibility()) {
165+
if (mVisibilityAnim != null) {
166+
mVisibilityAnim.end();
167+
}
168+
super.setVisibility(visibility);
166169
}
167-
super.setVisibility(visibility);
168170
}
169171

170172
public boolean showOverflowMenu() {

0 commit comments

Comments
 (0)