MsgViewHolderJumpToDaoYi.java 1.79 KB
Newer Older
1 2 3 4 5 6 7 8 9
package com.yidianling.im.session.viewholder;

import android.app.Activity;
import android.view.View;
import android.widget.TextView;

import com.ydl.ydlcommon.modular.ModularServiceManager;
import com.yidianling.consultant.api.IConsultantService;
import com.yidianling.im.R;
霍志良 committed
10
import com.yidianling.im.session.extension.CustomAttachmentJumpToDaoYi;
11 12 13 14 15 16 17 18 19 20 21 22
import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter;
import com.yidianling.uikit.business.session.viewholder.MsgViewHolderBase;

/**
 * @author huozhiliang
 * @描述:
 * @Copyright Copyright (c) 2018
 * @Company 壹点灵
 * @date 2020/12/14
 */
public class MsgViewHolderJumpToDaoYi extends MsgViewHolderBase implements View.OnClickListener {
    private TextView jumpToDaoYi;
霍志良 committed
23
    private TextView daoYiDesc;
24 25 26 27 28 29 30 31 32 33 34 35

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

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

    @Override
    protected void inflateContentView() {
霍志良 committed
36
        CustomAttachmentJumpToDaoYi customJumpDaoYi = (CustomAttachmentJumpToDaoYi) message.getAttachment();
37
        jumpToDaoYi=findViewById(R.id.jumpToDaoYi);
霍志良 committed
38
        daoYiDesc=findViewById(R.id.desc);
39
        jumpToDaoYi.setOnClickListener(this);
霍志良 committed
40
        daoYiDesc.setText(customJumpDaoYi.desc);
41 42 43 44 45 46 47 48 49 50 51
    }

    @Override
    protected void bindContentView() {

    }

    @Override
    public void onClick(View v) {
        if (v.getId() == R.id.jumpToDaoYi) {
            /*--跳转导医逻辑
霍志良 committed
52 53
             ---和PHP开发黄启群---沟通过后location传0
             就不会走测评相关的逻辑*/
54 55 56 57
            ModularServiceManager.INSTANCE.provide(IConsultantService.class).jumpConsultAssistant((Activity) context,0);
        }
    }
}