diff options
author | Nicolas Roard <nicolas@android.com> | 2009-09-16 21:50:06 +0100 |
---|---|---|
committer | Nicolas Roard <nicolas@android.com> | 2009-09-16 23:20:27 +0100 |
commit | 1382b490adc3971916ca14978f8bd2d9f5f2a344 (patch) | |
tree | 302805fe74e8a4551a8ff39be190d495ccda4fab /src/com/android/browser/TitleBar.java | |
parent | 06d352c85ef4394062fb77fd627013ae3155922c (diff) | |
download | packages_apps_browser-1382b490adc3971916ca14978f8bd2d9f5f2a344.zip packages_apps_browser-1382b490adc3971916ca14978f8bd2d9f5f2a344.tar.gz packages_apps_browser-1382b490adc3971916ca14978f8bd2d9f5f2a344.tar.bz2 |
Fix for the progress indicator not spinning
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(); |