use of us.koller.cameraroll.data.models.RAWImage in project Camera-Roll-Android-App by kollerlukas.
the class ItemAdapter method instantiateItem.
@NonNull
@Override
public Object instantiateItem(@NonNull final ViewGroup container, int position) {
AlbumItem albumItem = album.getAlbumItems().get(position);
ViewHolder viewHolder;
if (albumItem instanceof Video) {
viewHolder = new VideoViewHolder(albumItem, position);
} else if (albumItem instanceof Gif) {
viewHolder = new GifViewHolder(albumItem, position);
} else if (albumItem instanceof RAWImage) {
viewHolder = new RAWImageViewHolder(albumItem, position);
} else {
viewHolder = new PhotoViewHolder(albumItem, position);
}
viewHolders.add(viewHolder);
View v = viewHolder.getView(container);
container.addView(v);
if (callback != null) {
boolean b = callback.onInstantiateItem(viewHolder);
if (!b) {
callback = null;
}
}
return v;
}
Aggregations