[Android] clear variables for video grid binding

Geoffrey Métais git at videolan.org
Tue Sep 8 10:41:48 CEST 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Sep  8 10:37:05 2015 +0200| [94570c516cb6bdf5fd5e28db9583806efd4af5cd] | committer: Geoffrey Métais

clear variables for video grid binding

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=94570c516cb6bdf5fd5e28db9583806efd4af5cd
---

 vlc-android/res/layout/video_grid_card.xml                       |    1 +
 vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java |    5 +++++
 2 files changed, 6 insertions(+)

diff --git a/vlc-android/res/layout/video_grid_card.xml b/vlc-android/res/layout/video_grid_card.xml
index 5e39555..940ff1d 100644
--- a/vlc-android/res/layout/video_grid_card.xml
+++ b/vlc-android/res/layout/video_grid_card.xml
@@ -130,6 +130,7 @@
                 android:minHeight="2dip"
                 android:max="@{max}"
                 android:progress="@{progress}"
+                android:visibility="@{max == 0 ? View.INVISIBLE : View.VISIBLE}"
                 android:progressDrawable="?attr/gridview_progressbar" />
 
         </RelativeLayout>
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
index b85aaa8..26ee405 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
@@ -219,6 +219,9 @@ public class VideoListAdapter extends ArrayAdapter<MediaWrapper>
         int size = mediaGroup.size();
         String text = getContext().getResources().getQuantityString(R.plurals.videos_quantity, size, size);
         holder.binding.setVariable(BR.resolution, text);
+        holder.binding.setVariable(BR.time, "");
+        holder.binding.setVariable(BR.max, 0);
+        holder.binding.setVariable(BR.progress, 0);
     }
 
     private void fillVideoView(ViewHolder holder, MediaWrapper media) {
@@ -240,6 +243,8 @@ public class VideoListAdapter extends ArrayAdapter<MediaWrapper>
         }
         if (media.getWidth() > 0 && media.getHeight() > 0)
             holder.binding.setVariable(BR.resolution, String.format("%dx%d", media.getWidth(), media.getHeight()));
+        else
+            holder.binding.setVariable(BR.resolution, "");
     }
 
     static class ViewHolder {



More information about the Android mailing list