From 966a8c78598bdba1e8993428b5b1eef4d97ae501 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Fri, 26 Mar 2010 15:54:09 -0700 Subject: [PATCH] Fix 2537999: Don't throw exception when SlidingTab has UNSPECIFIED specs This is try to capture the case where we sometimes see UNSPECIFIED MeasureSpec in SlidingTab. It should be OK as long as one of the dimensions is constrained. The log event will give some indication of what's going on when this happens. This also fixes a bug where it was possible to not reset the mAnimating flag in the Phone app. Change-Id: Ibab1c944ec895a7c19d5a18cc67f6e4db716f685 --- core/java/com/android/internal/widget/SlidingTab.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/java/com/android/internal/widget/SlidingTab.java b/core/java/com/android/internal/widget/SlidingTab.java index fd3899887717c..91527290270f3 100644 --- a/core/java/com/android/internal/widget/SlidingTab.java +++ b/core/java/com/android/internal/widget/SlidingTab.java @@ -476,7 +476,9 @@ public class SlidingTab extends ViewGroup { int heightSpecSize = MeasureSpec.getSize(heightMeasureSpec); if (widthSpecMode == MeasureSpec.UNSPECIFIED || heightSpecMode == MeasureSpec.UNSPECIFIED) { - throw new RuntimeException(LOG_TAG + " cannot have UNSPECIFIED dimensions"); + Log.e("SlidingTab", "SlidingTab cannot have UNSPECIFIED MeasureSpec" + +"(wspec=" + widthSpecMode + ", hspec=" + heightSpecMode + ")", + new RuntimeException(LOG_TAG + "stack:")); } mLeftSlider.measure(); @@ -554,6 +556,9 @@ public class SlidingTab extends ViewGroup { public void reset(boolean animate) { mLeftSlider.reset(animate); mRightSlider.reset(animate); + if (!animate) { + mAnimating = false; + } } @Override