package com.yidianling.im.session.action;

import com.yidianling.im.R;
import com.yidianling.nimbase.business.session.actions.BaseAction;
import com.yidianling.uikit.business.session.activity.YDLP2PMessageActivity;
import com.yidianling.uikit.custom.bridge.ActionHandlerStorage;

/**
 * 发送红包action
 * Created by xj on 2019/7/4.
 */

public class RedPacketAction extends BaseAction {

    public RedPacketAction() {
        super(R.drawable.im_btn_redpacket_action_icn, R.string.im_input_redpacket_action_text);
    }

    @Override
    public void onClick() {
        //发送红包
        if (ActionHandlerStorage.getL(((YDLP2PMessageActivity) getActivity()).getYDLMessageFragment().getInputPanel().getContainer().account) != null) {
            ActionHandlerStorage.getL(((YDLP2PMessageActivity) getActivity()).getYDLMessageFragment().getInputPanel().getContainer().account).sendRedPacket(getActivity());
        }
    }
}
