Search in sources :

Example 1 with RAWImageViewHolder

use of us.koller.cameraroll.adapter.item.viewHolder.RAWImageViewHolder 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;
}
Also used : RAWImage(us.koller.cameraroll.data.models.RAWImage) PhotoViewHolder(us.koller.cameraroll.adapter.item.viewHolder.PhotoViewHolder) VideoViewHolder(us.koller.cameraroll.adapter.item.viewHolder.VideoViewHolder) RAWImageViewHolder(us.koller.cameraroll.adapter.item.viewHolder.RAWImageViewHolder) ViewHolder(us.koller.cameraroll.adapter.item.viewHolder.ViewHolder) GifViewHolder(us.koller.cameraroll.adapter.item.viewHolder.GifViewHolder) Gif(us.koller.cameraroll.data.models.Gif) Video(us.koller.cameraroll.data.models.Video) AlbumItem(us.koller.cameraroll.data.models.AlbumItem) RAWImageViewHolder(us.koller.cameraroll.adapter.item.viewHolder.RAWImageViewHolder) PhotoViewHolder(us.koller.cameraroll.adapter.item.viewHolder.PhotoViewHolder) VideoViewHolder(us.koller.cameraroll.adapter.item.viewHolder.VideoViewHolder) GifViewHolder(us.koller.cameraroll.adapter.item.viewHolder.GifViewHolder) View(android.view.View) NonNull(android.support.annotation.NonNull)

Aggregations

NonNull (android.support.annotation.NonNull)1 View (android.view.View)1 GifViewHolder (us.koller.cameraroll.adapter.item.viewHolder.GifViewHolder)1 PhotoViewHolder (us.koller.cameraroll.adapter.item.viewHolder.PhotoViewHolder)1 RAWImageViewHolder (us.koller.cameraroll.adapter.item.viewHolder.RAWImageViewHolder)1 VideoViewHolder (us.koller.cameraroll.adapter.item.viewHolder.VideoViewHolder)1 ViewHolder (us.koller.cameraroll.adapter.item.viewHolder.ViewHolder)1 AlbumItem (us.koller.cameraroll.data.models.AlbumItem)1 Gif (us.koller.cameraroll.data.models.Gif)1 RAWImage (us.koller.cameraroll.data.models.RAWImage)1 Video (us.koller.cameraroll.data.models.Video)1