柬埔寨通 v6.1.5版本的 MD5 值为:9b68581ac30883219d6a25858a099d6b

以下内容为反编译后的 MagSocketChatActivity.java 源代码,内容仅作参考


package net.duohuo.magappx.chat.activity;

import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;
import butterknife.internal.Utils;
import com.alibaba.fastjson.JSONArray;
import com.facebook.drawee.view.SimpleDraweeView;
import com.jianpuzhaitong.forum.R;
import com.tencent.liteav.TXLiteAVCode;
import java.io.File;
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.List;
import net.duohuo.core.annotation.Extra;
import net.duohuo.core.fresco.FrescoImageView;
import net.duohuo.core.util.IUtil;
import net.duohuo.core.util.ImageUtil;
import net.duohuo.core.util.PhotoUtil;
import net.duohuo.magapp.chat.MagappChatCore;
import net.duohuo.magapp.chat.bean.AtMessage;
import net.duohuo.magapp.chat.contact.bean.Contact;
import net.duohuo.magapp.chat.conversation.MagappChatConversation;
import net.duohuo.magapp.chat.conversation.MagappGroupConversation;
import net.duohuo.magapp.chat.message.model.MagImageMessage;
import net.duohuo.magapp.chat.message.model.MagSystemMessage;
import net.duohuo.magapp.chat.message.model.MagVideoMessage;
import net.duohuo.magapp.chat.message.model.MagappCardMessage;
import net.duohuo.magapp.chat.message.model.MagappLocationMessage;
import net.duohuo.magapp.chat.message.model.MagappMessage;
import net.duohuo.magapp.chat.message.model.MagappRedPacketMessage;
import net.duohuo.magapp.chat.message.model.MagappShareMessage;
import net.duohuo.magapp.chat.message.model.MagappTextMessage;
import net.duohuo.magapp.chat.view.MagChatListView;
import net.duohuo.magappx.chat.util.FrescoUtils;
import net.duohuo.magappx.common.base.MagBaseActivity;
import net.duohuo.magappx.common.comp.picpick.PicPickAlbumActivity;
import net.duohuo.magappx.common.util.FrescoResizeUtil;
import net.duohuo.magappx.video.videoplay.VideoPicActivity;

@Deprecated
public class MagSocketChatActivity extends MagBaseActivity {
    ChatAdapter adapter;
    MagappChatConversation conversation;

    @Extra(def = "1")
    String conversationtype;

    @Extra
    String convsersationid;

    @BindView(R.id.et_input)
    EditText etInputV;

    @BindView(R.id.listview)
    MagChatListView listV;

    public class RedPacketNoticeHolder_ViewBinding implements Unbinder {
        private RedPacketNoticeHolder target;

        public RedPacketNoticeHolder_ViewBinding(RedPacketNoticeHolder redPacketNoticeHolder, View view) {
            this.target = redPacketNoticeHolder;
            redPacketNoticeHolder.chatRedPacketNoticeTv = (TextView) Utils.findRequiredViewAsType(view, R.id.chat_red_packet_notice_tv, "field 'chatRedPacketNoticeTv'", TextView.class);
            redPacketNoticeHolder.chatRedPacket = (LinearLayout) Utils.findRequiredViewAsType(view, R.id.chat_red_packet, "field 'chatRedPacket'", LinearLayout.class);
        }

        @Override
        public void unbind() {
            RedPacketNoticeHolder redPacketNoticeHolder = this.target;
            if (redPacketNoticeHolder == null) {
                throw new IllegalStateException("Bindings already cleared.");
            }
            this.target = null;
            redPacketNoticeHolder.chatRedPacketNoticeTv = null;
            redPacketNoticeHolder.chatRedPacket = null;
        }
    }

    public class RedPacketHolder_ViewBinding implements Unbinder {
        private RedPacketHolder target;

        public RedPacketHolder_ViewBinding(RedPacketHolder redPacketHolder, View view) {
            this.target = redPacketHolder;
            redPacketHolder.chatTimeTv = (TextView) Utils.findRequiredViewAsType(view, R.id.chat_time_tv, "field 'chatTimeTv'", TextView.class);
            redPacketHolder.chatTime = (LinearLayout) Utils.findRequiredViewAsType(view, R.id.chat_time, "field 'chatTime'", LinearLayout.class);
            redPacketHolder.chatAvatarOther = (SimpleDraweeView) Utils.findRequiredViewAsType(view, R.id.chat_avatar_other, "field 'chatAvatarOther'", SimpleDraweeView.class);
            redPacketHolder.chatOtherName = (TextView) Utils.findRequiredViewAsType(view, R.id.chat_other_name, "field 'chatOtherName'", TextView.class);
            redPacketHolder.chatRedPacketTitleOther = (TextView) Utils.findRequiredViewAsType(view, R.id.chat_red_packet_title_other, "field 'chatRedPacketTitleOther'", TextView.class);
            redPacketHolder.chatRedPacketTypeOther = (TextView) Utils.findRequiredViewAsType(view, R.id.chat_red_packet_type_other, "field 'chatRedPacketTypeOther'", TextView.class);
            redPacketHolder.chatLlOther = (LinearLayout) Utils.findRequiredViewAsType(view, R.id.chat_ll_other, "field 'chatLlOther'", LinearLayout.class);
            redPacketHolder.chatRedPacketOtherLl = (LinearLayout) Utils.findRequiredViewAsType(view, R.id.chat_red_packet_other_ll, "field 'chatRedPacketOtherLl'", LinearLayout.class);
            redPacketHolder.chatRedPacketTitleMe = (TextView) Utils.findRequiredViewAsType(view, R.id.chat_red_packet_title_me, "field 'chatRedPacketTitleMe'", TextView.class);
            redPacketHolder.chatRedPacketTypeMe = (TextView) Utils.findRequiredViewAsType(view, R.id.chat_red_packet_type_me, "field 'chatRedPacketTypeMe'", TextView.class);
            redPacketHolder.chatLlMe = (LinearLayout) Utils.findRequiredViewAsType(view, R.id.chat_ll_me, "field 'chatLlMe'", LinearLayout.class);
            redPacketHolder.chatAvatarMe = (SimpleDraweeView) Utils.findRequiredViewAsType(view, R.id.chat_avatar_me, "field 'chatAvatarMe'", SimpleDraweeView.class);
            redPacketHolder.chatRedPacketMeLl = (LinearLayout) Utils.findRequiredViewAsType(view, R.id.chat_red_packet_me_ll, "field 'chatRedPacketMeLl'", LinearLayout.class);
            redPacketHolder.itemMsgState = (ImageView) Utils.findRequiredViewAsType(view, R.id.item_msg_state, "field 'itemMsgState'", ImageView.class);
        }

