FileDocCategorySizeDatePackage
MmsThumbnailPresenter.javaAPI DocAndroid 1.5 API3100Wed May 06 22:42:46 BST 2009com.android.mms.ui

MmsThumbnailPresenter

public class MmsThumbnailPresenter extends Presenter

Fields Summary
Constructors Summary
public MmsThumbnailPresenter(android.content.Context context, ViewInterface view, com.android.mms.model.Model model)

        super(context, view, model);
    
Methods Summary
public voidonModelChanged(com.android.mms.model.Model model, boolean dataChanged)

        // TODO Auto-generated method stub
    
public voidpresent()

        SlideModel slide = ((SlideshowModel) mModel).get(0);
        if (slide != null) {
            presentFirstSlide((SlideViewInterface) mView, slide);
        }
    
protected voidpresentAudioThumbnail(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 voidpresentFirstSlide(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 voidpresentImageThumbnail(SlideViewInterface view, com.android.mms.model.ImageModel image)

        if (image.isDrmProtected()) {
            showDrmIcon(view, image.getSrc());
        } else {
            view.setImage(image.getSrc(), image.getBitmap());
        }
    
private voidpresentVideoThumbnail(SlideViewInterface view, com.android.mms.model.VideoModel video)

        if (video.isDrmProtected()) {
            showDrmIcon(view, video.getSrc());
        } else {
            view.setVideo(video.getSrc(), video.getUri());
        }
    
private voidshowDrmIcon(SlideViewInterface view, java.lang.String name)

        Bitmap bitmap = BitmapFactory.decodeResource(
                mContext.getResources(), R.drawable.ic_mms_drm_protected);
        view.setImage(name, bitmap);