QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 ChatSettingNativePage.java 源代码,内容仅作参考
package com.tencent.mtt.msgcenter.personalmsg.setting;
import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import com.tencent.common.threadpool.BrowserExecutorSupplier;
import com.tencent.mtt.R;
import com.tencent.mtt.account.base.IAccount;
import com.tencent.mtt.base.account.AccountInfo;
import com.tencent.mtt.base.nativeframework.NativePage;
import com.tencent.mtt.base.skin.MttResources;
import com.tencent.mtt.browser.window.IPage;
import com.tencent.mtt.browser.window.UrlParams;
import com.tencent.mtt.browser.window.templayer.BaseNativeGroup;
import com.tencent.mtt.businesscenter.facade.IFrameworkDelegate;
import com.tencent.mtt.msgcenter.MsgCenterReportManager;
import com.tencent.mtt.msgcenter.MsgCenterTitleBarBase;
import com.tencent.mtt.msgcenter.personalmsg.chat.view.ChatLoadingDialogUtils;
import com.tencent.mtt.msgcenter.personalmsg.chat.view.ChatPageParams;
import com.tencent.mtt.msgcenter.personalmsg.chat.view.ChatUserInfo;
import com.tencent.mtt.qbcontext.core.QBContext;
import com.tencent.mtt.resource.UIContextWrapper;
import com.tencent.mtt.sdkcontext.SDKContext;
import com.tencent.mtt.ui.base.RoundImageView;
import com.tencent.mtt.view.common.QBImageView;
import com.tencent.mtt.view.common.QBTextView;
import com.tencent.mtt.view.common.QBViewResourceManager;
import com.tencent.mtt.view.dialog.alert.MttLoadingDialog;
import com.tencent.mtt.view.dialog.alert.QBAlertDialogBase;
import com.tencent.mtt.view.layout.QBLinearLayout;
import com.tencent.mtt.view.layout.QBRelativeLayout;
import com.tencent.mtt.view.toast.MttToaster;
import com.tencent.mtt.view.widget.QBSwitch;
import com.tencent.qqlive.module.videoreport.collect.EventCollector;
import org.json.JSONException;
import org.json.JSONObject;
import qb.a.e;
import qb.a.f;
import qb.a.g;
public class ChatSettingNativePage extends NativePage implements IChatSettingView, QBSwitch.OnSwitchListener {
private ChatPageParams k;
private MsgCenterTitleBarBase l;
private ChatSettingPresenter m;
private QBTextView p;
private RoundImageView q;
private QBLinearLayout r;
private QBSwitch s;
private String t;
private String u;
private String v;
private ChatUserInfo w;
private ChatUserInfo x;
private boolean y;
private MttLoadingDialog z;
public static final int f68302a = MttResources.h(f.Y);
public static final int f68303b = MttResources.h(f.r);
public static final int f68304c = MttResources.h(f.f85878b);
public static final int f68305d = MttResources.h(f.p);
public static final int e = MttResources.h(f.cR);
public static final CharSequence f = MttResources.n(R.string.bu6);
public static final String g = MttResources.l(R.string.avv);
public static final int h = MttResources.h(f.at);
public static final int i = MttResources.h(f.p);
private static final int n = MttResources.h(f.v);
private static final int o = MttResources.h(f.Y);
public static final int j = MttResources.h(f.V);
public ChatSettingNativePage(Context context, BaseNativeGroup baseNativeGroup, ChatPageParams chatPageParams) {
super(context, new FrameLayout.LayoutParams(-1, -1), baseNativeGroup, false);
this.y = false;
setBackgroundNormalIds(QBViewResourceManager.D, R.color.theme_common_color_item_bg);
this.k = chatPageParams;
a(chatPageParams);
this.m = new ChatSettingPresenter(this, chatPageParams);
e(context);
c(context);
d(context);
b(context);
a(context);
c();
}
private void a(Context context) {
QBLinearLayout qBLinearLayout = new QBLinearLayout((Context) new UIContextWrapper(context), false);
qBLinearLayout.setOrientation(1);
qBLinearLayout.setBackgroundNormalIds(0, e.J);
QBLinearLayout qBLinearLayout2 = new QBLinearLayout((Context) new UIContextWrapper(context), false);
qBLinearLayout2.setGravity(16);
int i2 = n;
qBLinearLayout2.setPadding(i2, 0, i2, 0);
qBLinearLayout2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
EventCollector.getInstance().onViewClickedBefore(view);
new UrlParams(ChatSettingNativePage.this.getChatReportUrl()).b(1).c(0).d(true).e();
MsgCenterReportManager.a("3", ChatSettingNativePage.this.x.b(), ChatSettingNativePage.this.x.e(), ChatSettingNativePage.this.w.b(), ChatSettingNativePage.this.w.e(), "");
EventCollector.getInstance().onViewClicked(view);
}
});
ViewGroup.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, f68302a);
QBTextView qBTextView = new QBTextView(context, false);
qBTextView.setPadding(0, 0, f68305d, 0);
qBTextView.setTextColorNormalIds(e.f85871a);
qBTextView.setTextSize(e);
qBTextView.setText(f);
LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(0, -2, 1.0f);
QBImageView qBImageView = new QBImageView(context, false);
qBImageView.setId(100002);
qBImageView.setUseMaskForNightMode(true);
qBImageView.setImageNormalIds(g.B);
LinearLayout.LayoutParams layoutParams3 = new LinearLayout.LayoutParams(-2, -2);
qBLinearLayout2.addView(qBTextView, layoutParams2);
qBLinearLayout2.addView(qBImageView, layoutParams3);
View view = new View(new UIContextWrapper(context));
view.setBackgroundColor(MttResources.c(e.B));
LinearLayout.LayoutParams layoutParams4 = new LinearLayout.LayoutParams(-1, f68304c);
int i3 = f68305d;
layoutParams4.setMargins(i3, 0, i3, 0);
qBLinearLayout.addView(view, layoutParams4);
qBLinearLayout.addView(qBLinearLayout2, layoutParams);
this.r.addView(qBLinearLayout, new LinearLayout.LayoutParams(-1, f68302a + f68304c));
}
private void a(ChatPageParams chatPageParams) {
ChatUserInfo e2 = chatPageParams.e();
this.w = e2;
this.u = e2.f();
this.t = e2.e();
this.v = e2.d();
if (TextUtils.equals(chatPageParams.a(), "1")) {
this.y = true;
}
AccountInfo currentUserInfo = ((IAccount) SDKContext.getInstance().getService(IAccount.class)).getCurrentUserInfo();
this.x = new ChatUserInfo();
this.x.a(currentUserInfo.qbId, 2);
this.x.b(currentUserInfo.nickName);
this.x.a(currentUserInfo.iconUrl);
}
private void b(Context context) {
QBLinearLayout qBLinearLayout = new QBLinearLayout((Context) new UIContextWrapper(context), false);
qBLinearLayout.setBackgroundNormalIds(0, e.J);
qBLinearLayout.setGravity(16);
int i2 = n;
qBLinearLayout.setPadding(i2, 0, i2, 0);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, f68302a);
layoutParams.topMargin = f68303b;
QBTextView qBTextView = new QBTextView(context, false);
qBTextView.setPadding(0, 0, f68305d, 0);
qBTextView.setTextColorNormalIds(e.f85871a);
qBTextView.setTextSize(e);
qBTextView.setText(g);
LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(0, -2, 1.0f);
this.s = new QBSwitch(context, false);
this.s.a(this.y);
this.s.setContentDescription("屏蔽消息按钮");
this.s.setOnSwitchListener(this);
LinearLayout.LayoutParams layoutParams3 = new LinearLayout.LayoutParams(-2, -2);
qBLinearLayout.addView(qBTextView, layoutParams2);
qBLinearLayout.addView(this.s, layoutParams3);
this.r.addView(qBLinearLayout, layoutParams);
}
private void c() {
this.p.setText(this.t);
this.q.setUrl(this.v);
}
private void c(Context context) {
this.r = new QBLinearLayout((Context) new UIContextWrapper(context), false);
this.r.setBackgroundNormalIds(QBViewResourceManager.D, e.B);
this.r.setOrientation(1);
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(-1, -1);
layoutParams.topMargin = o;
addView(this.r, layoutParams);
}
private void d(Context context) {
QBRelativeLayout qBRelativeLayout = new QBRelativeLayout(context, false);
qBRelativeLayout.setClickable(true);
qBRelativeLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
EventCollector.getInstance().onViewClickedBefore(view);
String str = ChatSettingNativePage.this.u;
if (!TextUtils.isEmpty(str)) {
new UrlParams(str).b(1).c(0).d(true).e();
MsgCenterReportManager.a("1", ChatSettingNativePage.this.x.b(), ChatSettingNativePage.this.x.e(), ChatSettingNativePage.this.w.b(), ChatSettingNativePage.this.w.e(), "");
}
EventCollector.getInstance().onViewClicked(view);
}
});
qBRelativeLayout.setBackgroundNormalPressDisableIds(0, e.J, 0, e.D, 0, 255);
int i2 = n;
qBRelativeLayout.setPadding(i2, 0, i2, 0);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, h);
layoutParams.gravity = 16;
layoutParams.topMargin = i;
this.r.addView(qBRelativeLayout, layoutParams);
this.q = new RoundImageView(context, 0);
this.q.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
this.q.setId(100001);
int i3 = j;
RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(i3, i3);
layoutParams2.topMargin = i;
layoutParams2.addRule(15);
qBRelativeLayout.addView(this.q, layoutParams2);
QBImageView qBImageView = new QBImageView(context, false);
qBImageView.setId(100002);
qBImageView.setUseMaskForNightMode(true);
qBImageView.setContentDescription("点击打开个人主页");
qBImageView.setImageNormalIds(g.B);
RelativeLayout.LayoutParams layoutParams3 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams3.addRule(15);
layoutParams3.addRule(11);
qBRelativeLayout.addView(qBImageView, layoutParams3);
this.p = new QBTextView(context, false);
this.p.setTextColorNormalIds(e.f85871a);
this.p.setTextSize(e);
this.p.setSingleLine();
this.p.setEllipsize(TextUtils.TruncateAt.END);
RelativeLayout.LayoutParams layoutParams4 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams4.addRule(1, 100001);
layoutParams4.addRule(15);
layoutParams4.addRule(0, 100002);
layoutParams4.leftMargin = MttResources.h(f.p);
qBRelativeLayout.addView(this.p, layoutParams4);
}
private void e(Context context) {
this.l = new MsgCenterTitleBarBase(context);
this.l.setTitle(MttResources.l(R.string.avu));
this.l.a();
addView(this.l);
}
public String getChatReportUrl() {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("r", this.x.e());
jSONObject.put("rid", this.x.b());
jSONObject.put("rd", this.w.e());
jSONObject.put("rdid", this.w.b());
} catch (JSONException unused) {
}
return "https://bbs.mb.qq.com/mobilefb/fbTree?desc=%E5%9F%BA%E7%A1%80%E5%8A%9F%E8%83%BD%3E%E6%B6%88%E6%81%AF%E4%B8%AD%E5%BF%83%3E%E7%A7%81%E4%BF%A1%E4%B8%BE%E6%8A%A5&serviceId=0&levelinfos=5f550b97-9ee5-43c8-933f-7baacf06efb1&tname=%E6%B6%88%E6%81%AF%E4%B8%AD%E5%BF%83&level=b20d4ec4-18cd-44d2-8dae-def62722ae13&levelName=%E7%A7%81%E4%BF%A1%E4%B8%BE%E6%8A%A5&pl=%E8%AF%B7%E8%AF%A6%E7%BB%86%E6%8F%8F%E8%BF%B0%E4%BD%A0%E8%A6%81%E4%B8%BE%E6%8A%A5%E7%9A%84%E9%97%AE%E9%A2%98&dr=fb&levelTitle=%E7%A7%81%E4%BF%A1%E4%B8%BE%E6%8A%A5&arg=" + jSONObject.toString();
}
@Override
public void a() {
MttLoadingDialog mttLoadingDialog = this.z;
if (mttLoadingDialog == null || !mttLoadingDialog.isShowing()) {
this.z = ChatLoadingDialogUtils.a();
this.z.a(new QBAlertDialogBase.HandleBackListener() {
@Override
public void a() {
ChatSettingNativePage.this.z.dismiss();
((IFrameworkDelegate) QBContext.getInstance().getService(IFrameworkDelegate.class)).handleMttMessage(5, 0, 0, null, 0L);
}
});
this.z.show();
}
}
@Override
public void a(View view, boolean z) {
this.m.a(z, this.w);
MsgCenterReportManager.a("2", this.x.b(), this.x.e(), this.w.b(), this.w.e(), z ? "1" : "2");
}
@Override
public void a(boolean z) {
this.y = z;
this.s.setSwitchState(z);
this.s.a();
}
@Override
public void a(final boolean z, final int i2, String str) {
BrowserExecutorSupplier.forMainThreadTasks().execute(new Runnable() {
@Override
public void run() {
String str2;
if (i2 == 0) {
str2 = z ? "已拉黑" : "已解除拉黑";
} else {
ChatSettingNativePage.this.a(!z);
str2 = "请求失败,请重试";
}
MttToaster.show(str2, 0);
}
});
}
@Override
public void b() {
MttLoadingDialog mttLoadingDialog = this.z;
if (mttLoadingDialog == null || !mttLoadingDialog.isShowing()) {
return;
}
this.z.dismiss();
}
@Override
public boolean coverToolbar() {
return true;
}
@Override
public IPage.INSTANT_TYPE getInstType() {
return IPage.INSTANT_TYPE.SIGLE_TYPE_IN_GLOBAL;
}
@Override
public IPage.POP_TYPE getPopType() {
return IPage.POP_TYPE.INCLUDE_SELF;
}
@Override
public boolean isForcePortalScreen() {
return true;
}
@Override
public boolean sheildOptiziation() {
return true;
}
}