[Android] Hide progress in media info once finished

Geoffrey Métais git at videolan.org
Wed Mar 30 19:19:48 CEST 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Mar 30 19:18:24 2016 +0200| [df1a8b9c33e24aa77e2b88c97eb481e138894749] | committer: Geoffrey Métais

Hide progress in media info once finished

> https://code.videolan.org/videolan/vlc-android/commit/df1a8b9c33e24aa77e2b88c97eb481e138894749
---

 vlc-android/res/layout-land/media_info.xml                   |  1 +
 vlc-android/res/layout/media_info.xml                        |  1 +
 .../src/org/videolan/vlc/gui/video/MediaInfoFragment.java    | 12 +++++++-----
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/vlc-android/res/layout-land/media_info.xml b/vlc-android/res/layout-land/media_info.xml
index 50709dd..7ef37f7 100644
--- a/vlc-android/res/layout-land/media_info.xml
+++ b/vlc-android/res/layout-land/media_info.xml
@@ -24,6 +24,7 @@
                 android:layout_alignParentTop="true">
 
                 <ProgressBar
+                    android:id="@+id/image_progress"
                     style="?android:attr/progressBarStyleLarge"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
diff --git a/vlc-android/res/layout/media_info.xml b/vlc-android/res/layout/media_info.xml
index c96cbf7..19553a2 100644
--- a/vlc-android/res/layout/media_info.xml
+++ b/vlc-android/res/layout/media_info.xml
@@ -19,6 +19,7 @@
                 android:layout_height="wrap_content" >
 
                 <ProgressBar
+                    android:id="@+id/image_progress"
                     style="?android:attr/progressBarStyleLarge"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java b/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java
index d7ad629..3201acb 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java
@@ -72,6 +72,7 @@ public class MediaInfoFragment extends ListFragment {
     private TextView mLengthView;
     private TextView mSizeView;
     private TextView mPathView;
+    private View mProgress;
     private FloatingActionButton mPlayButton;
     private ImageButton mDelete;
     private ImageView mSubtitles;
@@ -102,6 +103,7 @@ public class MediaInfoFragment extends ListFragment {
         mPlayButton = (FloatingActionButton) v.findViewById(R.id.play);
         mDelete = (ImageButton) v.findViewById(R.id.info_delete);
         mSubtitles = (ImageView) v.findViewById(R.id.info_subtitles);
+        mProgress = v.findViewById(R.id.image_progress);
         mPlayButton.setOnClickListener(new OnClickListener() {
             @Override
             public void onClick(View v) {
@@ -267,8 +269,6 @@ public class MediaInfoFragment extends ListFragment {
                 mImage = BitmapUtil.cropBorders(mImage, width, height);
             } else if (mItem.getType() == MediaWrapper.TYPE_AUDIO) {
                 mImage = AudioUtil.getCover(getActivity(), mItem, width);
-                if (mImage == null)
-                    return;
             } else
                 return;
 
@@ -283,6 +283,9 @@ public class MediaInfoFragment extends ListFragment {
     private void updateImage() {
         if (getView() == null)
             return;
+        mProgress.setVisibility(View.GONE);
+        if (mImage == null)
+            return;
         ImageView imageView = (ImageView) getView().findViewById(R.id.image);
         imageView.setImageBitmap(mImage);
         ViewGroup.LayoutParams lp = imageView.getLayoutParams();
@@ -361,8 +364,7 @@ public class MediaInfoFragment extends ListFragment {
                     fragment.mSubtitles.setVisibility(View.VISIBLE);
                     break;
             }
-        };
-
-    };
+        }
+    }
 
 }



More information about the Android mailing list