        @Override
        public void unbind() {
            RedPacketHolder redPacketHolder = this.target;
            if (redPacketHolder == null) {
                throw new IllegalStateException("Bindings already cleared.");
            }
            this.target = null;
            redPacketHolder.chatTimeTv = null;
            redPacketHolder.chatTime = null;
            redPacketHolder.chatAvatarOther = null;
            redPacketHolder.chatOtherName = null;
            redPacketHolder.chatRedPacketTitleOther = null;
            redPacketHolder.chatRedPacketTypeOther = null;
            redPacketHolder.chatLlOther = null;
            redPacketHolder.chatRedPacketOtherLl = null;
            redPacketHolder.chatRedPacketTitleMe = null;
            redPacketHolder.chatRedPacketTypeMe = null;
            redPacketHolder.chatLlMe = null;
            redPacketHolder.chatAvatarMe = null;
            redPacketHolder.chatRedPacketMeLl = null;
            redPacketHolder.itemMsgState = null;
        }
    }

    public class TicketHolder_ViewBinding implements Unbinder {
        private TicketHolder target;

        public TicketHolder_ViewBinding(TicketHolder ticketHolder, View view) {
            this.target = ticketHolder;
            ticketHolder.chatTimeTv = (TextView) Utils.findRequiredViewAsType(view, R.id.chat_time_tv, "field 'chatTimeTv'", TextView.class);
            ticketHolder.chatTime = (LinearLayout) Utils.findRequiredViewAsType(view, R.id.chat_time, "field 'chatTime'", LinearLayout.class);
            ticketHolder.chatAvatarOther = (SimpleDraweeView) Utils.findRequiredViewAsType(view, R.id.chat_avatar_other, "field 'chatAvatarOther'", SimpleDraweeView.class);
            ticketHolder.chatOtherName = (TextView) Utils.findRequiredViewAsType(view, R.id.chat_other_name, "field 'chatOtherName'", TextView.class);
            ticketHolder.chatTicketTitleOther = (TextView) Utils.findRequiredViewAsType(view, R.id.chat_ticket_title_other, "field 'chatTicketTitleOther'", TextView.class);
            ticketHolder.chatTicketTypeOther = (TextView) Utils.findRequiredViewAsType(view, R.id.chat_ticket_type_other, "field 'chatTicketTypeOther'", TextView.class);
            ticketHolder.chatLlOther = (LinearLayout) Utils.findRequiredViewAsType(view, R.id.chat_ll_other, "field 'chatLlOther'", LinearLayout.class);
            ticketHolder.chatTicketOtherLl = (LinearLayout) Utils.findRequiredViewAsType(view, R.id.chat_ticket_other_ll, "field 'chatTicketOtherLl'", LinearLayout.class);
            ticketHolder.itemMsgState = (ImageView) Utils.findRequiredViewAsType(view, R.id.item_msg_state, "field 'itemMsgState'", ImageView.class);
            ticketHolder.chatTicketTitleMe = (TextView) Utils.findRequiredViewAsType(view, R.id.chat_ticket_title_me, "field 'chatTicketTitleMe'", TextView.class);
            ticketHolder.chatTicketTypeMe = (TextView) Utils.findRequiredViewAsType(view, R.id.chat_ticket_type_me, "field 'chatTicketTypeMe'", TextView.class);
            ticketHolder.chatLlMe = (LinearLayout) Utils.findRequiredViewAsType(view, R.id.chat_ll_me, "field 'chatLlMe'", LinearLayout.class);
            ticketHolder.chatAvatarMe = (SimpleDraweeView) Utils.findRequiredViewAsType(view, R.id.chat_avatar_me, "field 'chatAvatarMe'", SimpleDraweeView.class);
            ticketHolder.chatTicketMeLl = (LinearLayout) Utils.findRequiredViewAsType(view, R.id.chat_ticket_me_ll, "field 'chatTicketMeLl'", LinearLayout.class);
        }

        @Override
        public void unbind() {
            TicketHolder ticketHolder = this.target;
            if (ticketHolder == null) {
                throw new IllegalStateException("Bindings already cleared.");
            }
            this.target = null;
            ticketHolder.chatTimeTv = null;
            ticketHolder.chatTime = null;
            ticketHolder.chatAvatarOther = null;
            ticketHolder.chatOtherName = null;
            ticketHolder.chatTicketTitleOther = null;
            ticketHolder.chatTicketTypeOther = null;
            ticketHolder.chatLlOther = null;
            ticketHolder.chatTicketOtherLl = null;
            ticketHolder.itemMsgState = null;
            ticketHolder.chatTicketTitleMe = null;
            ticketHolder.chatTicketTypeMe = null;
            ticketHolder.chatLlMe = null;
            ticketHolder.chatAvatarMe = null;
            ticketHolder.chatTicketMeLl = null;
        }
    }

    public class ShareHolder_ViewBinding implements Unbinder {
        private ShareHolder target;

