QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 HeaderScaningViewNew.java 源代码,内容仅作参考
package com.tencent.mtt.fileclean.page.header;
import MTT.WelfareTaskInfo;
import android.animation.Animator;
import android.animation.TypeEvaluator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.view.animation.LinearInterpolator;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.tencent.luggage.wxa.mo.c;
import com.tencent.mtt.R;
import com.tencent.mtt.base.skin.MttResources;
import com.tencent.mtt.base.ui.widget.QBWebImageView;
import com.tencent.mtt.browser.setting.manager.SkinManager;
import com.tencent.mtt.fileclean.bean.JunkInfo;
import com.tencent.mtt.fileclean.utils.IGetWelfareTaskCallBack;
import com.tencent.mtt.fileclean.utils.JunkCleanWelFareManager;
import com.tencent.mtt.fileclean.utils.JunkFileUtils;
import com.tencent.mtt.javaswitch.FeatureSwitcher;
import com.tencent.mtt.lottie.LottieAnimationView;
import com.tencent.mtt.newskin.SimpleSkinBuilder;
import com.tencent.mtt.view.common.QBTextView;
import com.tencent.mtt.view.layout.QBLinearLayout;
import com.tencent.mtt.view.layout.QBRelativeLayout;
import qb.a.e;
import qb.javaswitch.BuildConfig;
public class HeaderScaningViewNew extends HeaderBaseView {
QBRelativeLayout f66024a;
LottieAnimationView f66025b;
QBTextView f66026c;
QBTextView f66027d;
QBTextView e;
QBTextView f;
LinearLayout g;
boolean h;
boolean m;
public HeaderScaningViewNew(Context context) {
super(context);
d();
if (FeatureSwitcher.a(BuildConfig.FEATURE_SWITCHER_KEY_JUNKCLEAN_WELFARE)) {
JunkCleanWelFareManager.a().a(new IGetWelfareTaskCallBack() {
@Override
public void a(WelfareTaskInfo welfareTaskInfo, boolean z) {
if (!z) {
HeaderScaningViewNew.this.h = false;
return;
}
HeaderScaningViewNew headerScaningViewNew = HeaderScaningViewNew.this;
headerScaningViewNew.h = true;
if (!headerScaningViewNew.m) {
HeaderScaningViewNew.this.g.setVisibility(8);
} else {
HeaderScaningViewNew.this.g.setVisibility(0);
HeaderScaningViewNew.this.l = true;
}
}
});
}
}
private void d() {
QBTextView qBTextView;
int c2;
QBTextView qBTextView2;
int c3;
QBTextView qBTextView3;
int c4;
this.f66024a = new QBRelativeLayout(this.i);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, MttResources.s(360));
layoutParams.setMargins(0, MttResources.s(80), 0, 0);
addView(this.f66024a, layoutParams);
RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(MttResources.s(360), MttResources.s(360));
layoutParams2.addRule(13);
QBWebImageView qBWebImageView = new QBWebImageView(this.i);
qBWebImageView.setPlaceHolderColorId(R.color.transparent);
qBWebImageView.setUrl("https://static.res.qq.com/nav/file/scan_bg.png");
SimpleSkinBuilder.a((ImageView) qBWebImageView).f();
this.f66024a.addView(qBWebImageView, layoutParams2);
this.f66025b = new LottieAnimationView(this.i);
this.f66025b.setAnimation("junk_scan_anim.json");
this.f66025b.loop(true);
this.f66024a.addView(this.f66025b, layoutParams2);
QBLinearLayout qBLinearLayout = new QBLinearLayout(this.i);
qBLinearLayout.setOrientation(0);
qBLinearLayout.setGravity(80);
this.f66026c = new QBTextView(this.i);
this.f66026c.setTextSize(MttResources.s(60));
this.f66026c.setText("0");
this.f66026c.setGravity(17);
LinearLayout.LayoutParams layoutParams3 = new LinearLayout.LayoutParams(-2, -2);
if (SkinManager.s().l()) {
qBTextView = this.f66026c;
c2 = MttResources.c(R.color.so);
} else {
qBTextView = this.f66026c;
c2 = MttResources.c(R.color.sl);
}
qBTextView.setTextColor(c2);
qBLinearLayout.addView(this.f66026c, layoutParams3);
this.f66027d = new QBTextView(this.i);
this.f66027d.setTextSize(MttResources.s(22));
this.f66027d.setText("B");
this.f66027d.setGravity(17);
if (SkinManager.s().l()) {
qBTextView2 = this.f66027d;
c3 = MttResources.c(R.color.so);
} else {
qBTextView2 = this.f66027d;
c3 = MttResources.c(R.color.sl);
}
qBTextView2.setTextColor(c3);
LinearLayout.LayoutParams layoutParams4 = new LinearLayout.LayoutParams(-2, -2);
layoutParams4.leftMargin = MttResources.s(4);
qBLinearLayout.addView(this.f66027d, layoutParams4);
RelativeLayout.LayoutParams layoutParams5 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams5.bottomMargin = MttResources.s(c.CTRL_INDEX);
layoutParams5.addRule(14);
layoutParams5.addRule(12);
qBLinearLayout.setId(1001);
this.f66024a.addView(qBLinearLayout, layoutParams5);
this.e = new QBTextView(this.i);
this.e.setTextSize(MttResources.s(14));
this.e.setText("扫描中...");
this.e.setId(2);
if (SkinManager.s().o() == 3) {
qBTextView3 = this.e;
c4 = -12433843;
} else {
qBTextView3 = this.e;
c4 = MttResources.c(e.f85874c);
}
qBTextView3.setTextColor(c4);
this.e.setOnClickListener(this);
this.e.setClickable(false);
RelativeLayout.LayoutParams layoutParams6 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams6.bottomMargin = MttResources.s(129);
layoutParams6.addRule(14);
layoutParams6.addRule(12);
this.f66024a.addView(this.e, layoutParams6);
this.f = new QBTextView(this.i);
this.f.setTextSize(MttResources.s(18));
this.f.setGravity(17);
this.f.setVisibility(8);
this.f.setTextColor(MttResources.c(e.W));
this.f.setBackgroundNormalIds(R.drawable.fd, 0);
this.f.setText(MttResources.l(R.string.b84));
this.f.setId(3);
this.f.setOnClickListener(this);
RelativeLayout.LayoutParams layoutParams7 = new RelativeLayout.LayoutParams(MttResources.s(170), MttResources.s(44));
layoutParams7.addRule(14);
layoutParams7.addRule(12);
layoutParams7.setMargins(0, 0, 0, MttResources.s(60));
addView(this.f, layoutParams7);
this.g = new LinearLayout(this.i);
this.g.setOrientation(1);
RelativeLayout.LayoutParams layoutParams8 = new RelativeLayout.LayoutParams(MttResources.s(91), MttResources.s(30));
layoutParams8.addRule(2, 3);
layoutParams8.addRule(14);
layoutParams8.bottomMargin = MttResources.s(5);
addView(this.g, layoutParams8);
this.g.setGravity(17);
LinearLayout linearLayout = new LinearLayout(this.i);
linearLayout.setBackground(MttResources.i(SkinManager.s().l() ? R.drawable.e6 : R.drawable.e5));
this.g.addView(linearLayout, new LinearLayout.LayoutParams(-1, MttResources.s(24)));
linearLayout.setOrientation(0);
linearLayout.setGravity(17);
ImageView imageView = new ImageView(this.i);
imageView.setImageDrawable(MttResources.i(R.drawable.aor));
SimpleSkinBuilder.a(imageView).f();
linearLayout.addView(imageView, new LinearLayout.LayoutParams(MttResources.s(14), MttResources.s(14)));
TextView textView = new TextView(this.i);
textView.setText("清理得现金");
textView.setTextSize(0, MttResources.s(12));
SimpleSkinBuilder.a(textView).g(e.r).f();
LinearLayout.LayoutParams layoutParams9 = new LinearLayout.LayoutParams(-2, -2);
layoutParams9.leftMargin = MttResources.s(4);
linearLayout.addView(textView, layoutParams9);
this.g.addView(new TriangleView(this.i), new LinearLayout.LayoutParams(MttResources.s(10), MttResources.s(6)));
this.g.setVisibility(8);
}
public void a() {
this.f66025b.playAnimation();
}
public void a(long j) {
this.f66026c.setText(JunkFileUtils.a(j));
this.f66027d.setText(JunkFileUtils.c(j));
}
public void a(JunkInfo junkInfo, long j) {
this.f66026c.setText(JunkFileUtils.a(j));
this.f66027d.setText(JunkFileUtils.c(j));
}
public void c() {
if (this.f66025b.isAnimating()) {
ValueAnimator ofObject = ValueAnimator.ofObject(new TypeEvaluator() {
@Override
public Object evaluate(float f, Object obj, Object obj2) {
if (f < 0.5f) {
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) HeaderScaningViewNew.this.f66024a.getLayoutParams();
layoutParams.setMargins(0, (int) (MttResources.s(80) - ((MttResources.s(40) * f) * 2.0f)), 0, 0);
HeaderScaningViewNew.this.f66024a.setLayoutParams(layoutParams);
float f2 = 1.0f - (f * 2.0f);
HeaderScaningViewNew.this.f66025b.setAlpha(f2);
HeaderScaningViewNew.this.e.setAlpha(f2);
HeaderScaningViewNew.this.e.setClickable(false);
return null;
}
HeaderScaningViewNew.this.f.setVisibility(0);
HeaderScaningViewNew.this.m = true;
if (FeatureSwitcher.a(BuildConfig.FEATURE_SWITCHER_KEY_JUNKCLEAN_WELFARE) && HeaderScaningViewNew.this.h) {
HeaderScaningViewNew.this.g.setVisibility(0);
HeaderScaningViewNew.this.l = true;
}
HeaderScaningViewNew.this.e.setClickable(true);
HeaderScaningViewNew.this.f66025b.endAnimation();
HeaderScaningViewNew.this.f66025b.setVisibility(8);
((RelativeLayout.LayoutParams) HeaderScaningViewNew.this.f66024a.getLayoutParams()).setMargins(0, MttResources.s(40), 0, 0);
HeaderScaningViewNew.this.e.setText(MttResources.l(R.string.a9p));
float f3 = (f - 0.5f) * 2.0f;
HeaderScaningViewNew.this.e.setAlpha(f3);
HeaderScaningViewNew.this.f.setAlpha(f3);
((RelativeLayout.LayoutParams) HeaderScaningViewNew.this.f.getLayoutParams()).setMargins(0, 0, 0, (int) (MttResources.s(30) + (f3 * MttResources.s(30))));
return null;
}
}, 0, Float.valueOf(1.0f));
ofObject.setDuration(1000L);
ofObject.setInterpolator(new LinearInterpolator());
ofObject.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationCancel(Animator animator) {
}
@Override
public void onAnimationEnd(Animator animator) {
HeaderScaningViewNew.this.e.setAlpha(1.0f);
HeaderScaningViewNew.this.f.setAlpha(1.0f);
((RelativeLayout.LayoutParams) HeaderScaningViewNew.this.f.getLayoutParams()).setMargins(0, 0, 0, MttResources.s(60));
}
@Override
public void onAnimationRepeat(Animator animator) {
}
@Override
public void onAnimationStart(Animator animator) {
}
});
ofObject.start();
return;
}
this.e.setClickable(true);
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) this.f66024a.getLayoutParams();
layoutParams.setMargins(0, MttResources.s(40), 0, 0);
this.f66024a.setLayoutParams(layoutParams);
this.f.setVisibility(0);
this.m = true;
if (FeatureSwitcher.a(BuildConfig.FEATURE_SWITCHER_KEY_JUNKCLEAN_WELFARE) && this.h) {
this.g.setVisibility(0);
this.l = true;
}
this.f66025b.setVisibility(8);
this.e.setText(MttResources.l(R.string.a9p));
((RelativeLayout.LayoutParams) this.f.getLayoutParams()).setMargins(0, 0, 0, MttResources.s(60));
}
@Override
public void setBgColor(int i) {
}
}