Bug 961749 - Disable tab count animation in editing mode. r=lucasr

This commit is contained in:
Brian Nicholson 2014-01-28 15:19:42 -08:00
parent 7956f180ed
commit 371536ac3a
2 changed files with 15 additions and 1 deletions

View File

@ -638,7 +638,7 @@ public class BrowserToolbar extends GeckoRelativeLayout
}
// Set TabCounter based on visibility
if (isVisible() && ViewHelper.getAlpha(mTabsCounter) != 0) {
if (isVisible() && ViewHelper.getAlpha(mTabsCounter) != 0 && !isEditing()) {
mTabsCounter.setCountWithAnimation(count);
} else {
mTabsCounter.setCount(count);
@ -863,6 +863,10 @@ public class BrowserToolbar extends GeckoRelativeLayout
// in setButtonEnabled().
final float alpha = (enabled ? 1.0f : 0.24f);
if (!enabled) {
mTabsCounter.onEnterEditingMode();
}
mTabs.setEnabled(enabled);
ViewHelper.setAlpha(mTabsCounter, alpha);
mMenu.setEnabled(enabled);

View File

@ -102,6 +102,16 @@ public class TabCounter extends GeckoTextSwitcher
mCount = count;
}
// Alpha animations in editing mode cause action bar corruption on the
// Nexus 7 (bug 961749). As a workaround, skip these animations in editing
// mode.
void onEnterEditingMode() {
final int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
getChildAt(i).clearAnimation();
}
}
private AnimationSet createAnimation(float startAngle, float endAngle,
FadeMode fadeMode,
float zEnd, boolean reverse) {