package com.yidianling.uikit.business.session.viewholder;

import com.yidianling.im.R;
import com.yidianling.uikit.business.session.activity.WatchMessagePictureActivity;
import com.yidianling.uikit.business.session.module.list.MessageListPanelEx;
import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter;

import java.util.Timer;
import java.util.TimerTask;

/**
 * Created by zhoujianghua on 2015/8/4.
 */
public class MsgViewHolderPicture extends MsgViewHolderThumbBase {

    public MsgViewHolderPicture(BaseMultiItemFetchLoadAdapter adapter) {
        super(adapter);
    }

    @Override
    protected int getContentResId() {
        return R.layout.im_nim_message_item_picture;
    }

    @Override
    protected void onItemClick() {
        //点击图片时不停止对语音消息的连续播放
        MessageListPanelEx.audioIsStop = false;
        WatchMessagePictureActivity.start(context, message);
        new Timer().schedule(new TimerTask() {
            @Override
            public void run() {
                MessageListPanelEx.audioIsStop = true;
            }
        },300);
    }

    @Override
    protected String thumbFromSourceFile(String path) {
        return path;
    }
}
