QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 DigitalAssetsEntranceView.java 源代码,内容仅作参考
package com.tencent.mtt.browser.account.usercenter.ucenter;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.content.Context;
import android.graphics.Typeface;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
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.threadpool.BrowserExecutorSupplier;
import com.tencent.common.utils.UrlUtils;
import com.tencent.mtt.R;
import com.tencent.mtt.account.base.IAccount;
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.stat.utils.PlatformStatUtils;
import com.tencent.mtt.browser.account.MTT.UserCircleContents;
import com.tencent.mtt.browser.account.usercenter.UserCenterUtils;
import com.tencent.mtt.browser.account.usercenter.nativepage.ViewPressAlphaHelper;
import com.tencent.mtt.browser.bookmark.engine.Bookmark;
import com.tencent.mtt.browser.bookmark.facade.IBookMarkService;
import com.tencent.mtt.browser.download.core.facade.IStoragePermissionCheckCallback;
import com.tencent.mtt.browser.download.core.impl.DownloadServiceManager;
import com.tencent.mtt.browser.download.engine.DownloadTask;
import com.tencent.mtt.browser.window.UrlParams;
import com.tencent.mtt.businesscenter.facade.IFrameworkDelegate;
import com.tencent.mtt.external.favnew.facade.IFavService;
import com.tencent.mtt.history.base.IHistory;
import com.tencent.mtt.history.base.IWebVideoHistory;
import com.tencent.mtt.lottie.LottieAnimationView;
import com.tencent.mtt.newskin.SimpleSkinBuilder;
import com.tencent.mtt.qbcontext.core.QBContext;
import com.tencent.mtt.sdkcontext.SDKContext;
import com.tencent.qqlive.module.videoreport.collect.EventCollector;
import com.tencent.tar.internal.TarStatusCode;
import java.util.List;
import qb.a.f;
public class DigitalAssetsEntranceView extends LinearLayout implements View.OnClickListener, IDigitalAssetsEntranceView {
public static final int f35213a = MttResources.h(f.O);
private RelativeLayout f35214b;
private TextView f35215c;
private RelativeLayout f35216d;
private TextView e;
private RelativeLayout f;
private TextView g;
private RelativeLayout h;
private TextView i;
private TextView j;
private String k;
private TextView l;
private TextView m;
private TextView n;
private LottieAnimationView o;
private ViewGroup p;
public DigitalAssetsEntranceView(Context context) {
super(context);
this.k = "";
a(context);
f();
}
private void a(Context context) {
LayoutInflater.from(context).inflate(R.layout.f8, this);
Typeface a2 = UserCenterUtils.a("DINNextLTPro-Regular.ttf", getContext());
this.f35214b = (RelativeLayout) findViewById(R.id.assets_bookmark_entrance);
this.f35214b.setOnClickListener(this);
ViewPressAlphaHelper.a(this.f35214b);
this.f35215c = (TextView) findViewById(R.id.assets_bookmark_entrance_count);
this.l = (TextView) findViewById(R.id.assets_bookmark_entrance_title);
if (a2 != null) {
this.f35215c.setTypeface(a2);
}
this.f35216d = (RelativeLayout) findViewById(R.id.assets_history_entrance);
this.f35216d.setOnClickListener(this);
ViewPressAlphaHelper.a(this.f35216d);
this.e = (TextView) findViewById(R.id.assets_history_entrance_count);
this.m = (TextView) findViewById(R.id.assets_history_entrance_title);
if (a2 != null) {
this.e.setTypeface(a2);
}
this.f = (RelativeLayout) findViewById(R.id.assets_download_entrance);
this.f.setOnClickListener(this);
ViewPressAlphaHelper.a(this.f);
this.g = (TextView) findViewById(R.id.assets_download_entrance_count);
this.n = (TextView) findViewById(R.id.assets_download_entrance_title);
if (a2 != null) {
this.g.setTypeface(a2);
}
this.h = (RelativeLayout) findViewById(R.id.assets_personal_entrance);
this.h.setOnClickListener(this);
ViewPressAlphaHelper.a(this.h);
this.i = (TextView) findViewById(R.id.assets_personal_entrance_count);
this.j = (TextView) findViewById(R.id.assets_personal_entrance_title);
if (a2 != null) {
this.i.setTypeface(a2);
}
a(((IAccount) SDKContext.getInstance().getService(IAccount.class)).getCurrentUserInfo());
e();
}
private void a(AccountInfo accountInfo) {
BrowserExecutorSupplier.forMainThreadTasks().execute(new Runnable() {
@Override
public void run() {
DigitalAssetsEntranceView.this.j.setText(MttResources.l(R.string.bsk));
}
});
}
public void a(String str, int i) {
if (TextUtils.isEmpty(str)) {
return;
}
UrlParams d2 = new UrlParams(str).b(1).d(true);
if (i == R.id.assets_download_entrance) {
Bundle bundle = new Bundle();
bundle.putString("down:key_from_scene", "grzx");
d2.a(bundle);
}
((IFrameworkDelegate) QBContext.getInstance().getService(IFrameworkDelegate.class)).doLoad(d2);
}
private void e() {
SimpleSkinBuilder.a(this.f35215c).g(R.color.usercenter_page_navibar_icon_scroll_color).f();
SimpleSkinBuilder.a(this.l).g(R.color.usercenter_page_navibar_icon_scroll_color).f();
SimpleSkinBuilder.a(this.e).g(R.color.usercenter_page_navibar_icon_scroll_color).f();
SimpleSkinBuilder.a(this.m).g(R.color.usercenter_page_navibar_icon_scroll_color).f();
SimpleSkinBuilder.a(this.g).g(R.color.usercenter_page_navibar_icon_scroll_color).f();
SimpleSkinBuilder.a(this.n).g(R.color.usercenter_page_navibar_icon_scroll_color).f();
SimpleSkinBuilder.a(this.i).g(R.color.usercenter_page_navibar_icon_scroll_color).f();
SimpleSkinBuilder.a(this.j).g(R.color.usercenter_page_navibar_icon_scroll_color).f();
}
private void f() {
a();
b();
g();
if (((IAccount) SDKContext.getInstance().getService(IAccount.class)).getCurrentUserInfo().isLogined()) {
i();
}
}
private void g() {
BrowserExecutorSupplier.forBackgroundTasks().execute(new Runnable() {
@Override
public void run() {
int i = 0;
List<DownloadTask> allTaskList = DownloadServiceManager.a().getAllTaskList(false);
if (allTaskList != null && allTaskList.size() > 0) {
i = allTaskList.size();
}
final int i2 = TarStatusCode.TAR_SLAM_HIT_IN_POINT;
if (i <= 99999) {
i2 = i;
}
BrowserExecutorSupplier.forMainThreadTasks().execute(new Runnable() {
@Override
public void run() {
if (DigitalAssetsEntranceView.this.g != null) {
DigitalAssetsEntranceView.this.g.setText(String.valueOf(i2));
}
}
});
}
});
}
private void h() {
StatManager b2;
String str;
StatManager.b().c("DMKEXP01_8");
StatManager.b().c("DMKEXP01_9");
StatManager.b().c("DMKEXP01_10");
if (((IAccount) SDKContext.getInstance().getService(IAccount.class)).getCurrentUserInfo().isLogined()) {
b2 = StatManager.b();
str = "DMKEXP01_33";
} else {
b2 = StatManager.b();
str = "DMKEXP01_22";
}
b2.c(str);
}
private void i() {
BrowserExecutorSupplier.forBackgroundTasks().execute(new Runnable() {
@Override
public void run() {
IFavService iFavService = (IFavService) QBContext.getInstance().getService(IFavService.class);
if (iFavService != null) {
iFavService.syncFavData(new IFavService.SyncFavListener() {
@Override
public void a() {
DigitalAssetsEntranceView.this.a();
}
@Override
public void b() {
DigitalAssetsEntranceView.this.a();
}
});
}
}
});
}
public void a() {
BrowserExecutorSupplier.forBackgroundTasks().execute(new Runnable() {
@Override
public void run() {
List<Bookmark> bookmarks;
if (!((IAccount) SDKContext.getInstance().getService(IAccount.class)).getCurrentUserInfo().isLogined()) {
BrowserExecutorSupplier.forMainThreadTasks().execute(new Runnable() {
@Override
public void run() {
if (DigitalAssetsEntranceView.this.f35215c != null) {
DigitalAssetsEntranceView.this.f35215c.setText("0");
}
}
});
return;
}
IFavService iFavService = (IFavService) QBContext.getInstance().getService(IFavService.class);
int i = 0;
int favTotalCount = iFavService != null ? iFavService.getFavTotalCount() : 0;
IBookMarkService iBookMarkService = (IBookMarkService) QBContext.getInstance().getService(IBookMarkService.class);
if (iBookMarkService != null && (bookmarks = iBookMarkService.getBookmarks()) != null) {
i = bookmarks.size();
}
final int i2 = favTotalCount + i;
if (i2 > 99999) {
i2 = TarStatusCode.TAR_SLAM_HIT_IN_POINT;
}
BrowserExecutorSupplier.forMainThreadTasks().execute(new Runnable() {
@Override
public void run() {
if (DigitalAssetsEntranceView.this.f35215c != null) {
DigitalAssetsEntranceView.this.f35215c.setText(String.valueOf(i2));
}
}
});
}
});
}
public void a(UserCircleContents userCircleContents) {
AccountInfo currentUserInfo = ((IAccount) SDKContext.getInstance().getService(IAccount.class)).getCurrentUserInfo();
a(currentUserInfo);
PlatformStatUtils.a("DIGITAL_ASSETS_VIEW_GUANZHU_NEW");
final int a2 = PersonalCountUtils.a(this, userCircleContents, currentUserInfo.isLogined());
PlatformStatUtils.a("DIGITAL_ASSETS_VIEW_GUANZHU_SHOW");
BrowserExecutorSupplier.forMainThreadTasks().execute(new Runnable() {
@Override
public void run() {
if (DigitalAssetsEntranceView.this.i != null) {
DigitalAssetsEntranceView.this.i.setText(String.valueOf(a2));
}
}
});
}
@Override
public void a(String str) {
this.k = str;
}
public void b() {
BrowserExecutorSupplier.forBackgroundTasks().execute(new Runnable() {
@Override
public void run() {
IHistory iHistory = (IHistory) SDKContext.getInstance().getService(IHistory.class);
IWebVideoHistory iWebVideoHistory = (IWebVideoHistory) SDKContext.getInstance().getService(IWebVideoHistory.class);
if (iHistory == null || iWebVideoHistory == null) {
return;
}
final int size = (int) ((iHistory.getHistory() != null ? r0.size() : 0) + iWebVideoHistory.getHistoryCount());
if (size > 99999) {
size = TarStatusCode.TAR_SLAM_HIT_IN_POINT;
}
BrowserExecutorSupplier.forMainThreadTasks().execute(new Runnable() {
@Override
public void run() {
if (DigitalAssetsEntranceView.this.e != null) {
DigitalAssetsEntranceView.this.e.setText(String.valueOf(size));
}
}
});
}
});
}
public void b(String str) {
int i;
RelativeLayout relativeLayout;
int i2 = -1;
try {
i2 = Integer.parseInt(UrlUtils.getDataFromQbUrl(str, "nativeServiceId"));
i = Integer.parseInt(UrlUtils.getDataFromQbUrl(str, "delayTime"));
} catch (NumberFormatException unused) {
i = 0;
}
switch (i2) {
case 19997:
relativeLayout = this.f35214b;
break;
case 19998:
relativeLayout = this.f35216d;
break;
case 19999:
relativeLayout = this.f;
break;
case 20000:
relativeLayout = this.h;
break;
default:
relativeLayout = null;
break;
}
this.p = relativeLayout;
ViewGroup viewGroup = this.p;
if (viewGroup == null) {
return;
}
viewGroup.postDelayed(new Runnable() {
@Override
public void run() {
if (DigitalAssetsEntranceView.this.o == null) {
DigitalAssetsEntranceView digitalAssetsEntranceView = DigitalAssetsEntranceView.this;
digitalAssetsEntranceView.o = new UsercenterDigitalLightLottieView(digitalAssetsEntranceView.getContext(), 10);
DigitalAssetsEntranceView.this.o.setScaleType(ImageView.ScaleType.CENTER_CROP);
}
if (DigitalAssetsEntranceView.this.o.getParent() != null) {
((ViewGroup) DigitalAssetsEntranceView.this.o.getParent()).removeView(DigitalAssetsEntranceView.this.o);
}
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-2, DigitalAssetsEntranceView.this.p.getHeight());
layoutParams.addRule(13);
DigitalAssetsEntranceView.this.p.addView(DigitalAssetsEntranceView.this.o, layoutParams);
DigitalAssetsEntranceView.this.o.setAnimation("usercenter_diaital_view_light_lottie.json");
DigitalAssetsEntranceView.this.o.addAnimatorListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animator) {
super.onAnimationEnd(animator);
DigitalAssetsEntranceView.this.o.setVisibility(8);
}
@Override
public void onAnimationStart(Animator animator) {
super.onAnimationStart(animator);
DigitalAssetsEntranceView.this.o.setVisibility(0);
}
});
DigitalAssetsEntranceView.this.o.playAnimation();
}
}, i);
}
public void c() {
a();
b();
g();
h();
}
public void d() {
a("");
i();
}
@Override
public void onClick(View view) {
final String str;
EventCollector.getInstance().onViewClickedBefore(view);
final int id = view.getId();
if (id == R.id.assets_bookmark_entrance) {
PlatformStatUtils.a("USERCENTER_BOOKMARK_CLICK");
StatManager.b().c("DMKCLK001_8");
str = "qb://bookmark?entrance=0";
} else if (id == R.id.assets_history_entrance) {
PlatformStatUtils.a("USERCENTER_HISTORY_CLICK");
StatManager.b().c("DMKCLK001_9");
str = "qb://history?entrance=0";
} else if (id == R.id.assets_download_entrance) {
PlatformStatUtils.a("USERCENTER_DOWNLOAD_CLICK");
StatManager.b().c("DMKCLK001_10");
str = "qb://download";
} else if (id == R.id.assets_personal_entrance) {
AccountInfo currentUserInfo = ((IAccount) SDKContext.getInstance().getService(IAccount.class)).getCurrentUserInfo();
PlatformStatUtils.a("USERCENTER_PERSONAL_CLICK");
if (currentUserInfo.isLogined()) {
StatManager.b().c("DMKCLK001_33");
str = this.k;
} else {
PlatformStatUtils.a("USERCENTER_PERSONAL_CLICK_NOT_LOGIN");
StatManager.b().c("DMKCLK001_22");
str = "https://quan.qq.com/operate/followed";
}
} else {
str = "";
}
if (id == R.id.assets_download_entrance) {
DownloadServiceManager.a().checkStoragePermission(new IStoragePermissionCheckCallback() {
@Override
public void a(boolean z) {
if (z) {
DigitalAssetsEntranceView.this.a(str, id);
}
}
}, null);
} else {
a(str, id);
}
EventCollector.getInstance().onViewClicked(view);
}
}