        public ShareHolder_ViewBinding(ShareHolder shareHolder, View view) {
            this.target = shareHolder;
            shareHolder.chatTimeTv = (TextView) Utils.findRequiredViewAsType(view, R.id.chat_time_tv, "field 'chatTimeTv'", TextView.class);
            shareHolder.chatTime = (LinearLayout) Utils.findRequiredViewAsType(view, R.id.chat_time, "field 'chatTime'", LinearLayout.class);
            shareHolder.chatllOther = Utils.findRequiredView(view, R.id.chat_ll_other, "field 'chatllOther'");
            shareHolder.chatllOtherMe = (LinearLayout) Utils.findRequiredViewAsType(view, R.id.chat_ll_other_me, "field 'chatllOtherMe'", LinearLayout.class);
            shareHolder.chatNameOther = (TextView) Utils.findRequiredViewAsType(view, R.id.chat_name_other, "field 'chatNameOther'", TextView.class);
            shareHolder.chatShareOther = (LinearLayout) Utils.findRequiredViewAsType(view, R.id.chat_share_other_ll, "field 'chatShareOther'", LinearLayout.class);
            shareHolder.chatAvatarOther = (SimpleDraweeView) Utils.findRequiredViewAsType(view, R.id.chat_avatar_other, "field 'chatAvatarOther'", SimpleDraweeView.class);
            shareHolder.view1Other = (LinearLayout) Utils.findRequiredViewAsType(view, R.id.view1_other, "field 'view1Other'", LinearLayout.class);
            shareHolder.headOther = (SimpleDraweeView) Utils.findRequiredViewAsType(view, R.id.head_other, "field 'headOther'", SimpleDraweeView.class);
            shareHolder.nameOther = (TextView) Utils.findRequiredViewAsType(view, R.id.name_other, "field 'nameOther'", TextView.class);
            shareHolder.sexOther = (SimpleDraweeView) Utils.findRequiredViewAsType(view, R.id.sex_other, "field 'sexOther'", SimpleDraweeView.class);
            shareHolder.titleOther = (TextView) Utils.findRequiredViewAsType(view, R.id.title_other, "field 'titleOther'", TextView.class);
            shareHolder.view2Other = (LinearLayout) Utils.findRequiredViewAsType(view, R.id.view2_other, "field 'view2Other'", LinearLayout.class);
            shareHolder.title1Other = (TextView) Utils.findRequiredViewAsType(view, R.id.title1_other, "field 'title1Other'", TextView.class);
            shareHolder.des2Other = (TextView) Utils.findRequiredViewAsType(view, R.id.des2_other, "field 'des2Other'", TextView.class);
            shareHolder.iconOther = (FrescoImageView) Utils.findRequiredViewAsType(view, R.id.icon_other, "field 'iconOther'", FrescoImageView.class);
            shareHolder.view3Other = (LinearLayout) Utils.findRequiredViewAsType(view, R.id.view3_other, "field 'view3Other'", LinearLayout.class);
            shareHolder.picOther = (FrescoImageView) Utils.findRequiredViewAsType(view, R.id.pic_other, "field 'picOther'", FrescoImageView.class);
            shareHolder.title2Other = (TextView) Utils.findRequiredViewAsType(view, R.id.title2_other, "field 'title2Other'", TextView.class);
            shareHolder.listLineOther = Utils.findRequiredView(view, R.id.list_line_other, "field 'listLineOther'");
            shareHolder.typetextOther = (TextView) Utils.findRequiredViewAsType(view, R.id.type_text_other, "field 'typetextOther'", TextView.class);
            shareHolder.chatShareMe = (LinearLayout) Utils.findRequiredViewAsType(view, R.id.chat_share_me, "field 'chatShareMe'", LinearLayout.class);
            shareHolder.view1Me = (LinearLayout) Utils.findRequiredViewAsType(view, R.id.view1_me, "field 'view1Me'", LinearLayout.class);
            shareHolder.headMe = (SimpleDraweeView) Utils.findRequiredViewAsType(view, R.id.head_me, "field 'headMe'", SimpleDraweeView.class);
            shareHolder.nameMe = (TextView) Utils.findRequiredViewAsType(view, R.id.name_me, "field 'nameMe'", TextView.class);
            shareHolder.sexMe = (SimpleDraweeView) Utils.findRequiredViewAsType(view, R.id.sex_me, "field 'sexMe'", SimpleDraweeView.class);
            shareHolder.titleMe = (TextView) Utils.findRequiredViewAsType(view, R.id.title_me, "field 'titleMe'", TextView.class);
            shareHolder.itemMsgState = (ImageView) Utils.findRequiredViewAsType(view, R.id.item_msg_state, "field 'itemMsgState'", ImageView.class);
            shareHolder.view2Me = (LinearLayout) Utils.findRequiredViewAsType(view, R.id.view2_me, "field 'view2Me'", LinearLayout.class);
            shareHolder.title1Me = (TextView) Utils.findRequiredViewAsType(view, R.id.title1_me, "field 'title1Me'", TextView.class);
            shareHolder.des2Me = (TextView) Utils.findRequiredViewAsType(view, R.id.des2_me, "field 'des2Me'", TextView.class);
            shareHolder.iconMe = (FrescoImageView) Utils.findRequiredViewAsType(view, R.id.icon_me, "field 'iconMe'", FrescoImageView.class);
            shareHolder.view3Me = (LinearLayout) Utils.findRequiredViewAsType(view, R.id.view3_me, "field 'view3Me'", LinearLayout.class);
            shareHolder.picMe = (FrescoImageView) Utils.findRequiredViewAsType(view, R.id.pic_me, "field 'picMe'", FrescoImageView.class);
            shareHolder.title2Me = (TextView) Utils.findRequiredViewAsType(view, R.id.title2_me, "field 'title2Me'", TextView.class);
            shareHolder.listLineMe = Utils.findRequiredView(view, R.id.list_line_me, "field 'listLineMe'");
            shareHolder.typeTextMe = (TextView) Utils.findRequiredViewAsType(view, R.id.type_text_me, "field 'typeTextMe'", TextView.class);
            shareHolder.chatAvatarMe = (SimpleDraweeView) Utils.findRequiredViewAsType(view, R.id.chat_avatar_me, "field 'chatAvatarMe'", SimpleDraweeView.class);
        }

