use of com.moez.QKSMS.model.MediaModel in project qksms by moezbhatti.
the class MessageUtils method viewSimpleSlideshow.
public static void viewSimpleSlideshow(Context context, SlideshowModel slideshow) {
if (!slideshow.isSimple()) {
throw new IllegalArgumentException("viewSimpleSlideshow() called on a non-simple slideshow");
}
SlideModel slide = slideshow.get(0);
MediaModel mm = null;
if (slide.hasImage()) {
mm = slide.getImage();
} else if (slide.hasVideo()) {
mm = slide.getVideo();
}
if (mm == null) {
return;
}
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
// So we don't see "surrounding" images in Gallery
intent.putExtra("SingleItemOnly", true);
String contentType;
contentType = mm.getContentType();
intent.setDataAndType(mm.getUri(), contentType);
context.startActivity(intent);
}
Aggregations