[Android] Video item: All fields must be set because views are recycled
Sébastien Toque
git at videolan.org
Sun Apr 26 23:41:33 CEST 2015
vlc-ports/android | branch: master | Sébastien Toque <xilasz at gmail.com> | Sun Apr 26 23:41:25 2015 +0200| [211d56dca3d4aba18ccf56e09db96d767f80d731] | committer: Sébastien Toque
Video item: All fields must be set because views are recycled
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=211d56dca3d4aba18ccf56e09db96d767f80d731
---
vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java | 3 +++
1 file changed, 3 insertions(+)
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 bc2f024..a415f87 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
@@ -234,6 +234,7 @@ public class VideoListAdapter extends ArrayAdapter<MediaWrapper>
int size = mediaGroup.size();
String text = getContext().getResources().getQuantityString(R.plurals.videos_quantity, size, size);
+ holder.time.setText("");
holder.resolution.setText(text);
holder.title.setText(media.getTitle() + "\u2026"); // ellipsis
holder.more.setVisibility(View.GONE);
@@ -262,6 +263,8 @@ public class VideoListAdapter extends ArrayAdapter<MediaWrapper>
holder.progress.setVisibility(View.INVISIBLE);
if (media.getWidth() > 0 && media.getHeight() > 0)
holder.resolution.setText(String.format("%dx%d", media.getWidth(), media.getHeight()));
+ else
+ holder.resolution.setText("");
holder.title.setText(media.getTitle());
holder.more.setVisibility(View.VISIBLE);
}
More information about the Android
mailing list