[Android] Disable the indeterminate progress bar on pre-ICS devices

Ludovic Fauvet git at videolan.org
Thu Jun 21 19:40:48 CEST 2012


android | branch: master | Ludovic Fauvet <etix at videolan.org> | Thu Jun 21 19:38:24 2012 +0200| [724989c8981f496f406ed8906b9bbf34c49dcfd4] | committer: Ludovic Fauvet

Disable the indeterminate progress bar on pre-ICS devices

There's a bug that prevent the progress bar to be hidden on those
devices. This could be reverted once it has been fixed upstream.

> http://git.videolan.org/gitweb.cgi/android.git/?a=commit;h=724989c8981f496f406ed8906b9bbf34c49dcfd4
---

 vlc-android/src/org/videolan/vlc/gui/MainActivity.java |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
index bee398f..e91db26 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
@@ -27,6 +27,7 @@ import org.videolan.vlc.AudioServiceController;
 import org.videolan.vlc.LibVLC;
 import org.videolan.vlc.MediaLibrary;
 import org.videolan.vlc.R;
+import org.videolan.vlc.Util;
 import org.videolan.vlc.VLCCallbackTask;
 import org.videolan.vlc.gui.audio.AudioBrowserFragment;
 import org.videolan.vlc.gui.video.VideoListFragment;
@@ -93,7 +94,8 @@ public class MainActivity extends SherlockFragmentActivity {
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
-        requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
+        if (Util.isICSOrLater()) /* Bug on pre-ICS, the progress bar is always present */
+            requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
         setContentView(R.layout.main);
 
         super.onCreate(savedInstanceState);



More information about the Android mailing list