        @Override
        public void unbind() {
            ShareHolder shareHolder = this.target;
            if (shareHolder == null) {
                throw new IllegalStateException("Bindings already cleared.");
            }
            this.target = null;
            shareHolder.chatTimeTv = null;
            shareHolder.chatTime = null;
            shareHolder.chatllOther = null;
            shareHolder.chatllOtherMe = null;
            shareHolder.chatNameOther = null;
            shareHolder.chatShareOther = null;
            shareHolder.chatAvatarOther = null;
            shareHolder.view1Other = null;
            shareHolder.headOther = null;
            shareHolder.nameOther = null;
            shareHolder.sexOther = null;
            shareHolder.titleOther = null;
            shareHolder.view2Other = null;
            shareHolder.title1Other = null;
            shareHolder.des2Other = null;
            shareHolder.iconOther = null;
            shareHolder.view3Other = null;
            shareHolder.picOther = null;
            shareHolder.title2Other = null;
            shareHolder.listLineOther = null;
            shareHolder.typetextOther = null;
            shareHolder.chatShareMe = null;
            shareHolder.view1Me = null;
            shareHolder.headMe = null;
            shareHolder.nameMe = null;
            shareHolder.sexMe = null;
            shareHolder.titleMe = null;
            shareHolder.itemMsgState = null;
            shareHolder.view2Me = null;
            shareHolder.title1Me = null;
            shareHolder.des2Me = null;
            shareHolder.iconMe = null;
            shareHolder.view3Me = null;
            shareHolder.picMe = null;
            shareHolder.title2Me = null;
            shareHolder.listLineMe = null;
            shareHolder.typeTextMe = null;
            shareHolder.chatAvatarMe = null;
        }
    }

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.activity_mag_socket_chat);
        if ("1".equals(this.conversationtype)) {
            this.conversation = MagappChatCore.getInstance().getConversationService().createConversatinIfNotExist(this.convsersationid, 1);
        } else if (!"2".equals(this.conversationtype)) {
            return;
        } else {
            this.conversation = MagappChatCore.getInstance().getConversationService().createConversatinIfNotExist(this.convsersationid, 2);
        }
        this.conversation.remarkAllRead();
        MagappChatConversation magappChatConversation = this.conversation;
        if (magappChatConversation instanceof MagappGroupConversation) {
            List<AtMessage> unreadAtMessage = ((MagappGroupConversation) magappChatConversation).getUnreadAtMessage();
            if (unreadAtMessage.size() > 0) {
                showToast("youren@ni");
            }
            for (int i = 0; i < unreadAtMessage.size(); i++) {
                ((MagappGroupConversation) this.conversation).reMarkAtMessage(unreadAtMessage.get(i));
            }
        }
        ChatAdapter chatAdapter = new ChatAdapter();
        this.adapter = chatAdapter;
        this.listV.setAdapter((ListAdapter) chatAdapter);
        this.conversation.setOnMessageListener(new MagappChatConversation.OnMessageListener() {
            @Override
            public void onMessageChange() {
                if (MagSocketChatActivity.this.adapter != null) {
                    MagSocketChatActivity.this.adapter.notifyDataSetChanged();
                }
            }
        });
        this.conversation.loadMessage(2, null);
        this.listV.setOnLoadCallback(new MagChatListView.OnLoadCallback() {
            @Override
            public void onLoadMore() {
                MagSocketChatActivity.this.conversation.loadMoreMessage(2, new MagappChatConversation.OnloadMoreMessageListener() {
                    @Override
                    public void onLoadSuccess(int i2) {
                        MagSocketChatActivity.this.onrefreshOk();
                    }
                });
            }
        });
    }

    @OnClick({R.id.video})
    public void onVideo() {
        Intent intent = new Intent(this, (Class<?>) PicPickAlbumActivity.class);
        intent.putExtra("loaderVideo", "1");
        startActivityForResult(intent, 1);
    }

    @OnClick({R.id.image})
    public void onImage() {
        Intent intent = new Intent(this, (Class<?>) PicPickAlbumActivity.class);
        intent.putExtra("loaderVideo", "1");
        startActivityForResult(intent, 1);
    }

    @Override
    public void onActivityResult(int i, int i2, Intent intent) {
        int i3;
        int i4;
        float f;
        double d;
        super.onActivityResult(i, i2, intent);
        if (i2 != -1 || intent == null) {
            return;
        }
        boolean z = true;
        if (i == 1) {
            JSONArray parseArray = JSONArray.parseArray(intent.getStringExtra("result"));
            int i5 = 0;
            if (intent.getIntExtra("mediatype", 0) == 1) {
                while (i5 < parseArray.size()) {
                    String string = parseArray.getString(i5);
                    String str = string + "temp.jpg";
                    try {
                        FileInputStream fileInputStream = new FileInputStream(new File(string));
                        BitmapFactory.Options options = new BitmapFactory.Options();
                        options.inJustDecodeBounds = z;
                        BitmapFactory.decodeStream(fileInputStream, null, options);
                        i3 = options.outWidth;
                        i4 = options.outHeight;
                        float f2 = i3;
                        float f3 = i4;
                        f = f2 / f3;
                        d = f;
                    } catch (Exception unused) {
                    }
                    if (d >= 0.28d && (f <= 1.0f || d >= 3.5d)) {
                        if (i4 > 1028) {
                            i3 = (int) (f * 1028.0f);
                            i4 = TXLiteAVCode.EVT_SW_ENCODER_START_SUCC;
                        }
                        Bitmap rotateBitmap = ImageUtil.rotateBitmap(ImageUtil.getExifOrientation(string), ImageUtil.zoomBitmap(PhotoUtil.getLocalImage(new File(string), i3, i4), i3, i4));
                        File file = new File(str);
                        PhotoUtil.compressImage(rotateBitmap, file, 90);
                        this.conversation.sendMessage(this.conversation.getMessageCreater().createImageMessage(file, i3, i4), null);
                        i5++;
                        z = true;
                    }
                    Bitmap rotateBitmap2 = ImageUtil.rotateBitmap(ImageUtil.getExifOrientation(string), ImageUtil.zoomBitmap(PhotoUtil.getLocalImage(new File(string), i3, i4), i3, i4));
                    File file2 = new File(str);
                    PhotoUtil.compressImage(rotateBitmap2, file2, 90);
                    this.conversation.sendMessage(this.conversation.getMessageCreater().createImageMessage(file2, i3, i4), null);
                    i5++;
                    z = true;
                }
                return;
            }
            File file3 = new File(parseArray.getString(0));
            Bitmap videoAtTime = PhotoUtil.getVideoAtTime(file3.getAbsolutePath());
            this.conversation.sendMessage(this.conversation.getMessageCreater().createVideoMessage(file3, new File(videoAtTime != null ? ImageUtil.saveBitmapFile(videoAtTime) : ""), Integer.parseInt(intent.getStringExtra("duration")), ((int) file3.length()) / 1024, videoAtTime.getWidth(), videoAtTime.getHeight()), null);
        }
    }

    @OnClick({R.id.send})
    public void sendMessage() {
        this.conversation.sendMessage(this.conversation.getMessageCreater().createTextMessage(this.etInputV.getText().toString()), null);
    }

    public void locationClick(View view) {
        this.conversation.sendMessage(this.conversation.getMessageCreater().createLocationMessage(38.0d, 119.0d, "大周路", "88号"), null);
    }

    public void cardClick(View view) {
        this.conversation.sendMessage(this.conversation.getMessageCreater().createCardMessage("12321", "卡片详情", "http://www.baidu.com", 2, "card"), null);
    }

    public void redPacketClick(View view) {
        this.conversation.sendMessage(this.conversation.getMessageCreater().createRedPacketMessage("12321", "卡片详情", "http://www.baidu.com", "key", "card"), null);
    }

    @OnClick({R.id.shareClick})
    public void shareClick() {
        int random = ((int) (Math.random() * 3.0d)) + 1;
        if (random == 1) {
            this.conversation.sendMessage(this.conversation.getMessageCreater().createShareMessage("1", "标题", "描述", "http://pic.magcloud.cc/pic/20180710/153120093490292_429.jpg", "", "", "magapp://showView?id=3141"), null);
        } else if (random == 2) {
            this.conversation.sendMessage(this.conversation.getMessageCreater().createShareMessage("2", "小肥羊", "营业时间:09:00~23:00", "http://pic.magcloud.cc/pic/20180424/qi_niu_1524561811087_942_292_41.png", "http://demo.magapp-x.magcloud.cc/public/icons/level/level_male_2.png", "个人名片", "magapp://userHome?userId=134"), null);
        } else if (random == 3) {
            this.conversation.sendMessage(this.conversation.getMessageCreater().createShareMessage("3", "测试", "点击查看详情", "http://oss.magapp.magcloud.cc/pic/20180522/oss_1526958097730_181_821_111.jpg", "", "活动", "http://demo2.magapp-x.magcloud.cc//mag/activity/v1/activity/activityView?id=141&themecolor=48BB5B&"), null);
        }
    }

    @OnClick({R.id.clear_all})
    public void onNotify() {
        this.conversation.clearAllMessage();
        this.adapter.notifyDataSetChanged();
    }

    @OnClick({R.id.at_message})
    public void onAtMessage() {
        this.conversation.sendMessage(this.conversation.getMessageCreater().createAtMessage("@所有人" + this.etInputV.getText().toString(), true, new ArrayList()), null);
    }

    @OnClick({R.id.refreshok})
    public void onrefreshOk() {
        this.listV.onLoadSuccess("加载ok");
    }

    class ChatAdapter extends BaseAdapter {
        @Override
        public long getItemId(int i) {
            return i;
        }

        ChatAdapter() {
        }

        @Override
        public int getCount() {
            return MagSocketChatActivity.this.conversation.getMessageList().size();
        }

        @Override
        public MagappMessage getItem(int i) {
            return MagSocketChatActivity.this.conversation.getMessageList().get(i);
        }

        @Override
        public View getView(int i, View view, ViewGroup viewGroup) {
            View inflate;
            View view2;
            View inflate2;
            MagappMessage item = getItem(i);
            if (item.getMessageType() == 1) {
                switch (item.getBodyType()) {
                    case 1:
                        inflate = LayoutInflater.from(MagSocketChatActivity.this.getActivity()).inflate(R.layout.aa_chat_item_text, (ViewGroup) null);
                        if (item.getFromUserId().equals(MagSocketChatActivity.this.conversation.getMyUserid())) {
                            inflate.findViewById(R.id.other_layout).setVisibility(8);
                            inflate.findViewById(R.id.my_layout).setVisibility(0);
                            ((TextView) inflate.findViewById(R.id.my_msg)).setText(((MagappTextMessage) item).getText());
                            break;
                        } else {
                            inflate.findViewById(R.id.other_layout).setVisibility(0);
                            inflate.findViewById(R.id.my_layout).setVisibility(8);
                            ((TextView) inflate.findViewById(R.id.other_msg)).setText(((MagappTextMessage) item).getText());
                            FrescoImageView frescoImageView = (FrescoImageView) inflate.findViewById(R.id.other_head);
                            TextView textView = (TextView) inflate.findViewById(R.id.other_name);
                            Contact contact = MagappChatCore.getInstance().getContactManager().getContact(MagSocketChatActivity.this.convsersationid, 1);
                            if (contact != null) {
                                frescoImageView.asCircle();
                                frescoImageView.loadView(contact.head, R.drawable.head_default);
                                textView.setText(contact.showName);
                                break;
                            }
                        }
                        break;
                    case 2:
                        inflate = LayoutInflater.from(MagSocketChatActivity.this.getActivity()).inflate(R.layout.aa_chat_item_text, (ViewGroup) null);
                        if (item.getFromUserId().equals(MagSocketChatActivity.this.conversation.getMyUserid())) {
                            inflate.findViewById(R.id.other_layout).setVisibility(8);
                            inflate.findViewById(R.id.my_layout).setVisibility(0);
                            ((TextView) inflate.findViewById(R.id.my_msg)).setText(((MagappTextMessage) item).getText());
                            break;
                        } else {
                            inflate.findViewById(R.id.other_layout).setVisibility(0);
                            inflate.findViewById(R.id.my_layout).setVisibility(8);
                            ((TextView) inflate.findViewById(R.id.other_msg)).setText(((MagappTextMessage) item).getText());
                            FrescoImageView frescoImageView2 = (FrescoImageView) inflate.findViewById(R.id.other_head);
                            TextView textView2 = (TextView) inflate.findViewById(R.id.other_name);
                            Contact contact2 = MagappChatCore.getInstance().getContactManager().getContact(MagSocketChatActivity.this.convsersationid, 1);
                            if (contact2 != null) {
                                frescoImageView2.asCircle();
                                frescoImageView2.loadView(contact2.head, R.drawable.head_default);
                                textView2.setText(contact2.showName);
                                break;
                            }
                        }
                        break;
                    case 3:
                        MagImageMessage magImageMessage = (MagImageMessage) item;
                        inflate2 = LayoutInflater.from(MagSocketChatActivity.this.getActivity()).inflate(R.layout.aa_chat_item_video, (ViewGroup) null);
                        if (item.getFromUserId().equals(MagSocketChatActivity.this.conversation.getMyUserid())) {
                            inflate2.findViewById(R.id.other_layout).setVisibility(8);
                            inflate2.findViewById(R.id.my_layout).setVisibility(0);
                            FrescoImageView frescoImageView3 = (FrescoImageView) inflate2.findViewById(R.id.my_pic);
                            TextUtils.isEmpty(magImageMessage.getRemotePicPath());
                            frescoImageView3.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view3) {
                                }
                            });
                        } else {
                            inflate2.findViewById(R.id.other_layout).setVisibility(0);
                            inflate2.findViewById(R.id.my_layout).setVisibility(8);
                            FrescoImageView frescoImageView4 = (FrescoImageView) inflate2.findViewById(R.id.other_pic);
                            FrescoImageView frescoImageView5 = (FrescoImageView) inflate2.findViewById(R.id.other_head);
                            TextView textView3 = (TextView) inflate2.findViewById(R.id.other_name);
                            Contact contact3 = MagappChatCore.getInstance().getContactManager().getContact(MagSocketChatActivity.this.convsersationid, 1);
                            if (contact3 != null) {
                                frescoImageView5.asCircle();
                                frescoImageView5.loadView(contact3.head, R.drawable.head_default);
                                textView3.setText(contact3.showName);
                            }
                            frescoImageView4.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view3) {
                                }
                            });
                        }
                        view2 = inflate2;
                        break;
                    case 4:
                        MagappLocationMessage magappLocationMessage = (MagappLocationMessage) item;
                        view2 = LayoutInflater.from(MagSocketChatActivity.this.getActivity()).inflate(R.layout.item_chat_location, (ViewGroup) null);
                        if (item.getFromUserId().equals(MagSocketChatActivity.this.conversation.getMyUserid())) {
                            view2.findViewById(R.id.chat_location_me_ll).setVisibility(0);
                            view2.findViewById(R.id.chat_location_other_ll).setVisibility(8);
                            ((TextView) view2.findViewById(R.id.chat_map_location_other)).setText(magappLocationMessage.getDetailAddress());
                            ((TextView) view2.findViewById(R.id.chat_map_location_title_me)).setText(magappLocationMessage.getLocationName());
                            FrescoUtils.loadResPic(MagSocketChatActivity.this.getActivity(), (SimpleDraweeView) view2.findViewById(R.id.chat_map_me), R.drawable.map_location);
                            break;
                        } else {
                            TextView textView4 = (TextView) view2.findViewById(R.id.chat_other_name);
                            if ("2".equals(MagSocketChatActivity.this.conversationtype)) {
                                textView4.setVisibility(0);
                            } else {
                                textView4.setVisibility(8);
                            }
                            view2.findViewById(R.id.chat_location_me_ll).setVisibility(8);
                            view2.findViewById(R.id.chat_location_other_ll).setVisibility(0);
                            TextView textView5 = (TextView) view2.findViewById(R.id.chat_map_location_other);
                            TextView textView6 = (TextView) view2.findViewById(R.id.chat_map_location_title_other);
                            textView5.setText(magappLocationMessage.getDetailAddress());
                            textView6.setText(magappLocationMessage.getLocationName());
                            FrescoUtils.loadResPic(MagSocketChatActivity.this.getActivity(), (SimpleDraweeView) view2.findViewById(R.id.chat_map_other), R.drawable.map_location);
                            break;
                        }
                    case 5:
                    default:
                        view2 = null;
                        break;
                    case 6:
                        final MagVideoMessage magVideoMessage = (MagVideoMessage) item;
                        inflate2 = LayoutInflater.from(MagSocketChatActivity.this.getActivity()).inflate(R.layout.aa_chat_item_video, (ViewGroup) null);
                        if (item.getFromUserId().equals(MagSocketChatActivity.this.conversation.getMyUserid())) {
                            inflate2.findViewById(R.id.other_layout).setVisibility(8);
                            inflate2.findViewById(R.id.my_layout).setVisibility(0);
                            FrescoImageView frescoImageView6 = (FrescoImageView) inflate2.findViewById(R.id.my_pic);
                            TextUtils.isEmpty(magVideoMessage.getRemotePicPath());
                            frescoImageView6.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view3) {
                                    Intent intent = new Intent(MagSocketChatActivity.this.getActivity(), (Class<?>) VideoPicActivity.class);
                                    intent.putExtra("url", magVideoMessage.getRemoteVideoPath());
                                    intent.putExtra("urlPic", magVideoMessage.getRemotePicPath());
                                    MagSocketChatActivity.this.startActivity(intent);
                                }
                            });
                        } else {
                            inflate2.findViewById(R.id.other_layout).setVisibility(0);
                            inflate2.findViewById(R.id.my_layout).setVisibility(8);
                            FrescoImageView frescoImageView7 = (FrescoImageView) inflate2.findViewById(R.id.other_pic);
                            FrescoImageView frescoImageView8 = (FrescoImageView) inflate2.findViewById(R.id.other_head);
                            TextView textView7 = (TextView) inflate2.findViewById(R.id.other_name);
                            Contact contact4 = MagappChatCore.getInstance().getContactManager().getContact(MagSocketChatActivity.this.convsersationid, 1);
                            if (contact4 != null) {
                                frescoImageView8.asCircle();
                                frescoImageView8.loadView(contact4.head, R.drawable.head_default);
                                textView7.setText(contact4.showName);
                            }
                            frescoImageView7.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view3) {
                                    Intent intent = new Intent(MagSocketChatActivity.this.getActivity(), (Class<?>) VideoPicActivity.class);
                                    intent.putExtra("url", magVideoMessage.getRemoteVideoPath());
                                    intent.putExtra("urlPic", magVideoMessage.getRemotePicPath());
                                    MagSocketChatActivity.this.startActivity(intent);
                                }
                            });
                        }
                        view2 = inflate2;
                        break;
                    case 7:
                        MagappRedPacketMessage magappRedPacketMessage = (MagappRedPacketMessage) item;
                        view2 = LayoutInflater.from(MagSocketChatActivity.this.getActivity()).inflate(R.layout.item_chat_redpacket, (ViewGroup) null);
                        RedPacketHolder redPacketHolder = new RedPacketHolder(view2);
                        if (item.getFromUserId().equals(MagSocketChatActivity.this.conversation.getMyUserid())) {
                            MagSocketChatActivity.this.showView(redPacketHolder.chatRedPacketMeLl);
                            MagSocketChatActivity.this.hideView(redPacketHolder.chatRedPacketOtherLl);
                            redPacketHolder.chatRedPacketTitleMe.setText(magappRedPacketMessage.getDes());
                            redPacketHolder.chatRedPacketTypeMe.setText(magappRedPacketMessage.getTypeText());
                            break;
                        } else {
                            if ("2".equals(MagSocketChatActivity.this.conversationtype)) {
                                MagSocketChatActivity.this.showView(redPacketHolder.chatOtherName);
                            } else {
                                MagSocketChatActivity.this.hideView(redPacketHolder.chatOtherName);
                            }
                            MagSocketChatActivity.this.showView(redPacketHolder.chatRedPacketOtherLl);
                            MagSocketChatActivity.this.hideView(redPacketHolder.chatRedPacketMeLl);
                            redPacketHolder.chatRedPacketTitleOther.setText(magappRedPacketMessage.getDes());
                            redPacketHolder.chatRedPacketTypeOther.setText(magappRedPacketMessage.getTypeText());
                            break;
                        }
                    case 8:
                        MagappCardMessage magappCardMessage = (MagappCardMessage) item;
                        view2 = LayoutInflater.from(MagSocketChatActivity.this.getActivity()).inflate(R.layout.item_chat_ticket, (ViewGroup) null);
                        TicketHolder ticketHolder = new TicketHolder(view2);
                        if (item.getFromUserId().equals(MagSocketChatActivity.this.conversation.getMyUserid())) {
                            MagSocketChatActivity.this.showView(ticketHolder.chatTicketMeLl);
                            MagSocketChatActivity.this.hideView(ticketHolder.chatTicketOtherLl);
                            ticketHolder.chatTicketTitleMe.setText(magappCardMessage.getDes());
                            ticketHolder.chatTicketTypeMe.setText(magappCardMessage.getTypeText());
                            break;
                        } else {
                            if ("2".equals(MagSocketChatActivity.this.conversationtype)) {
                                MagSocketChatActivity.this.showView(ticketHolder.chatOtherName);
                            } else {
                                MagSocketChatActivity.this.hideView(ticketHolder.chatOtherName);
                            }
                            MagSocketChatActivity.this.showView(ticketHolder.chatTicketOtherLl);
                            MagSocketChatActivity.this.hideView(ticketHolder.chatTicketMeLl);
                            ticketHolder.chatTicketTitleOther.setText(magappCardMessage.getDes());
                            ticketHolder.chatTicketTypeOther.setText(magappCardMessage.getTypeText());
                            break;
                        }
                    case 9:
                        MagappShareMessage magappShareMessage = (MagappShareMessage) item;
                        view2 = LayoutInflater.from(MagSocketChatActivity.this.getActivity()).inflate(R.layout.item_chat_share, (ViewGroup) null);
                        ShareHolder shareHolder = new ShareHolder(view2);
                        LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) shareHolder.chatShareOther.getLayoutParams();
                        layoutParams.rightMargin = IUtil.dip2px(MagSocketChatActivity.this.getActivity(), 30.0f);
                        shareHolder.chatShareOther.setLayoutParams(layoutParams);
                        LinearLayout.LayoutParams layoutParams2 = (LinearLayout.LayoutParams) shareHolder.chatShareMe.getLayoutParams();
                        layoutParams2.leftMargin = IUtil.dip2px(MagSocketChatActivity.this.getActivity(), 30.0f);
                        shareHolder.chatShareMe.setLayoutParams(layoutParams2);
                        if (item.getFromUserId().equals(MagSocketChatActivity.this.conversation.getMyUserid())) {
                            shareHolder.chatShareOther.setVisibility(8);
                            shareHolder.chatShareMe.setVisibility(0);
                            shareHolder.chatAvatarMe.setImageURI("http://demo.dz.magcloud.cc/uc_server/data/avatar/000/00/00/19_avatar_big.jpg?random=2415");
                            if ("2".equals(magappShareMessage.getType())) {
                                shareHolder.view1Me.setVisibility(0);
                                shareHolder.view2Me.setVisibility(8);
                                shareHolder.view3Me.setVisibility(8);
                                shareHolder.listLineMe.setVisibility(0);
                                shareHolder.typeTextMe.setVisibility(0);
                                shareHolder.headMe.setImageURI(magappShareMessage.getPic_url());
                                FrescoResizeUtil.loadPic(shareHolder.sexMe, magappShareMessage.getTag_url());
                                shareHolder.titleMe.setText(magappShareMessage.getDes());
                                shareHolder.typeTextMe.setText(magappShareMessage.getType_text());
                                shareHolder.nameMe.setText(magappShareMessage.getTitle());
                            }
                            if ("1".equals(magappShareMessage.getType())) {
                                shareHolder.view1Me.setVisibility(8);
                                shareHolder.view2Me.setVisibility(0);
                                shareHolder.view3Me.setVisibility(8);
                                shareHolder.listLineMe.setVisibility(8);
                                shareHolder.typeTextMe.setVisibility(8);
                                shareHolder.title1Me.setText(magappShareMessage.getTitle());
                                shareHolder.des2Me.setText(magappShareMessage.getDes());
                                shareHolder.iconMe.loadView(magappShareMessage.getPic_url(), R.drawable.icon_default_link);
                            }
                            if ("3".equals(magappShareMessage.getType())) {
                                shareHolder.view1Me.setVisibility(8);
                                shareHolder.view2Me.setVisibility(8);
                                shareHolder.view3Me.setVisibility(0);
                                shareHolder.listLineMe.setVisibility(0);
                                shareHolder.typeTextMe.setVisibility(0);
                                shareHolder.picMe.loadView(magappShareMessage.getPic_url(), R.drawable.icon_default_link);
                                shareHolder.title2Me.setText(magappShareMessage.getTitle());
                                shareHolder.typeTextMe.setText(magappShareMessage.getType_text());
                                break;
                            }
                        } else {
                            shareHolder.chatShareOther.setVisibility(0);
                            shareHolder.chatShareMe.setVisibility(8);
                            shareHolder.chatAvatarOther.setImageURI("http://pic.magcloud.cc/pic/20180627/qi_niu_1530067586_1725796409.jpg?imageView2/3/w/120");
                            if ("2".equals(MagSocketChatActivity.this.conversationtype)) {
                                shareHolder.chatNameOther.setVisibility(0);
                                shareHolder.chatNameOther.setText("");
                            } else {
                                shareHolder.chatNameOther.setVisibility(8);
                            }
                            if ("2".equals(magappShareMessage.getType())) {
                                shareHolder.view1Other.setVisibility(0);
                                shareHolder.view2Other.setVisibility(8);
                                shareHolder.view3Other.setVisibility(8);
                                shareHolder.listLineOther.setVisibility(0);
                                shareHolder.typetextOther.setVisibility(0);
                                shareHolder.headOther.setImageURI(magappShareMessage.getPic_url());
                                shareHolder.nameOther.setText(magappShareMessage.getTitle());
                                FrescoResizeUtil.loadPic(shareHolder.sexOther, magappShareMessage.getTag_url());
                                shareHolder.titleOther.setText(magappShareMessage.getDes());
                                shareHolder.typetextOther.setText(magappShareMessage.getType_text());
                            }
                            if ("1".equals(magappShareMessage.getType())) {
                                shareHolder.view1Other.setVisibility(8);
                                shareHolder.view2Other.setVisibility(0);
                                shareHolder.view3Other.setVisibility(8);
                                shareHolder.listLineOther.setVisibility(8);
                                shareHolder.typetextOther.setVisibility(8);
                                shareHolder.title1Other.setText(magappShareMessage.getTitle());
                                shareHolder.des2Other.setText(magappShareMessage.getDes());
                                shareHolder.iconOther.loadView(magappShareMessage.getPic_url(), R.drawable.icon_default_link);
                            }
                            if ("3".equals(magappShareMessage.getType())) {
                                shareHolder.view1Other.setVisibility(8);
                                shareHolder.view2Other.setVisibility(8);
                                shareHolder.view3Other.setVisibility(0);
                                shareHolder.listLineOther.setVisibility(0);
                                shareHolder.typetextOther.setVisibility(0);
                                shareHolder.picOther.loadView(magappShareMessage.getPic_url(), R.drawable.icon_default_link);
                                shareHolder.title2Other.setText(magappShareMessage.getTitle());
                                shareHolder.typetextOther.setText(magappShareMessage.getType_text());
                                break;
                            }
                        }
                        break;
                }
                return view2 != null ? LayoutInflater.from(MagSocketChatActivity.this.getActivity()).inflate(R.layout.aa_chat_item_system, (ViewGroup) null) : view2;
            }
            inflate = LayoutInflater.from(MagSocketChatActivity.this.getActivity()).inflate(R.layout.aa_chat_item_system, (ViewGroup) null);
            ((TextView) inflate.findViewById(R.id.infor)).setText(((MagSystemMessage) item).getText());
            view2 = inflate;
            if (view2 != null) {
            }
        }
    }

    public void showView(View view) {
        view.setVisibility(0);
    }

    public void hideView(View view) {
        view.setVisibility(8);
    }

    class TicketHolder {

        @BindView(R.id.chat_avatar_me)
        SimpleDraweeView chatAvatarMe;

        @BindView(R.id.chat_avatar_other)
        SimpleDraweeView chatAvatarOther;

        @BindView(R.id.chat_ll_me)
        LinearLayout chatLlMe;

        @BindView(R.id.chat_ll_other)
        LinearLayout chatLlOther;

        @BindView(R.id.chat_other_name)
        TextView chatOtherName;

        @BindView(R.id.chat_ticket_me_ll)
        LinearLayout chatTicketMeLl;

        @BindView(R.id.chat_ticket_other_ll)
        LinearLayout chatTicketOtherLl;

        @BindView(R.id.chat_ticket_title_me)
        TextView chatTicketTitleMe;

        @BindView(R.id.chat_ticket_title_other)
        TextView chatTicketTitleOther;

        @BindView(R.id.chat_ticket_type_me)
        TextView chatTicketTypeMe;

        @BindView(R.id.chat_ticket_type_other)
        TextView chatTicketTypeOther;

        @BindView(R.id.chat_time)
        LinearLayout chatTime;

        @BindView(R.id.chat_time_tv)
        TextView chatTimeTv;

        @BindView(R.id.item_msg_state)
        ImageView itemMsgState;

        TicketHolder(View view) {
            ButterKnife.bind(this, view);
        }
    }

    class RedPacketNoticeHolder {

        @BindView(R.id.chat_red_packet)
        LinearLayout chatRedPacket;

        @BindView(R.id.chat_red_packet_notice_tv)
        TextView chatRedPacketNoticeTv;

        RedPacketNoticeHolder(View view) {
            ButterKnife.bind(this, view);
        }
    }

    class RedPacketHolder {

        @BindView(R.id.chat_avatar_me)
        SimpleDraweeView chatAvatarMe;

        @BindView(R.id.chat_avatar_other)
        SimpleDraweeView chatAvatarOther;

        @BindView(R.id.chat_ll_me)
        LinearLayout chatLlMe;

        @BindView(R.id.chat_ll_other)
        LinearLayout chatLlOther;

        @BindView(R.id.chat_other_name)
        TextView chatOtherName;

        @BindView(R.id.chat_red_packet_me_ll)
        LinearLayout chatRedPacketMeLl;

        @BindView(R.id.chat_red_packet_other_ll)
        LinearLayout chatRedPacketOtherLl;

        @BindView(R.id.chat_red_packet_title_me)
        TextView chatRedPacketTitleMe;

        @BindView(R.id.chat_red_packet_title_other)
        TextView chatRedPacketTitleOther;

        @BindView(R.id.chat_red_packet_type_me)
        TextView chatRedPacketTypeMe;

        @BindView(R.id.chat_red_packet_type_other)
        TextView chatRedPacketTypeOther;

        @BindView(R.id.chat_time)
        LinearLayout chatTime;

        @BindView(R.id.chat_time_tv)
        TextView chatTimeTv;

        @BindView(R.id.item_msg_state)
        ImageView itemMsgState;

        RedPacketHolder(View view) {
            ButterKnife.bind(this, view);
        }
    }

    class ShareHolder {

        @BindView(R.id.chat_avatar_me)
        SimpleDraweeView chatAvatarMe;

        @BindView(R.id.chat_avatar_other)
        SimpleDraweeView chatAvatarOther;

        @BindView(R.id.chat_name_other)
        TextView chatNameOther;

        @BindView(R.id.chat_share_me)
        LinearLayout chatShareMe;

        @BindView(R.id.chat_share_other_ll)
        LinearLayout chatShareOther;

        @BindView(R.id.chat_time)
        LinearLayout chatTime;

        @BindView(R.id.chat_time_tv)
        TextView chatTimeTv;

        @BindView(R.id.chat_ll_other)
        View chatllOther;

        @BindView(R.id.chat_ll_other_me)
        LinearLayout chatllOtherMe;

        @BindView(R.id.des2_me)
        TextView des2Me;

        @BindView(R.id.des2_other)
        TextView des2Other;

        @BindView(R.id.head_me)
        SimpleDraweeView headMe;

        @BindView(R.id.head_other)
        SimpleDraweeView headOther;

        @BindView(R.id.icon_me)
        FrescoImageView iconMe;

        @BindView(R.id.icon_other)
        FrescoImageView iconOther;

        @BindView(R.id.item_msg_state)
        ImageView itemMsgState;

        @BindView(R.id.list_line_me)
        View listLineMe;

        @BindView(R.id.list_line_other)
        View listLineOther;

        @BindView(R.id.name_me)
        TextView nameMe;

        @BindView(R.id.name_other)
        TextView nameOther;

        @BindView(R.id.pic_me)
        FrescoImageView picMe;

        @BindView(R.id.pic_other)
        FrescoImageView picOther;

        @BindView(R.id.sex_me)
        SimpleDraweeView sexMe;

        @BindView(R.id.sex_other)
        SimpleDraweeView sexOther;

        @BindView(R.id.title1_me)
        TextView title1Me;

        @BindView(R.id.title1_other)
        TextView title1Other;

        @BindView(R.id.title2_me)
        TextView title2Me;

        @BindView(R.id.title2_other)
        TextView title2Other;

        @BindView(R.id.title_me)
        TextView titleMe;

        @BindView(R.id.title_other)
        TextView titleOther;

        @BindView(R.id.type_text_me)
        TextView typeTextMe;

        @BindView(R.id.type_text_other)
        TextView typetextOther;

        @BindView(R.id.view1_me)
        LinearLayout view1Me;

        @BindView(R.id.view1_other)
        LinearLayout view1Other;

        @BindView(R.id.view2_me)
        LinearLayout view2Me;

        @BindView(R.id.view2_other)
        LinearLayout view2Other;

        @BindView(R.id.view3_me)
        LinearLayout view3Me;

        @BindView(R.id.view3_other)
        LinearLayout view3Other;

        ShareHolder(View view) {
            ButterKnife.bind(this, view);
            ArrayList arrayList = new ArrayList();
            arrayList.add(this.view1Other);
            arrayList.add(this.view2Other);
            arrayList.add(this.view3Other);
            arrayList.add(this.view1Me);
            arrayList.add(this.view2Me);
            arrayList.add(this.view3Me);
            for (int i = 0; i < arrayList.size(); i++) {
                ((LinearLayout) arrayList.get(i)).setVisibility(8);
            }
            this.listLineOther.setVisibility(8);
            this.typetextOther.setVisibility(8);
            this.listLineMe.setVisibility(8);
            this.typeTextMe.setVisibility(8);
            int displayWidth = IUtil.getDisplayWidth() - IUtil.dip2px(MagSocketChatActivity.this.getActivity(), 100.0f);
            ViewGroup.LayoutParams layoutParams = this.picOther.getLayoutParams();
            layoutParams.width = displayWidth;
            int i2 = displayWidth / 2;
            layoutParams.height = i2;
            this.picOther.setLayoutParams(layoutParams);
            this.picOther.setWidthAndHeight(displayWidth, i2);
            ViewGroup.LayoutParams layoutParams2 = this.picMe.getLayoutParams();
            layoutParams2.width = displayWidth;
            layoutParams2.height = i2;
            this.picMe.setLayoutParams(layoutParams2);
            this.picMe.setWidthAndHeight(displayWidth, i2);
        }
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        MagappChatConversation magappChatConversation = this.conversation;
        if (magappChatConversation != null) {
            magappChatConversation.clearOnMessageListener();
        }
    }
}