TIM v2.3.1版本的 MD5 值为:d6957e3ee7ce901ccc491cefdea0da8c
以下内容为反编译后的 LongMsgItemBuilder.java 源代码,内容仅作参考
package com.tencent.mobileqq.activity.aio.item;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.text.ClipboardManager;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.etrump.mixlayout.ETTextView;
import com.tencent.mobileqq.activity.ChatActivityFacade;
import com.tencent.mobileqq.activity.ChatActivityUtils;
import com.tencent.mobileqq.activity.ChatFragment;
import com.tencent.mobileqq.activity.QQBrowserActivity;
import com.tencent.mobileqq.activity.aio.AIOUtils;
import com.tencent.mobileqq.activity.aio.BaseBubbleBuilder;
import com.tencent.mobileqq.activity.aio.BaseChatItemLayout;
import com.tencent.mobileqq.activity.aio.OnLongClickAndTouchListener;
import com.tencent.mobileqq.activity.aio.SessionInfo;
import com.tencent.mobileqq.activity.aio.anim.AIOAnimationConatiner;
import com.tencent.mobileqq.app.AppConstants;
import com.tencent.mobileqq.app.QQAppInterface;
import com.tencent.mobileqq.ark.ArkRecommendController;
import com.tencent.mobileqq.bubble.BubbleInfo;
import com.tencent.mobileqq.data.ChatMessage;
import com.tencent.mobileqq.data.MessageForLongMsg;
import com.tencent.mobileqq.data.MessageForMixedMsg;
import com.tencent.mobileqq.data.MessageForText;
import com.tencent.mobileqq.data.MessageRecord;
import com.tencent.mobileqq.data.RecommendCommonMessage;
import com.tencent.mobileqq.forward.ForwardBaseOption;
import com.tencent.mobileqq.mail.MailPluginManager;
import com.tencent.mobileqq.service.report.ReportConstants;
import com.tencent.mobileqq.statistics.ReportController;
import com.tencent.mobileqq.statistics.ReportUtils;
import com.tencent.mobileqq.statistics.StatisticCollector;
import com.tencent.mobileqq.t9search.T9SearchSortWeight;
import com.tencent.mobileqq.text.QQText;
import com.tencent.mobileqq.translate.TranslateHandler;
import com.tencent.mobileqq.translate.TranslationObserver;
import com.tencent.mobileqq.utils.DialogUtil;
import com.tencent.mobileqq.utils.NetworkUtil;
import com.tencent.mobileqq.utils.ViewUtils;
import com.tencent.mobileqq.utils.dialogutils.QQCustomMenu;
import com.tencent.mobileqq.utils.dialogutils.QQCustomMenuItem;
import com.tencent.mobileqq.widget.AnimationTextView;
import com.tencent.qphone.base.util.BaseApplication;
import com.tencent.qphone.base.util.QLog;
import com.tencent.tim.R;
import com.tencent.widget.immersive.ImmersiveUtils;
import cooperation.qqfav.QfavBuilder;
import cooperation.qqfav.QfavReport;
import java.lang.ref.WeakReference;
import java.util.regex.Pattern;
public class LongMsgItemBuilder extends BaseBubbleBuilder {
private static final int i = BaseChatItemLayout.k + BaseChatItemLayout.p;
private static final int j = BaseChatItemLayout.l + BaseChatItemLayout.q;
private static final int k = BaseChatItemLayout.m + BaseChatItemLayout.r;
private static final int l = BaseChatItemLayout.n + BaseChatItemLayout.s;
protected View.OnClickListener f85798a;
protected View.OnTouchListener f12937a;
private TranslationObserver f12938a;
AnimationTextView.OnDoubleClick f12939a;
public LongMsgItemBuilder(QQAppInterface qQAppInterface, BaseAdapter baseAdapter, Context context, SessionInfo sessionInfo, AIOAnimationConatiner aIOAnimationConatiner) {
super(qQAppInterface, baseAdapter, context, sessionInfo, aIOAnimationConatiner);
this.f12938a = new mju(this);
this.f12939a = new mjx(this);
this.f85798a = new mjy(this);
this.f12937a = new mjz(this);
}
@Override
public View a(ChatMessage chatMessage, BaseBubbleBuilder.ViewHolder viewHolder, View view, BaseChatItemLayout baseChatItemLayout, OnLongClickAndTouchListener onLongClickAndTouchListener) {
AnimationTextView animationTextView;
ChatFragment chatFragment;
ArkRecommendController arkRecommendController;
Context context = baseChatItemLayout.getContext();
MessageForLongMsg messageForLongMsg = (MessageForLongMsg) chatMessage;
int a2 = a(messageForLongMsg);
Holder holder = (Holder) viewHolder;
if (view != null) {
animationTextView = view;
} else if (a2 == 1) {
AnimationTextView animationTextView2 = new AnimationTextView(context);
animationTextView2.setTextColor(context.getResources().getColorStateList(R.color.f39344name_res_0x7f0b03af));
animationTextView2.setMaxWidth(BaseChatItemLayout.h);
animationTextView2.setSpannableFactory(QQText.f30368a);
animationTextView2.setMovementMethod(LinkMovementMethod.getInstance());
animationTextView2.setId(R.id.f48415name_res_0x7f09053b);
holder.f12941a = animationTextView2;
animationTextView = animationTextView2;
} else {
animationTextView = a(context, holder);
}
LinearLayout a3 = (a2 == 2 && holder.f12945b == null) ? a(context, holder) : animationTextView;
holder.f12941a.setTextSize(0, this.f12269a.f85625b);
if (a2 == 2) {
holder.f12945b.setVisibility(0);
ReplyTextItemBuilder.a(this.f12266a, this.f12271a, holder.f12945b, messageForLongMsg.mSourceMsgInfo, messageForLongMsg.frienduin, messageForLongMsg.istroop, messageForLongMsg.uniseq);
holder.f12945b.setOnClickListener(this.f85798a);
holder.f12945b.setOnTouchListener(onLongClickAndTouchListener);
holder.f12945b.setOnLongClickListener(onLongClickAndTouchListener);
if (this.f12271a.getCurrentAccountUin().equals(chatMessage.senderuin) && !messageForLongMsg.mIsCutAtInfoLocal && messageForLongMsg.atInfoList != null && messageForLongMsg.atInfoList.size() > 0) {
MessageForText.AtTroopMemberInfo atTroopMemberInfo = (MessageForText.AtTroopMemberInfo) messageForLongMsg.atInfoList.remove(0);
if (messageForLongMsg.f88923msg.length() > atTroopMemberInfo.textLen + 1) {
messageForLongMsg.f88923msg = messageForLongMsg.f88923msg.substring(atTroopMemberInfo.textLen + 1);
messageForLongMsg.sb = new QQText(messageForLongMsg.f88923msg, 13, 32, messageForLongMsg);
}
messageForLongMsg.mIsCutAtInfoLocal = true;
}
} else if (holder.f12945b != null) {
holder.f12945b.setVisibility(8);
}
a3.setOnTouchListener(onLongClickAndTouchListener);
a3.setOnLongClickListener(onLongClickAndTouchListener);
holder.f12941a.setOnTouchListener(onLongClickAndTouchListener);
holder.f12941a.setOnLongClickListener(onLongClickAndTouchListener);
if (TextUtils.isEmpty(messageForLongMsg.sb2)) {
holder.f12941a.setText(messageForLongMsg.sb);
} else {
holder.f12941a.setText(messageForLongMsg.sb2);
}
if (holder.f12941a instanceof AnimationTextView) {
AnimationTextView animationTextView3 = (AnimationTextView) holder.f12941a;
animationTextView3.f35165a = this.f12939a;
animationTextView3.f35166a = new mjt(this, chatMessage.isSend());
animationTextView3.setStrokeColor(false, 0);
}
if (holder.f12945b instanceof AnimationTextView) {
((AnimationTextView) holder.f12945b).f35165a = this.f12939a;
}
holder.f12942a = onLongClickAndTouchListener;
View a4 = a2 != 2 ? a(holder, chatMessage) : a3;
if ((this.f12266a instanceof FragmentActivity) && (chatFragment = ((FragmentActivity) this.f12266a).getChatFragment()) != null && (arkRecommendController = chatFragment.m2396a().f8376a) != null) {
holder.f12944a = arkRecommendController.a(this.f12266a, this.f12269a, this.f12271a, chatMessage, holder.f12944a, a4, baseChatItemLayout, onLongClickAndTouchListener);
}
return a4;
}
private View a(Holder holder, ChatMessage chatMessage) {
Resources resources = this.f12266a.getResources();
int a2 = AIOUtils.a(1.0f, resources);
AIOUtils.a(9.0f, resources);
int a3 = AIOUtils.a(12.0f, resources);
resources.getDrawable(R.drawable.f44126name_res_0x7f020bee).getIntrinsicHeight();
TextView textView = holder.f12941a;
if ((chatMessage instanceof RecommendCommonMessage) && ((RecommendCommonMessage) chatMessage).translationInfo.showTranslation) {
if (holder.f12940a == null) {
ImageView imageView = new ImageView(this.f12266a);
imageView.setImageDrawable(new ColorDrawable(838860800));
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, a2);
imageView.setLayoutParams(layoutParams);
imageView.setId(R.id.f47262name_res_0x7f0900b8);
ETTextView eTTextView = new ETTextView(this.f12266a);
ColorStateList colorStateList = chatMessage.isSend() ? resources.getColorStateList(R.color.f39347name_res_0x7f0b03b2) : resources.getColorStateList(R.color.f39344name_res_0x7f0b03af);
if (colorStateList != null) {
eTTextView.setTextColor(colorStateList);
}
eTTextView.setId(R.id.f47263name_res_0x7f0900b9);
RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(-2, -2);
eTTextView.setLayoutParams(layoutParams2);
ImageView imageView2 = new ImageView(this.f12266a);
imageView2.setId(R.id.f47264name_res_0x7f0900ba);
RelativeLayout.LayoutParams layoutParams3 = new RelativeLayout.LayoutParams(-2, -2);
imageView2.setLayoutParams(layoutParams3);
imageView2.setImageResource(R.drawable.f44126name_res_0x7f020bee);
imageView2.setScaleType(ImageView.ScaleType.CENTER);
layoutParams.addRule(3, R.id.f48415name_res_0x7f09053b);
layoutParams.addRule(14);
layoutParams2.addRule(3, R.id.f47262name_res_0x7f0900b8);
layoutParams3.addRule(3, R.id.f47263name_res_0x7f0900b9);
layoutParams3.addRule(5, R.id.f47263name_res_0x7f0900b9);
layoutParams3.addRule(7, R.id.f47263name_res_0x7f0900b9);
layoutParams3.addRule(14);
RelativeLayout relativeLayout = new RelativeLayout(this.f12266a);
relativeLayout.setId(R.id.f47261name_res_0x7f0900b7);
if (textView.getParent() != null) {
((ViewGroup) textView.getParent()).removeView(textView);
}
relativeLayout.addView(textView);
relativeLayout.addView(imageView);
relativeLayout.addView(imageView2);
relativeLayout.addView(eTTextView);
holder.f12940a = relativeLayout;
holder.f85800b = imageView2;
holder.f85799a = imageView;
holder.f85801c = eTTextView;
holder.f85801c.setVisibility(8);
holder.f85800b.setVisibility(8);
holder.f85799a.setVisibility(8);
holder.f85801c.setOnClickListener(this.f85798a);
holder.f85800b.setOnClickListener(this.f85798a);
holder.f85800b.setOnTouchListener(this.f12937a);
}
holder.f12941a.setId(R.id.f48415name_res_0x7f09053b);
holder.f12941a.setBackgroundDrawable(null);
holder.f12941a.setMinimumWidth(0);
holder.f12941a.setMinimumHeight(0);
holder.f12941a.setMaxWidth((BaseChatItemLayout.h - l) - k);
holder.f85801c.setMaxWidth((BaseChatItemLayout.h - l) - k);
if (holder.f12941a.getLayoutParams() != null && (holder.f12941a.getLayoutParams() instanceof RelativeLayout.LayoutParams)) {
((RelativeLayout.LayoutParams) holder.f12941a.getLayoutParams()).setMargins(0, 0, 0, 0);
}
holder.f12941a.setPadding(0, BaseChatItemLayout.p, 0, BaseChatItemLayout.q);
holder.f85801c.setVisibility(0);
holder.f85800b.setVisibility(0);
holder.f85799a.setVisibility(0);
holder.f85801c.setTextSize(0, this.f12269a.f85625b);
holder.f85801c.setPadding(0, BaseChatItemLayout.p, 0, ViewUtils.b(5.0f));
holder.f85800b.setPadding(0, 0, 0, a3);
String str = "[译文]\n" + ((RecommendCommonMessage) chatMessage).translationInfo.translation;
if (TextUtils.isEmpty(str)) {
holder.f85801c.setVisibility(8);
holder.f85799a.setVisibility(8);
holder.f85800b.setVisibility(8);
holder.f12941a.setPadding(0, 0, 0, 0);
} else {
float measureText = textView.getPaint().measureText(textView.getText().toString());
float measureText2 = holder.f85801c.getPaint().measureText(((RecommendCommonMessage) chatMessage).translationInfo.translation);
RelativeLayout.LayoutParams layoutParams4 = (RelativeLayout.LayoutParams) holder.f85799a.getLayoutParams();
if (measureText > measureText2) {
layoutParams4.addRule(5, R.id.f48415name_res_0x7f09053b);
layoutParams4.addRule(7, R.id.f48415name_res_0x7f09053b);
RelativeLayout.LayoutParams layoutParams5 = (RelativeLayout.LayoutParams) holder.f85801c.getLayoutParams();
layoutParams5.addRule(5, R.id.f48415name_res_0x7f09053b);
layoutParams5.addRule(7, R.id.f48415name_res_0x7f09053b);
} else {
layoutParams4.addRule(5, R.id.f47263name_res_0x7f0900b9);
layoutParams4.addRule(7, R.id.f47263name_res_0x7f0900b9);
RelativeLayout.LayoutParams layoutParams6 = (RelativeLayout.LayoutParams) holder.f85801c.getLayoutParams();
layoutParams6.addRule(5, R.id.f47263name_res_0x7f0900b9);
layoutParams6.addRule(7, R.id.f47263name_res_0x7f0900b9);
}
holder.f85801c.setText(new QQText(str, 13, 32, (MessageRecord) null));
if (holder.f85801c instanceof AnimationTextView) {
((AnimationTextView) holder.f85801c).f35165a = this.f12939a;
}
holder.f85801c.setOnLongClickListener(holder.f12942a);
holder.f85801c.setOnTouchListener(holder.f12942a);
holder.f12940a.setOnClickListener(this.f85798a);
holder.f12940a.setOnLongClickListener(holder.f12942a);
holder.f12940a.setOnTouchListener(holder.f12942a);
}
return holder.f12940a;
} else if (holder.f12940a != null) {
holder.f85801c.setVisibility(8);
holder.f85799a.setVisibility(8);
holder.f85800b.setVisibility(8);
holder.f12941a.setPadding(0, 0, 0, 0);
return holder.f12940a;
} else {
return holder.f12941a;
}
}
@Override
public void a(View view, ChatMessage chatMessage) {
if (chatMessage.isSend()) {
view.setPadding(l, i, k, j);
} else {
view.setPadding(k, i, l, j);
}
}
@Override
public void a(ChatMessage chatMessage, Context context, BaseChatItemLayout baseChatItemLayout, BaseBubbleBuilder.ViewHolder viewHolder, int i2, int i3) {
super.a(chatMessage, context, baseChatItemLayout, viewHolder, i2, i3);
}
public int a(MessageForLongMsg messageForLongMsg) {
return (messageForLongMsg == null || messageForLongMsg.mSourceMsgInfo == null) ? 1 : 2;
}
@Override
public int mo3176a(ChatMessage chatMessage) {
return 1;
}
@Override
public BaseBubbleBuilder.ViewHolder mo3144a() {
return new Holder();
}
public class Holder extends BaseBubbleBuilder.ViewHolder {
public ImageView f85799a;
public RelativeLayout f12940a;
TextView f12941a;
OnLongClickAndTouchListener f12942a;
protected ArkRecommendController.AttachAppHolder f12944a;
public ImageView f85800b;
TextView f12945b;
public TextView f85801c;
public Holder() {
}
}
@Override
public QQCustomMenuItem[] mo1986a(View view) {
MessageForLongMsg messageForLongMsg = (MessageForLongMsg) AIOUtils.m3035a(view);
QQCustomMenu qQCustomMenu = new QQCustomMenu();
if (messageForLongMsg.extraflag == 32768 && messageForLongMsg.isSendFromLocal()) {
qQCustomMenu.a(R.id.f56269name_res_0x7f0923ea, this.f12266a.getString(R.string.f63679name_res_0x7f0a149e), R.drawable.f41621name_res_0x7f020220);
qQCustomMenu.a(R.id.f56271name_res_0x7f0923ec, this.f12266a.getString(R.string.f63683name_res_0x7f0a14a2), R.drawable.f41633name_res_0x7f02022c);
} else {
qQCustomMenu.a(R.id.f56269name_res_0x7f0923ea, this.f12266a.getString(R.string.f64279name_res_0x7f0a16f6), R.drawable.f41621name_res_0x7f020220);
}
qQCustomMenu.a(R.id.f48355name_res_0x7f0904ff, this.f12266a.getString(R.string.f64273name_res_0x7f0a16f0), R.drawable.f41629name_res_0x7f020228);
if (messageForLongMsg.istroop == 1) {
if (AIOUtils.a(4) == 1) {
qQCustomMenu.a(R.id.f56284name_res_0x7f0923f9, this.f12266a.getString(R.string.f61404name_res_0x7f0a0bb9), R.drawable.f41639name_res_0x7f020232);
}
a(messageForLongMsg, qQCustomMenu);
}
if (!messageForLongMsg.isSend()) {
b(messageForLongMsg, qQCustomMenu);
}
if (AIOUtils.a(5) == 1) {
qQCustomMenu.a(R.id.f50849name_res_0x7f090ebd, this.f12266a.getString(R.string.f62165name_res_0x7f0a0eb2), R.drawable.f41628name_res_0x7f020227);
}
qQCustomMenu.a(R.id.f56280name_res_0x7f0923f5, this.f12266a.getString(R.string.f66511name_res_0x7f0a1fb3), R.drawable.f42260name_res_0x7f02049f);
if (messageForLongMsg.vipBubbleID == T9SearchSortWeight.e && !messageForLongMsg.isSend()) {
qQCustomMenu.a(R.id.f56282name_res_0x7f0923f7, this.f12266a.getString(R.string.f65188name_res_0x7f0a1a88), R.drawable.f41606name_res_0x7f020211);
}
if ((messageForLongMsg instanceof RecommendCommonMessage) && a(messageForLongMsg) != 2 && Pattern.compile("[A-Za-z]+").matcher(messageForLongMsg.f88923msg).find()) {
if (!messageForLongMsg.translationInfo.showTranslation) {
qQCustomMenu.a(R.id.f56281name_res_0x7f0923f6, this.f12266a.getString(R.string.f64283name_res_0x7f0a16fa), R.drawable.f41606name_res_0x7f020211);
} else {
qQCustomMenu.a(R.id.f56281name_res_0x7f0923f6, this.f12266a.getString(R.string.f64284name_res_0x7f0a16fb), R.drawable.f41606name_res_0x7f020211);
}
}
if (messageForLongMsg.extraflag != 32768 && !this.f12271a.m4654a().m7764b((MessageRecord) messageForLongMsg)) {
a(qQCustomMenu, this.f12269a.f85624a, messageForLongMsg);
}
if (messageForLongMsg.isSend()) {
b(messageForLongMsg, qQCustomMenu);
}
ChatActivityFacade.a(qQCustomMenu, this.f12266a, this.f12269a.f85624a);
super.b(qQCustomMenu, this.f12266a);
return qQCustomMenu.m9452a();
}
@Override
public void a(int i2, Context context, ChatMessage chatMessage) {
switch (i2) {
case R.id.f47195name_res_0x7f09006e:
super.m3057a(chatMessage);
return;
case R.id.f48355name_res_0x7f0904ff:
Bundle bundle = new Bundle();
bundle.putInt(AppConstants.Key.G, -1);
bundle.putString(AppConstants.Key.F, MessageForMixedMsg.getTextFromMixedMsg(chatMessage).toString());
Intent intent = new Intent();
intent.putExtras(bundle);
ForwardBaseOption.a((Activity) this.f12266a, intent, 21);
ReportController.b(this.f12271a, "dc01331", "", "", "0X8004045", "0X8004045", 0, 0, "", "", "", "");
return;
case R.id.f50849name_res_0x7f090ebd:
m3159a((MessageForLongMsg) chatMessage);
ReportUtils.a(this.f12271a, ReportConstants.m, ReportConstants.B, "Favorite", "0X8007CC2");
return;
case R.id.f56264name_res_0x7f0923e5:
ChatActivityFacade.b(this.f12266a, this.f12271a, chatMessage);
return;
case R.id.f56269name_res_0x7f0923ea:
if ((chatMessage instanceof RecommendCommonMessage) && ((RecommendCommonMessage) chatMessage).translationInfo.showTranslation) {
ReportController.b(this.f12271a, "dc01331", "", "", "0x80092BE", "0x80092BE", 0, 0, "", "", "", "");
}
((ClipboardManager) this.f12266a.getSystemService("clipboard")).setText(MessageForMixedMsg.getTextFromMixedMsg(chatMessage));
return;
case R.id.f56271name_res_0x7f0923ec:
ChatActivityFacade.a(this.f12271a, this.f12266a, this.f12269a, (MessageForLongMsg) chatMessage);
return;
case R.id.f56273name_res_0x7f0923ee:
super.b(chatMessage);
return;
case R.id.f56280name_res_0x7f0923f5:
((MailPluginManager) this.f12271a.getManager(QQAppInterface.cb)).a(chatMessage);
ReportUtils.a(this.f12271a, ReportConstants.n, ReportConstants.H, ReportConstants.J, "0X8009278");
return;
case R.id.f56281name_res_0x7f0923f6:
if ((chatMessage instanceof RecommendCommonMessage) && !((RecommendCommonMessage) chatMessage).translationInfo.showTranslation) {
ReportController.b(this.f12271a, "dc01331", "", "", "0x80092BB", "0x80092BB", 0, 0, "", "", "", "");
if (NetworkUtil.h(this.f12266a)) {
((TranslateHandler) this.f12271a.getBusinessHandler(108)).a(TranslateHandler.f93687b, TranslateHandler.f93688c, chatMessage);
} else {
ChatActivityUtils.a(this.f12266a, (int) R.string.f64215name_res_0x7f0a16b6, 0);
}
if (!this.f12271a.getBusinessObserver(1).contains(this.f12938a)) {
this.f12271a.addObserver(this.f12938a);
return;
}
return;
} else if ((chatMessage instanceof RecommendCommonMessage) && ((RecommendCommonMessage) chatMessage).translationInfo.showTranslation) {
ReportController.b(this.f12271a, "dc01331", "", "", "0x80092BC", "0x80092BC", 0, 0, "", "", "", "");
((RecommendCommonMessage) chatMessage).translationInfo.showTranslation = false;
((RecommendCommonMessage) chatMessage).saveTranslationInfo(new WeakReference(this.f12271a));
int unused = i;
return;
} else {
return;
}
case R.id.f56282name_res_0x7f0923f7:
StatisticCollector.a((Context) BaseApplication.getContext()).a(this.f12271a, this.f12271a.getCurrentAccountUin(), "", "Translate_external", "Clk_about_translate", 0, 1, 0);
Intent intent2 = new Intent(this.f12266a, QQBrowserActivity.class);
String account = this.f12271a.getAccount();
if (account != null && account.length() > 0) {
intent2.putExtra("uin", this.f12271a.getCurrentAccountUin());
}
intent2.putExtra("url", "http://183.62.127.31/MobileQQ/translate.html");
this.f12266a.startActivity(intent2);
return;
default:
super.a(i2, context, chatMessage);
return;
}
}
protected void m3159a(MessageForLongMsg messageForLongMsg) {
if ((messageForLongMsg instanceof RecommendCommonMessage) && messageForLongMsg.translationInfo.showTranslation) {
ReportController.b(this.f12271a, "dc01331", "", "", "0x80092C0", "0x80092C0", 0, 0, "", "", "", "");
QfavBuilder.a((String) null, messageForLongMsg.f88923msg + "\n[译文]\n" + messageForLongMsg.translationInfo.translation).b(this.f12271a, messageForLongMsg).a((Activity) this.f12266a, this.f12271a.getAccount());
} else {
QfavBuilder.b(messageForLongMsg).b(this.f12271a, messageForLongMsg).a((Activity) this.f12266a, this.f12271a.getAccount());
}
QfavReport.a(this.f12271a, 6, 8);
ReportUtils.a(this.f12271a, ReportConstants.m, ReportConstants.B, "Favorite", "0X8007CC2");
}
@Override
public void mo3056a(View view) {
super.mo3056a(view);
if (!AIOUtils.m3035a(view).isMultiMsg) {
MessageForLongMsg messageForLongMsg = (MessageForLongMsg) AIOUtils.m3035a(view);
String string = this.f12266a.getString(R.string.f63600name_res_0x7f0a144f);
String string2 = this.f12266a.getString(R.string.f63601name_res_0x7f0a1450);
if (messageForLongMsg.isSendFromLocal()) {
DialogUtil.a(this.f12266a, 230, string, string2, new mjv(this, messageForLongMsg), new mjw(this)).show();
}
}
}
@Override
public void a(BaseBubbleBuilder.ViewHolder viewHolder, View view, ChatMessage chatMessage, BubbleInfo bubbleInfo) {
Holder holder = (Holder) viewHolder;
if (bubbleInfo.f88343c == 0 || !bubbleInfo.m5394a()) {
Resources resources = view.getResources();
ColorStateList colorStateList = chatMessage.isSend() ? resources.getColorStateList(R.color.f39347name_res_0x7f0b03b2) : resources.getColorStateList(R.color.f39344name_res_0x7f0b03af);
if (colorStateList != null) {
holder.f12941a.setTextColor(colorStateList);
if (holder.f12945b != null) {
holder.f12945b.setTextColor(colorStateList);
}
if (holder.f85801c != null) {
holder.f85801c.setTextColor(colorStateList);
}
}
ColorStateList colorStateList2 = chatMessage.isSend() ? resources.getColorStateList(R.color.f39346name_res_0x7f0b03b1) : resources.getColorStateList(R.color.f39345name_res_0x7f0b03b0);
holder.f12941a.setLinkTextColor(colorStateList2);
if (holder.f12945b != null) {
holder.f12945b.setLinkTextColor(colorStateList2);
ImmersiveUtils.a(holder.f12945b, 0.5f);
return;
}
return;
}
if (bubbleInfo.d == 0) {
holder.f12941a.setTextColor(-16777216);
if (holder.f12945b != null) {
holder.f12945b.setTextColor(-16777216);
}
if (holder.f85801c != null) {
holder.f85801c.setTextColor(-16777216);
}
} else {
holder.f12941a.setTextColor(bubbleInfo.d);
if (holder.f12945b != null) {
holder.f12945b.setTextColor(bubbleInfo.d);
}
if (holder.f85801c != null) {
holder.f85801c.setTextColor(bubbleInfo.d);
}
}
if (bubbleInfo.e == 0) {
ColorStateList colorStateList3 = view.getResources().getColorStateList(R.color.f39345name_res_0x7f0b03b0);
holder.f12941a.setLinkTextColor(colorStateList3);
if (holder.f12945b != null) {
holder.f12945b.setLinkTextColor(colorStateList3);
}
if (holder.f85801c != null) {
holder.f85801c.setLinkTextColor(colorStateList3);
}
} else {
holder.f12941a.setLinkTextColor(bubbleInfo.e);
if (holder.f12945b != null) {
holder.f12945b.setLinkTextColor(bubbleInfo.e);
}
if (holder.f85801c != null) {
holder.f85801c.setLinkTextColor(bubbleInfo.e);
}
}
if (bubbleInfo.f20094a && (holder.f12941a instanceof AnimationTextView)) {
((AnimationTextView) holder.f12941a).setStrokeColor(true, bubbleInfo.f);
if (QLog.isColorLevel()) {
QLog.d(f85581a, 2, "bubble has stroke, color = " + bubbleInfo.f);
}
}
ImmersiveUtils.a(holder.f12945b, 0.5f);
}
@Override
public String mo3055a(ChatMessage chatMessage) {
return "说" + com.tencent.mobileqq.text.TextUtils.c(chatMessage.f88923msg);
}
public LinearLayout a(Context context, Holder holder) {
LinearLayout linearLayout = new LinearLayout(context);
linearLayout.setOrientation(1);
TextView a2 = ReplyTextItemBuilder.a(context);
linearLayout.addView(a2);
holder.f12945b = a2;
AnimationTextView animationTextView = new AnimationTextView(context);
animationTextView.setTextColor(context.getResources().getColorStateList(R.color.f39344name_res_0x7f0b03af));
animationTextView.setMaxWidth(BaseChatItemLayout.h);
animationTextView.setSpannableFactory(QQText.f30368a);
animationTextView.setMovementMethod(LinkMovementMethod.getInstance());
animationTextView.setId(R.id.f48415name_res_0x7f09053b);
linearLayout.addView(animationTextView);
holder.f12941a = animationTextView;
return linearLayout;
}
}