MmsThumbnailPresenterpublic class MmsThumbnailPresenter extends Presenter
Methods Summary |
---|
public void | onModelChanged(com.android.mms.model.Model model, boolean dataChanged)
// TODO Auto-generated method stub
| public void | present()
SlideModel slide = ((SlideshowModel) mModel).get(0);
if (slide != null) {
presentFirstSlide((SlideViewInterface) mView, slide);
}
| protected void | presentAudioThumbnail(SlideViewInterface view, com.android.mms.model.AudioModel audio)
if (audio.isDrmProtected()) {
showDrmIcon(view, audio.getSrc());
} else {
view.setAudio(audio.getUri(), audio.getSrc(), audio.getExtras());
}
| private void | presentFirstSlide(SlideViewInterface view, com.android.mms.model.SlideModel slide)
view.reset();
if (slide.hasImage()) {
presentImageThumbnail(view, slide.getImage());
} else if (slide.hasVideo()) {
presentVideoThumbnail(view, slide.getVideo());
} else if (slide.hasAudio()) {
presentAudioThumbnail(view, slide.getAudio());
}
| private void | presentImageThumbnail(SlideViewInterface view, com.android.mms.model.ImageModel image)
if (image.isDrmProtected()) {
showDrmIcon(view, image.getSrc());
} else {
view.setImage(image.getSrc(), image.getBitmap());
}
| private void | presentVideoThumbnail(SlideViewInterface view, com.android.mms.model.VideoModel video)
if (video.isDrmProtected()) {
showDrmIcon(view, video.getSrc());
} else {
view.setVideo(video.getSrc(), video.getUri());
}
| private void | showDrmIcon(SlideViewInterface view, java.lang.String name)
Bitmap bitmap = BitmapFactory.decodeResource(
mContext.getResources(), R.drawable.ic_mms_drm_protected);
view.setImage(name, bitmap);
|
|