Fix crash when switching between Apps/Widgets tabs

Bug: 8138894
This commit is contained in:
Michael Jurka
2013-02-07 13:27:06 +01:00
parent b81e22ef4a
commit ee8e99fe3b
4 changed files with 20 additions and 11 deletions
@@ -264,15 +264,19 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
// Animate the transition
ObjectAnimator outAnim = LauncherAnimUtils.ofFloat(mAnimationBuffer, "alpha", 0f);
outAnim.addListener(new AnimatorListenerAdapter() {
private void clearAnimationBuffer() {
mAnimationBuffer.setVisibility(View.GONE);
PagedViewWidget.setRecyclePreviewsWhenDetachedFromWindow(false);
mAnimationBuffer.removeAllViews();
PagedViewWidget.setRecyclePreviewsWhenDetachedFromWindow(true);
}
@Override
public void onAnimationEnd(Animator animation) {
mAnimationBuffer.setVisibility(View.GONE);
mAnimationBuffer.removeAllViews();
clearAnimationBuffer();
}
@Override
public void onAnimationCancel(Animator animation) {
mAnimationBuffer.setVisibility(View.GONE);
mAnimationBuffer.removeAllViews();
clearAnimationBuffer();
}
});
ObjectAnimator inAnim = LauncherAnimUtils.ofFloat(mAppsCustomizePane, "alpha", 1f);