use of it.sephiroth.android.library.widget.AdapterView in project Klyph by jonathangerbaud.
the class StreamAlbum method mergeData.
public void mergeData(StreamHolder holder, Stream stream) {
Attachment attachment = stream.getAttachment();
final List<Media> medias = attachment.getMedia();
int n = medias.size();
final ArrayList<String> imageIds = new ArrayList<String>();
for (int i = 0; i < n; i++) {
String pid = medias.get(i).getPhoto().getPid();
if (pid != null && pid.length() > 0) {
imageIds.add(pid);
}
}
PhotoAdapter adapter = new PhotoAdapter(medias, maxHeight);
holder.getStreamAlbum().setAdapter(adapter);
holder.getStreamAlbum().setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> list, View view, int position, long arg3) {
Intent intent = new Intent(view.getContext(), AlbumActivity.class);
intent.putExtra(KlyphBundleExtras.PHOTO_ID, medias.get(position).getPhoto().getPid());
intent.putStringArrayListExtra(KlyphBundleExtras.PHOTO_LIST_ID, imageIds);
view.getContext().startActivity(intent);
}
});
holder.getStreamAlbum().setVisibility(View.VISIBLE);
}
Aggregations