diff options
Diffstat (limited to 'src/com/android/browser/TitleBar.java')
-rw-r--r-- | src/com/android/browser/TitleBar.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/com/android/browser/TitleBar.java b/src/com/android/browser/TitleBar.java index fea9baf..3bdc18b 100644 --- a/src/com/android/browser/TitleBar.java +++ b/src/com/android/browser/TitleBar.java @@ -181,7 +181,7 @@ public class TitleBar extends LinearLayout { * Update the progress, from 0 to 100. */ /* package */ void setProgress(int newProgress) { - if (newProgress == mHorizontalProgress.getMax()) { + if (newProgress >= mHorizontalProgress.getMax()) { mTitle.setCompoundDrawables(null, null, null, null); ((Animatable) mCircularProgress).stop(); mHorizontalProgress.setVisibility(View.INVISIBLE); @@ -191,7 +191,11 @@ public class TitleBar extends LinearLayout { mInLoad = false; } else { mHorizontalProgress.setProgress(newProgress); - if (!mInLoad) { + if (!mInLoad && getWindowToken() != null) { + // checking the window token lets us be sure that we + // are attached to a window before starting the animation, + // preventing a potential race condition + // (fix for bug http://b/2115736) mTitle.setCompoundDrawables(null, null, mCircularProgress, null); ((Animatable) mCircularProgress).start(); |