QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 MCMessageUI10Layout.java 源代码,内容仅作参考
package com.tencent.mtt.ui.items;
import android.content.Context;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.text.style.ForegroundColorSpan;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import com.tencent.mtt.account.base.IAccount;
import com.tencent.mtt.base.MTT.MCDetailMsg;
import com.tencent.mtt.base.MTT.MCHeaderInfoComponent;
import com.tencent.mtt.base.MTT.MCMessage;
import com.tencent.mtt.base.MTT.MCMessageUI10;
import com.tencent.mtt.base.MTT.MCTextComponent;
import com.tencent.mtt.base.MTT.MCUserInfo;
import com.tencent.mtt.base.account.AccountInfo;
import com.tencent.mtt.base.skin.MttResources;
import com.tencent.mtt.base.stat.StatManager;
import com.tencent.mtt.base.ui.widget.QBWebImageView;
import com.tencent.mtt.base.utils.DeviceUtils;
import com.tencent.mtt.browser.window.UrlParams;
import com.tencent.mtt.newskin.SimpleSkinBuilder;
import com.tencent.mtt.sdkcontext.SDKContext;
import com.tencent.mtt.ui.base.BubbleBgRelativeLayout;
import com.tencent.mtt.ui.base.ILetterItem;
import com.tencent.mtt.ui.base.NoLineClickableSpan;
import com.tencent.mtt.ui.base.RoundImageView;
import com.tencent.mtt.ui.base.UserMessageConstant;
import com.tencent.mtt.ui.util.MessageCenterUtil;
import com.tencent.mtt.view.common.QBTextView;
import com.tencent.mtt.view.layout.QBFrameLayout;
import com.tencent.mtt.view.layout.QBRelativeLayout;
import com.tencent.qqlive.module.videoreport.collect.EventCollector;
import java.util.ArrayList;
import java.util.Iterator;
import qb.a.e;
import qb.a.f;
import qb.a.g;
public class MCMessageUI10Layout extends QBRelativeLayout implements View.OnClickListener, ILetterItem {
private static final int h = MttResources.h(f.cR);
public String f72161a;
private RoundImageView f72162b;
private RoundImageView f72163c;
private QBTextView f72164d;
private QBTextView e;
private QBRelativeLayout f;
private QBRelativeLayout g;
private int i;
private int j;
private int k;
private int l;
private int m;
private int n;
private int o;
private int p;
private int q;
private int r;
private int s;
private String t;
private AccountInfo u;
private SpannableStringBuilder v;
private MCDetailMsg w;
private QBWebImageView x;
private QBFrameLayout y;
public MCMessageUI10Layout(Context context) {
super(context, false);
this.f72162b = null;
this.f72163c = null;
this.f72164d = null;
this.e = null;
this.f = null;
this.g = null;
this.i = MttResources.h(f.n);
this.j = MttResources.h(f.P);
this.k = MttResources.h(f.r);
this.l = MttResources.h(f.l);
this.m = MttResources.h(f.s);
this.n = MttResources.h(f.m);
this.o = MttResources.h(f.e);
this.p = MttResources.h(f.k);
this.q = MttResources.h(f.ap);
this.r = MttResources.h(f.aB);
this.s = 1280;
this.f72161a = "";
this.t = "";
this.u = null;
this.v = new SpannableStringBuilder();
this.u = ((IAccount) SDKContext.getInstance().getService(IAccount.class)).getCurrentUserInfo();
this.s = DeviceUtils.af();
this.y = new QBFrameLayout(context);
this.y.setId(100);
this.y.setVisibility(8);
int i = this.j;
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(i, i);
layoutParams.topMargin = this.k;
layoutParams.leftMargin = this.i;
addView(this.y, layoutParams);
this.f72162b = new RoundImageView(context, 0);
this.f72162b.setVisibility(8);
this.f72162b.setUseMaskForNightMode(true);
this.f72162b.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
this.f72162b.setOnClickListener(this);
int i2 = this.j;
this.y.addView(this.f72162b, new RelativeLayout.LayoutParams(i2, i2));
this.x = new QBWebImageView(context);
this.x.setUrl("https://res.imtt.qq.com/res_mtt/mcenter/message_center_v.png");
FrameLayout.LayoutParams layoutParams2 = new FrameLayout.LayoutParams(UserMessageConstant.f72095a, UserMessageConstant.f72095a);
layoutParams2.gravity = 85;
this.x.setVisibility(8);
SimpleSkinBuilder.a((ImageView) this.x).f();
this.y.addView(this.x, layoutParams2);
this.f = new BubbleBgRelativeLayout(context, true);
this.f.setId(105);
RelativeLayout.LayoutParams layoutParams3 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams3.addRule(1, 100);
layoutParams3.addRule(6, 100);
layoutParams3.rightMargin = this.q;
layoutParams3.leftMargin = this.p;
addView(this.f, layoutParams3);
this.f72164d = new QBTextView(context, false);
this.f72164d.setVisibility(8);
this.f72164d.setId(101);
this.f72164d.setUseMaskForNightMode(true);
this.f72164d.setIncludeFontPadding(false);
this.f72164d.setLineSpacing(this.o, 1.0f);
this.f72164d.setTextColorNormalIds(e.f85871a);
this.f72164d.setTextSize(h);
this.f72164d.setMovementMethod(LinkMovementMethod.getInstance());
QBTextView qBTextView = this.f72164d;
int i3 = this.m;
int i4 = this.l;
qBTextView.setPadding(i3, i4, this.n, i4);
this.f.addView(this.f72164d, new RelativeLayout.LayoutParams(-2, -2));
this.f72163c = new RoundImageView(context, 0);
this.f72163c.setVisibility(8);
this.f72163c.setId(103);
this.f72163c.setUseMaskForNightMode(true);
this.f72163c.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
int i5 = this.j;
RelativeLayout.LayoutParams layoutParams4 = new RelativeLayout.LayoutParams(i5, i5);
layoutParams4.topMargin = this.k;
layoutParams4.rightMargin = this.i;
layoutParams4.addRule(11);
addView(this.f72163c, layoutParams4);
this.g = new BubbleBgRelativeLayout(context, false);
this.g.setId(104);
RelativeLayout.LayoutParams layoutParams5 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams5.addRule(0, 103);
layoutParams5.addRule(6, 103);
layoutParams5.rightMargin = this.p;
layoutParams5.leftMargin = this.q;
addView(this.g, layoutParams5);
this.e = new QBTextView(context);
this.e.setVisibility(8);
this.e.setId(104);
this.e.setUseMaskForNightMode(true);
this.e.setIncludeFontPadding(false);
this.e.setLineSpacing(this.o, 1.0f);
this.e.setTextColorNormalIds(e.r);
this.e.setTextSize(h);
this.e.setMovementMethod(LinkMovementMethod.getInstance());
QBTextView qBTextView2 = this.e;
int i6 = this.n;
int i7 = this.l;
qBTextView2.setPadding(i6, i7, this.m, i7);
this.e.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
@Override
public void onLayoutChange(View view, int i8, int i9, int i10, int i11, int i12, int i13, int i14, int i15) {
if ((i8 == i12 && i9 == i13 && i10 == i14 && i11 == i15) || MCMessageUI10Layout.this.e.getLineCount() <= 1 || MCMessageUI10Layout.this.e.getGravity() == 3) {
return;
}
MCMessageUI10Layout.this.e.setGravity(3);
}
});
this.g.addView(this.e, new RelativeLayout.LayoutParams(-2, -2));
}
private int a(MCTextComponent mCTextComponent) {
return mCTextComponent.eColor == 2 ? e.f85874c : mCTextComponent.eColor == 3 ? e.g : mCTextComponent.eColor == 4 ? e.f : e.f85871a;
}
private void a(MCUserInfo mCUserInfo, String str) {
if (TextUtils.equals(mCUserInfo.sUid, MessageCenterUtil.b())) {
this.y.setVisibility(8);
this.f72164d.setVisibility(8);
this.e.setText(MessageCenterUtil.a(this.v.toString(), h, this.v));
this.f72163c.setVisibility(0);
this.e.setVisibility(0);
if (TextUtils.isEmpty(str) || mCUserInfo.sIconUrl.length() <= 5) {
this.f72163c.setImageDrawableId(g.cd);
return;
} else {
this.f72163c.setUrl(str);
return;
}
}
this.y.setVisibility(0);
this.f72164d.setVisibility(0);
this.f72164d.setText(MessageCenterUtil.a(this.v.toString(), h, this.v));
this.f72163c.setVisibility(8);
this.e.setVisibility(8);
if (TextUtils.isEmpty(str) || mCUserInfo.sIconUrl.length() <= 5) {
this.f72162b.setImageDrawableId(g.cd);
} else {
this.f72162b.setUrl(str);
}
if (mCUserInfo.bVip) {
this.x.setVisibility(0);
} else {
this.x.setVisibility(8);
}
}
@Override
public void a(MCDetailMsg mCDetailMsg) {
String str;
if (mCDetailMsg == null || mCDetailMsg.stSenderInfo == null || mCDetailMsg.stMessage == null) {
return;
}
MCUserInfo mCUserInfo = mCDetailMsg.stSenderInfo;
MCMessage mCMessage = mCDetailMsg.stMessage;
MCMessageUI10 mCMessageUI10 = (MCMessageUI10) mCMessage.getExtJce(MCMessageUI10.class);
if (mCMessageUI10 == null) {
return;
}
MCHeaderInfoComponent mCHeaderInfoComponent = mCMessageUI10.stHeader;
if (mCHeaderInfoComponent == null || TextUtils.isEmpty(mCHeaderInfoComponent.sFace) || TextUtils.isEmpty(mCHeaderInfoComponent.sUrl)) {
this.t = mCUserInfo.sHomePageUrl;
str = mCUserInfo.sIconUrl;
} else {
this.t = mCHeaderInfoComponent.sUrl;
str = mCHeaderInfoComponent.sFace;
}
this.v.clear();
ArrayList<MCTextComponent> arrayList = mCMessageUI10.vTextItems;
if (arrayList == null || arrayList.size() <= 0) {
return;
}
this.w = mCDetailMsg;
int i = 0;
Iterator<MCTextComponent> it = arrayList.iterator();
while (it.hasNext()) {
MCTextComponent next = it.next();
String str2 = next.sContent;
this.v.append((CharSequence) str2);
String str3 = next.sTextUrl;
int a2 = a(next);
this.v.setSpan(!TextUtils.isEmpty(str3) ? new NoLineClickableSpan(str3, MttResources.d(a2), mCMessage.sMsgID) : new ForegroundColorSpan(MttResources.d(a2)), i, str2.length() + i, 33);
i += str2.length();
}
a(mCUserInfo, str);
}
@Override
public int b(MCDetailMsg mCDetailMsg) {
MCMessage mCMessage;
MCMessageUI10 mCMessageUI10;
if (mCDetailMsg == null || mCDetailMsg.stSenderInfo == null || (mCMessage = mCDetailMsg.stMessage) == null || (mCMessageUI10 = (MCMessageUI10) mCMessage.getExtJce(MCMessageUI10.class)) == null) {
return 0;
}
this.v.clear();
ArrayList<MCTextComponent> arrayList = mCMessageUI10.vTextItems;
if (arrayList == null || arrayList.size() <= 0) {
return 0;
}
Iterator<MCTextComponent> it = arrayList.iterator();
while (it.hasNext()) {
this.v.append((CharSequence) it.next().sContent);
}
return MessageCenterUtil.a(this.f72164d, this.v.toString(), (((((this.s - this.m) - this.n) - this.q) - this.p) - this.j) - this.i, 150, false) + (this.l * 2) + this.k;
}
@Override
public String getJumpUr() {
return this.f72161a;
}
@Override
public void onClick(View view) {
EventCollector.getInstance().onViewClickedBefore(view);
new UrlParams(this.t).b(1).c(0).d(true).e();
MCDetailMsg mCDetailMsg = this.w;
if (mCDetailMsg != null && mCDetailMsg.stSenderInfo != null) {
StatManager.b().c("CFHX028_" + this.w.stSenderInfo.sUid);
}
EventCollector.getInstance().onViewClicked(view);
}
}