[Android] Audio player: use the holder to save the references to the playlist item views
Adrien Maglo
git at videolan.org
Fri Jan 24 17:31:01 CET 2014
vlc-ports/android | branch: master | Adrien Maglo <magsoft at videolan.org> | Fri Jan 24 17:14:06 2014 +0100| [5f17b50c6d4663cebc702d5f9f5ee1e88f2f385e] | committer: Adrien Maglo
Audio player: use the holder to save the references to the playlist item views
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=5f17b50c6d4663cebc702d5f9f5ee1e88f2f385e
---
.../org/videolan/vlc/gui/audio/AudioListAdapter.java | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioListAdapter.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioListAdapter.java
index c082f83..5d190fe 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioListAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioListAdapter.java
@@ -82,16 +82,16 @@ public class AudioListAdapter extends ArrayAdapter<Media> {
holder.title = (TextView) v.findViewById(R.id.title);
holder.artist = (TextView) v.findViewById(R.id.artist);
holder.moveButton = (ImageButton) v.findViewById(R.id.move);
+ holder.expansion = (LinearLayout)v.findViewById(R.id.item_expansion);
+ holder.layoutItem = (LinearLayout)v.findViewById(R.id.layout_item);
+ holder.layoutFooter = (View)v.findViewById(R.id.layout_footer);
v.setTag(holder);
} else
holder = (ViewHolder) v.getTag();
- LinearLayout expansion = (LinearLayout)v.findViewById(R.id.item_expansion);
- LinearLayout layout_item = (LinearLayout)v.findViewById(R.id.layout_item);
- View layout_footer = (View)v.findViewById(R.id.layout_footer);
- expansion.setVisibility(LinearLayout.GONE);
- layout_item.setVisibility(LinearLayout.VISIBLE);
- layout_footer.setVisibility(LinearLayout.VISIBLE);
+ holder.expansion.setVisibility(LinearLayout.GONE);
+ holder.layoutItem.setVisibility(LinearLayout.VISIBLE);
+ holder.layoutFooter.setVisibility(LinearLayout.VISIBLE);
Media media = getItem(position);
final String title = media.getTitle();
@@ -143,5 +143,8 @@ public class AudioListAdapter extends ArrayAdapter<Media> {
TextView title;
TextView artist;
ImageButton moveButton;
+ LinearLayout expansion;
+ LinearLayout layoutItem;
+ View layoutFooter;
}
}
More information about the Android
mailing list