Search in sources :

Example 1 with ThumbnailView

use of org.thoughtcrime.securesms.components.ThumbnailView in project Signal-Android by WhisperSystems.

the class MediaAdapter method onBindItemViewHolder.

@Override
public void onBindItemViewHolder(final ViewHolder viewHolder, @NonNull final Cursor cursor) {
    final ThumbnailView imageView = viewHolder.imageView;
    final MediaRecord mediaRecord = MediaRecord.from(cursor);
    Slide slide = MediaUtil.getSlideForAttachment(getContext(), mediaRecord.getAttachment());
    if (slide != null) {
        imageView.setImageResource(masterSecret, slide, false);
    }
    imageView.setOnClickListener(new OnMediaClickListener(mediaRecord));
}
Also used : MediaRecord(org.thoughtcrime.securesms.database.MediaDatabase.MediaRecord) Slide(org.thoughtcrime.securesms.mms.Slide) ThumbnailView(org.thoughtcrime.securesms.components.ThumbnailView)

Aggregations

ThumbnailView (org.thoughtcrime.securesms.components.ThumbnailView)1 MediaRecord (org.thoughtcrime.securesms.database.MediaDatabase.MediaRecord)1 Slide (org.thoughtcrime.securesms.mms.Slide)1