QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 DocTxMoreDialog.java 源代码,内容仅作参考
package com.tencent.mtt.file.page.homepage.tab.card.doc.online;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.tencent.common.utils.UrlUtils;
import com.tencent.mtt.R;
import com.tencent.mtt.base.skin.MttResources;
import com.tencent.mtt.browser.file.stat.DocEventOnlineExtraBuilder;
import com.tencent.mtt.browser.share.facade.IShare;
import com.tencent.mtt.browser.share.facade.ShareBundle;
import com.tencent.mtt.browser.window.UrlParams;
import com.tencent.mtt.file.page.homepage.tab.card.doc.DocUtils;
import com.tencent.mtt.file.page.homepage.tab.card.doc.ScrollDialogBase;
import com.tencent.mtt.file.page.homepage.tab.card.doc.manager.TxDocInfo;
import com.tencent.mtt.file.page.homepage.tab.card.doc.view.DocDeleteDialogCallBack;
import com.tencent.mtt.file.page.statistics.FileKeyEvent;
import com.tencent.mtt.file.tencentdocument.TxDocument;
import com.tencent.mtt.newskin.SimpleSkinBuilder;
import com.tencent.mtt.nxeasy.page.EasyPageContext;
import com.tencent.mtt.qbcontext.core.QBContext;
import com.tencent.mtt.view.common.QBTextView;
import com.tencent.mtt.view.toast.MttToaster;
import com.tencent.qqlive.module.videoreport.collect.EventCollector;
import java.util.ArrayList;
import tencent.doc.opensdk.openapi.b;
import tencent.doc.opensdk.openapi.menu.PermissionParams;
import tencent.doc.opensdk.openapi.types.FileType;
public class DocTxMoreDialog extends ScrollDialogBase implements View.OnClickListener {
EasyPageContext f61696b;
TxDocInfo f61697c;
private final String f61698d;
public DocTxMoreDialog(EasyPageContext easyPageContext, TxDocInfo txDocInfo) {
this(easyPageContext, txDocInfo, "");
}
public DocTxMoreDialog(EasyPageContext easyPageContext, TxDocInfo txDocInfo, String str) {
super(easyPageContext.f68800c);
this.f61696b = easyPageContext;
this.f61697c = txDocInfo;
this.f61698d = str;
b();
}
public void j() {
ShareBundle shareBundle = new ShareBundle(0);
shareBundle.f45016d = this.f61697c.url;
shareBundle.f45014b = this.f61697c.title;
shareBundle.f45015c = "腾讯文档-在线文档";
shareBundle.i = DocUtils.d(this.f61697c.type);
((IShare) QBContext.getInstance().getService(IShare.class)).doShare(shareBundle);
}
@Override
public void a(LinearLayout linearLayout) {
String str;
RelativeLayout relativeLayout = new RelativeLayout(this.f61696b.f68800c);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -2);
layoutParams.topMargin = MttResources.s(12);
linearLayout.addView(relativeLayout, layoutParams);
ImageView imageView = new ImageView(this.f61696b.f68800c);
RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(MttResources.s(40), MttResources.s(40));
layoutParams2.leftMargin = MttResources.s(30);
layoutParams2.addRule(15);
relativeLayout.addView(imageView, layoutParams2);
SimpleSkinBuilder.a(imageView).g(DocUtils.a(this.f61697c.type)).f();
QBTextView qBTextView = new QBTextView(this.f61696b.f68800c);
qBTextView.setId(100);
qBTextView.setMaxLines(2);
qBTextView.setmMostExact(true);
qBTextView.setTruncateAtStyleFileName(true);
qBTextView.setEllipsize(TextUtils.TruncateAt.MIDDLE);
qBTextView.setTextSize(0, MttResources.s(16));
SimpleSkinBuilder.a((TextView) qBTextView).g(R.color.theme_common_color_a1).f();
RelativeLayout.LayoutParams layoutParams3 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams3.leftMargin = MttResources.s(82);
layoutParams3.rightMargin = MttResources.s(30);
layoutParams3.topMargin = MttResources.s(16);
qBTextView.setText(this.f61697c.title);
relativeLayout.addView(qBTextView, layoutParams3);
TextView textView = new TextView(this.f61696b.f68800c);
if (this.f61697c.isOwner) {
str = "我创建";
} else {
str = this.f61697c.ownerName + "创建";
}
textView.setText(str);
textView.setTextSize(0, MttResources.s(12));
SimpleSkinBuilder.a(textView).g(R.color.theme_common_color_a3).f();
RelativeLayout.LayoutParams layoutParams4 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams4.leftMargin = MttResources.s(82);
layoutParams4.addRule(3, 100);
layoutParams4.topMargin = MttResources.s(2);
layoutParams4.bottomMargin = MttResources.s(16);
relativeLayout.addView(textView, layoutParams4);
LinearLayout linearLayout2 = new LinearLayout(this.f61696b.f68800c);
linearLayout2.setId(101);
linearLayout2.setGravity(16);
ViewGroup.LayoutParams layoutParams5 = new LinearLayout.LayoutParams(-1, MttResources.s(50));
linearLayout.addView(linearLayout2, layoutParams5);
ImageView imageView2 = new ImageView(this.f61696b.f68800c);
imageView2.setImageDrawable(MttResources.i(R.drawable.aol));
imageView2.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
SimpleSkinBuilder.a(imageView2).h(R.color.a3h).f();
LinearLayout.LayoutParams layoutParams6 = new LinearLayout.LayoutParams(MttResources.s(20), MttResources.s(20));
layoutParams6.leftMargin = MttResources.s(30);
linearLayout2.addView(imageView2, layoutParams6);
TextView textView2 = new TextView(this.f61696b.f68800c);
textView2.setTextSize(0, MttResources.s(16));
SimpleSkinBuilder.a(textView2).g(R.color.theme_common_color_a1).f();
LinearLayout.LayoutParams layoutParams7 = new LinearLayout.LayoutParams(-2, -2);
layoutParams7.leftMargin = MttResources.s(13);
textView2.setText("分享");
linearLayout2.addView(textView2, layoutParams7);
linearLayout2.setOnClickListener(this);
a(linearLayout, false);
LinearLayout linearLayout3 = new LinearLayout(this.f61696b.f68800c);
linearLayout3.setId(102);
linearLayout3.setGravity(16);
linearLayout.addView(linearLayout3, layoutParams5);
ImageView imageView3 = new ImageView(this.f61696b.f68800c);
imageView3.setImageDrawable(MttResources.i(R.drawable.aom));
imageView3.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
SimpleSkinBuilder.a(imageView3).h(R.color.a3h).f();
linearLayout3.addView(imageView3, layoutParams6);
TextView textView3 = new TextView(this.f61696b.f68800c);
textView3.setTextSize(0, MttResources.s(16));
SimpleSkinBuilder.a(textView3).g(R.color.theme_common_color_a1).f();
textView3.setText(this.f61697c.starred ? "取消星标" : "添加星标");
linearLayout3.addView(textView3, layoutParams7);
linearLayout3.setOnClickListener(this);
a(linearLayout, false);
LinearLayout linearLayout4 = new LinearLayout(this.f61696b.f68800c);
linearLayout4.setId(103);
linearLayout4.setGravity(16);
linearLayout.addView(linearLayout4, layoutParams5);
ImageView imageView4 = new ImageView(this.f61696b.f68800c);
imageView4.setImageDrawable(MttResources.i(R.drawable.aok));
imageView4.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
SimpleSkinBuilder.a(imageView4).h(R.color.a3h).f();
linearLayout4.addView(imageView4, layoutParams6);
TextView textView4 = new TextView(this.f61696b.f68800c);
textView4.setTextSize(0, MttResources.s(16));
SimpleSkinBuilder.a(textView4).g(R.color.theme_common_color_a1).f();
textView4.setText("重命名");
linearLayout4.addView(textView4, layoutParams7);
linearLayout4.setOnClickListener(this);
a(linearLayout, false);
LinearLayout linearLayout5 = new LinearLayout(this.f61696b.f68800c);
linearLayout5.setId(105);
linearLayout5.setGravity(16);
linearLayout.addView(linearLayout5, layoutParams5);
ImageView imageView5 = new ImageView(this.f61696b.f68800c);
imageView5.setImageDrawable(MttResources.i(R.drawable.ao_));
imageView5.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
SimpleSkinBuilder.a(imageView5).h(R.color.a3h).f();
linearLayout5.addView(imageView5, layoutParams6);
TextView textView5 = new TextView(this.f61696b.f68800c);
textView5.setTextSize(0, MttResources.s(16));
SimpleSkinBuilder.a(textView5).g(R.color.theme_common_color_a1).f();
textView5.setText("文档详情");
linearLayout5.addView(textView5, layoutParams7);
linearLayout5.setOnClickListener(this);
a(linearLayout, false);
LinearLayout linearLayout6 = new LinearLayout(this.f61696b.f68800c);
linearLayout6.setId(106);
linearLayout6.setGravity(16);
linearLayout.addView(linearLayout6, layoutParams5);
ImageView imageView6 = new ImageView(this.f61696b.f68800c);
imageView6.setImageDrawable(MttResources.i(R.drawable.ai3));
imageView6.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
SimpleSkinBuilder.a(imageView6).h(R.color.a3h).f();
linearLayout6.addView(imageView6, layoutParams6);
TextView textView6 = new TextView(this.f61696b.f68800c);
textView6.setTextSize(0, MttResources.s(16));
SimpleSkinBuilder.a(textView6).g(R.color.theme_common_color_a1).f();
textView6.setText("删除记录");
linearLayout6.addView(textView6, layoutParams7);
linearLayout6.setOnClickListener(this);
a(linearLayout, true);
}
public void d() {
DocEventOnlineExtraBuilder docEventOnlineExtraBuilder = new DocEventOnlineExtraBuilder(DocUtils.i().a());
docEventOnlineExtraBuilder.c(this.f61697c.title);
docEventOnlineExtraBuilder.d(this.f61697c.isOwner ? "1" : "2");
new FileKeyEvent("qdoc_tdoc_listmenu_share", this.f61696b.g, this.f61696b.h, "", "", DocEventOnlineExtraBuilder.e(this.f61697c.type), docEventOnlineExtraBuilder.b()).a();
if (!this.f61697c.isOwner) {
j();
} else if (TextUtils.equals(this.f61697c.type, FileType.FORM.type)) {
PermissionParams permissionParams = new PermissionParams();
permissionParams.f87307a = PermissionParams.Policy.PUBLICWRITE;
TxDocument.b().d().a(this.f61697c.id, permissionParams, new b() {
@Override
public void a(String str) {
MttToaster.show(str, 0);
}
@Override
public void a(tencent.doc.opensdk.openapi.a.b bVar) {
DocTxMoreDialog.this.j();
}
});
} else {
new DocOnlineShareDialog(this.f61696b, this.f61697c).show();
}
dismiss();
}
public void e() {
(this.f61697c.starred ? new FileKeyEvent("qdoc_tdoc_listmenu_unstar_clk", this.f61696b.g, this.f61696b.h, "", "", "", DocUtils.i().a()) : new FileKeyEvent("qdoc_tdoc_listmenu_star_clk", this.f61696b.g, this.f61696b.h, "", "", "", DocUtils.i().a())).a();
TxDocument.b().d().a(this.f61697c, !r2.starred, new b() {
@Override
public void a(String str) {
MttToaster.show(str, 1500);
DocTxMoreDialog.this.dismiss();
}
@Override
public void a(tencent.doc.opensdk.openapi.a.b bVar) {
DocTxMoreDialog.this.dismiss();
}
});
}
public void f() {
new FileKeyEvent("qdoc_tdoc_listmenu_info_clk", this.f61696b.g, this.f61696b.h, "", "", "", DocUtils.i().a()).a();
this.f61696b.f68798a.b(new UrlParams(UrlUtils.addParamsToUrl(UrlUtils.addParamsToUrl(UrlUtils.addParamsToUrl("qb://filesdk/txdocs/start", "dstUrl=https://docs.qq.com/tim/docs/components/FileInfoPanelMobile.html?fileId=" + this.f61697c.id.substring(this.f61697c.id.indexOf("$") + 1)), "callFrom=" + this.f61696b.g), "callerName=" + this.f61696b.h)));
}
public void g() {
new FileKeyEvent("qdoc_tdoc_listmenu_rename_clk", this.f61696b.g, this.f61696b.h, "", "", "", DocUtils.i().a()).a();
UrlParams urlParams = new UrlParams(UrlUtils.addParamsToUrl(UrlUtils.addParamsToUrl("qb://filesdk/txdocrename", "callFrom=" + this.f61696b.g), "callerName=" + this.f61696b.h));
Bundle bundle = new Bundle();
bundle.putParcelable("doc_rename_key", this.f61697c);
urlParams.a(bundle);
this.f61696b.f68798a.a(urlParams);
}
@Override
public void onClick(View view) {
EventCollector.getInstance().onViewClickedBefore(view);
switch (view.getId()) {
case 101:
d();
break;
case 102:
e();
break;
case 103:
g();
break;
case 105:
f();
break;
case 106:
new FileKeyEvent("qdoc_tdoc_listmenu_delete_clk", this.f61696b.g, this.f61696b.h, "", "", "", DocUtils.i().a()).a();
String str = (this.f61697c.isOwner && TextUtils.equals(this.f61698d, "MAIN")) ? "确认删除所选文档的查看记录?" : "确认删除所选文档?";
boolean z = this.f61697c.isOwner && TextUtils.equals(this.f61698d, "MAIN");
boolean z2 = !TextUtils.equals(this.f61698d, "MAIN");
ArrayList arrayList = new ArrayList();
arrayList.add(this.f61697c);
DocUtils.a(arrayList, null, z, z2, str, TextUtils.equals(this.f61698d, "MAIN"), new DocDeleteDialogCallBack() {
@Override
public void a() {
new FileKeyEvent("qdoc_tdoc_listmenu_delete_sure_clk", DocTxMoreDialog.this.f61696b.g, DocTxMoreDialog.this.f61696b.h, "", "", "", DocUtils.i().a()).a();
}
@Override
public void b() {
}
});
break;
}
dismiss();
EventCollector.getInstance().onViewClicked(view);
}
}