QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 MCMessageUI4Layout.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.taf.JceUtil;
import com.tencent.mtt.account.base.IAccount;
import com.tencent.mtt.base.MTT.FeedBackMsgReq;
import com.tencent.mtt.base.MTT.MCButton;
import com.tencent.mtt.base.MTT.MCDetailMsg;
import com.tencent.mtt.base.MTT.MCHeaderInfoComponent;
import com.tencent.mtt.base.MTT.MCInteractUI1;
import com.tencent.mtt.base.MTT.MCMessage;
import com.tencent.mtt.base.MTT.MCMessageUI4;
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.IBasePresenter;
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.second.ISecondPresenter;
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.mtt.view.widget.QBStyledButtonView;
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 MCMessageUI4Layout extends QBRelativeLayout implements View.OnClickListener, ILetterItem {
private static final int h = MttResources.h(f.cR);
public String f72166a;
private QBWebImageView f72167b;
private QBFrameLayout f72168c;
private RoundImageView f72169d;
private QBTextView e;
private QBRelativeLayout f;
private QBStyledButtonView 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 MCMessage<MCMessageUI4> w;
private IItemInnerListener x;
private MCDetailMsg y;
public static class MessageUI4Presenter implements IItemInnerListener {
private ISecondPresenter f72172a;
public MessageUI4Presenter(IBasePresenter iBasePresenter) {
this.f72172a = (ISecondPresenter) iBasePresenter;
}
@Override
public void a(MCDetailMsg mCDetailMsg, IItemInnerCallback iItemInnerCallback) {
MCMessage mCMessage = mCDetailMsg.stMessage;
MCMessageUI4 mCMessageUI4 = (MCMessageUI4) mCMessage.getExtJce(MCMessageUI4.class);
FeedBackMsgReq feedBackMsgReq = new FeedBackMsgReq();
feedBackMsgReq.iBusinessId = mCMessage.iBusinessID;
feedBackMsgReq.sMsgId = mCMessage.sMsgID;
feedBackMsgReq.sInteractId = mCMessageUI4.stButton.sInteractId;
feedBackMsgReq.stUserInfo = MessageCenterUtil.a();
feedBackMsgReq.vMessageUIBytes = JceUtil.jce2Bytes(mCMessageUI4);
feedBackMsgReq.iMessageUIId = mCMessage.iMessageUIId;
this.f72172a.a(feedBackMsgReq);
}
}
public MCMessageUI4Layout(Context context, IItemInnerListener iItemInnerListener) {
super(context, false);
this.f72169d = 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.t);
this.n = MttResources.h(f.e);
this.o = MttResources.h(f.k);
this.p = MttResources.h(f.ap);
this.q = MttResources.h(f.v);
this.r = MttResources.h(f.ag);
this.s = 1280;
this.f72166a = "";
this.t = "";
this.u = null;
this.v = new SpannableStringBuilder();
this.x = null;
this.u = ((IAccount) SDKContext.getInstance().getService(IAccount.class)).getCurrentUserInfo();
this.x = iItemInnerListener;
this.s = DeviceUtils.af();
this.f72168c = new QBFrameLayout(context);
this.f72168c.setId(100);
int i = this.j;
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(i, i);
layoutParams.topMargin = this.k;
layoutParams.leftMargin = this.i;
addView(this.f72168c, layoutParams);
this.f72169d = new RoundImageView(context, 0);
this.f72169d.setUseMaskForNightMode(true);
this.f72169d.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
this.f72169d.setOnClickListener(this);
int i2 = this.j;
this.f72168c.addView(this.f72169d, new RelativeLayout.LayoutParams(i2, i2));
this.f72167b = new QBWebImageView(context);
this.f72167b.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.f72167b.setVisibility(8);
SimpleSkinBuilder.a((ImageView) this.f72167b).f();
this.f72168c.addView(this.f72167b, 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.p;
layoutParams3.leftMargin = this.o;
addView(this.f, layoutParams3);
this.g = new QBStyledButtonView(context, 7);
this.g.setId(104);
this.g.setTextSize(MttResources.h(f.cQ));
this.g.setText("同意");
RelativeLayout.LayoutParams layoutParams4 = new RelativeLayout.LayoutParams(this.r, MttResources.h(f.E));
layoutParams4.addRule(11);
layoutParams4.addRule(15);
layoutParams4.rightMargin = this.i;
this.f.addView(this.g, layoutParams4);
this.e = new QBTextView(context);
this.e.setId(101);
this.e.setUseMaskForNightMode(true);
this.e.setIncludeFontPadding(false);
this.e.setLineSpacing(this.n, 1.0f);
this.e.setTextColorNormalIds(e.f85871a);
this.e.setTextSize(h);
this.e.setMovementMethod(LinkMovementMethod.getInstance());
RelativeLayout.LayoutParams layoutParams5 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams5.addRule(0, 104);
layoutParams5.addRule(9);
layoutParams5.rightMargin = this.q;
layoutParams5.leftMargin = this.m;
int i3 = this.l;
layoutParams5.topMargin = i3;
layoutParams5.bottomMargin = i3;
this.f.addView(this.e, layoutParams5);
}
private void a(ArrayList<MCTextComponent> arrayList) {
Iterator<MCTextComponent> it = arrayList.iterator();
int i = 0;
while (it.hasNext()) {
MCTextComponent next = it.next();
String str = next.sContent;
this.v.append((CharSequence) str);
String str2 = next.sTextUrl;
int i2 = e.f85871a;
if (next.eColor == 2) {
i2 = e.f85874c;
} else if (next.eColor == 3) {
i2 = e.g;
} else if (next.eColor == 4) {
i2 = e.f;
}
this.v.setSpan(!TextUtils.isEmpty(str2) ? new NoLineClickableSpan(str2, MttResources.d(i2), this.w.sMsgID) : new ForegroundColorSpan(MttResources.d(i2)), i, str.length() + i, 33);
i += str.length();
}
}
@Override
public void a(final MCDetailMsg mCDetailMsg) {
if (mCDetailMsg == null || mCDetailMsg.stSenderInfo == null || mCDetailMsg.stMessage == null) {
return;
}
MCUserInfo mCUserInfo = mCDetailMsg.stSenderInfo;
this.w = mCDetailMsg.stMessage;
MCMessageUI4 extJce = this.w.getExtJce(MCMessageUI4.class);
if (extJce == null) {
return;
}
this.v.clear();
ArrayList<MCTextComponent> arrayList = extJce.vTextItems;
MCInteractUI1 mCInteractUI1 = (MCInteractUI1) JceUtil.parseRawData(MCInteractUI1.class, this.w.vInteractUIData);
MCButton mCButton = extJce.stButton;
if (mCInteractUI1 != null && mCInteractUI1.stButton != null) {
mCButton = mCInteractUI1.stButton;
}
MCHeaderInfoComponent mCHeaderInfoComponent = extJce.stHeader;
this.t = mCHeaderInfoComponent.sUrl;
if (TextUtils.isEmpty(this.t)) {
this.t = mCUserInfo.sHomePageUrl;
}
if (arrayList.size() <= 0) {
return;
}
this.y = mCDetailMsg;
a(arrayList);
this.e.setText(MessageCenterUtil.a(this.v.toString(), h, this.v));
this.g.setText(mCButton.sText);
if (mCButton.iState == 0) {
this.g.setEnabled(false);
} else {
this.g.setEnabled(true);
this.g.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
EventCollector.getInstance().onViewClickedBefore(view);
MCMessageUI4Layout.this.g.setEnabled(false);
MCMessageUI4Layout.this.g.setText("已同意");
if (MCMessageUI4Layout.this.x != null) {
MCMessageUI4Layout.this.x.a(mCDetailMsg, null);
}
EventCollector.getInstance().onViewClicked(view);
}
});
}
String str = mCHeaderInfoComponent.sFace;
if (TextUtils.isEmpty(str)) {
str = mCUserInfo.sIconUrl;
}
if (TextUtils.isEmpty(str)) {
this.f72169d.setImageDrawableId(g.cd);
} else {
this.f72169d.setUrl(str);
}
if (mCUserInfo.bVip) {
this.f72167b.setVisibility(0);
} else {
this.f72167b.setVisibility(8);
}
}
@Override
public int b(MCDetailMsg mCDetailMsg) {
MCMessageUI4 mCMessageUI4;
MCMessage mCMessage = mCDetailMsg.stMessage;
if (mCMessage == null || (mCMessageUI4 = (MCMessageUI4) mCMessage.getExtJce(MCMessageUI4.class)) == null) {
return 0;
}
this.v.clear();
ArrayList<MCTextComponent> arrayList = mCMessageUI4.vTextItems;
if (arrayList.size() <= 0) {
return 0;
}
Iterator<MCTextComponent> it = arrayList.iterator();
while (it.hasNext()) {
this.v.append((CharSequence) it.next().sContent);
}
int i = this.s - this.j;
int i2 = this.i;
return MessageCenterUtil.a(this.e, this.v.toString(), ((((((i - i2) - this.o) - this.m) - this.q) - this.r) - i2) - this.p, 150, false) + (this.l * 2) + this.k;
}
@Override
public String getJumpUr() {
return this.f72166a;
}
@Override
public void onClick(View view) {
EventCollector.getInstance().onViewClickedBefore(view);
new UrlParams(this.t).b(1).c(0).d(true).e();
MCDetailMsg mCDetailMsg = this.y;
if (mCDetailMsg != null && mCDetailMsg.stSenderInfo != null) {
StatManager.b().c("CFHX028_" + this.y.stSenderInfo.sUid);
}
EventCollector.getInstance().onViewClicked(view);
}
}