QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 JunkHeadsUpContentView.java 源代码,内容仅作参考
package com.tencent.mtt.fileclean.notification;
import android.content.Context;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.text.style.ForegroundColorSpan;
import android.view.MotionEvent;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import com.tencent.mtt.R;
import com.tencent.mtt.base.skin.MttResources;
import com.tencent.mtt.base.ui.widget.QBWebImageView;
import com.tencent.mtt.fileclean.utils.LottieAnimHelper;
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.QBRelativeLayout;
import java.io.File;
import qb.a.e;
import qb.a.g;
public class JunkHeadsUpContentView extends QBRelativeLayout {
int f65818a;
String f65819b;
LottieAnimationView f65820c;
boolean f65821d;
String e;
public JunkHeadsUpContentView(Context context, int i, String str) {
super(context);
LottieAnimHelper a2;
String str2;
this.f65818a = i;
this.f65819b = str;
if (this.f65818a == 3) {
a2 = LottieAnimHelper.a();
str2 = "file_mem_headsup_anim";
} else {
a2 = LottieAnimHelper.a();
str2 = "file_delete_feedback_anim";
}
this.f65821d = a2.a(str2);
a(context);
setLayoutParams(new ViewGroup.LayoutParams(-1, MttResources.s(80)));
}
private SpannableStringBuilder a(int i, String str) {
StringBuilder sb;
String str2;
String str3 = ",急需清理";
if (i == 1) {
sb = new StringBuilder();
str2 = "微信空间占用达到 ";
} else {
if (i != 2) {
if (i == 3) {
sb = new StringBuilder();
sb.append("内存占用达到 ");
sb.append(str);
str3 = ",手机将卡慢";
} else if (i == 4) {
sb = new StringBuilder();
sb.append("手机空间不足 ");
sb.append(str);
str3 = ",将影响手机使用";
} else {
sb = new StringBuilder();
sb.append("垃圾达到 ");
sb.append(str);
str3 = ",将拖慢手机速度";
}
sb.append(str3);
String sb2 = sb.toString();
int indexOf = sb2.indexOf(str);
int length = str.length() + indexOf;
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(sb2);
spannableStringBuilder.setSpan(new ForegroundColorSpan(MttResources.c(e.V)), 0, indexOf, 33);
spannableStringBuilder.setSpan(new ForegroundColorSpan(MttResources.c(e.g)), indexOf, length, 33);
spannableStringBuilder.setSpan(new ForegroundColorSpan(MttResources.c(e.V)), length, sb2.length(), 33);
return spannableStringBuilder;
}
sb = new StringBuilder();
str2 = "QQ空间占用达到 ";
}
sb.append(str2);
sb.append(str);
sb.append(str3);
String sb22 = sb.toString();
int indexOf2 = sb22.indexOf(str);
int length2 = str.length() + indexOf2;
SpannableStringBuilder spannableStringBuilder2 = new SpannableStringBuilder(sb22);
spannableStringBuilder2.setSpan(new ForegroundColorSpan(MttResources.c(e.V)), 0, indexOf2, 33);
spannableStringBuilder2.setSpan(new ForegroundColorSpan(MttResources.c(e.g)), indexOf2, length2, 33);
spannableStringBuilder2.setSpan(new ForegroundColorSpan(MttResources.c(e.V)), length2, sb22.length(), 33);
return spannableStringBuilder2;
}
private void a(Context context) {
LottieAnimHelper a2;
String str;
QBRelativeLayout qBRelativeLayout = new QBRelativeLayout(context);
qBRelativeLayout.setGravity(21);
qBRelativeLayout.setBackgroundNormalIds(R.drawable.aaz, 0);
qBRelativeLayout.setUseMaskForNightMode(true);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, MttResources.s(64));
layoutParams.addRule(12);
int s = MttResources.s(8);
layoutParams.rightMargin = s;
layoutParams.leftMargin = s;
addView(qBRelativeLayout, layoutParams);
QBTextView qBTextView = new QBTextView(context);
qBTextView.setGravity(17);
qBTextView.setWidth(MttResources.s(70));
qBTextView.setHeight(MttResources.s(28));
qBTextView.setTextColor(MttResources.c(e.r));
qBTextView.setTextSize(MttResources.s(14));
qBTextView.setText(getBtnText());
qBTextView.setBackgroundNormalIds(R.drawable.r7, getBtnColor());
RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams2.rightMargin = MttResources.s(16);
layoutParams2.addRule(15);
layoutParams2.addRule(11);
qBRelativeLayout.addView(qBTextView, layoutParams2);
QBTextView qBTextView2 = new QBTextView(context);
qBTextView2.setMaxLines(2);
qBTextView2.setTextSize(MttResources.s(15));
qBTextView2.setWidth(MttResources.s(170));
qBTextView2.setText(a(this.f65818a, this.f65819b));
RelativeLayout.LayoutParams layoutParams3 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams3.addRule(15);
layoutParams3.addRule(9);
layoutParams3.leftMargin = MttResources.s(80);
qBRelativeLayout.addView(qBTextView2, layoutParams3);
RelativeLayout.LayoutParams layoutParams4 = new RelativeLayout.LayoutParams(MttResources.s(82), MttResources.s(80));
layoutParams4.addRule(12);
layoutParams4.addRule(9);
layoutParams4.leftMargin = MttResources.s(8);
if (this.f65821d) {
if (this.f65818a == 3) {
a2 = LottieAnimHelper.a();
str = "file_mem_headsup_anim";
} else {
a2 = LottieAnimHelper.a();
str = "file_delete_feedback_anim";
}
this.e = a2.b(str);
this.f65820c = new LottieAnimationView(context);
addView(this.f65820c, layoutParams4);
return;
}
QBWebImageView qBWebImageView = new QBWebImageView(context);
qBWebImageView.setUseMaskForNightMode(true);
qBWebImageView.setPlaceHolderDrawableId(g.f85882a);
qBWebImageView.setUrl(this.f65818a == 3 ? "https://res.imtt.qq.com/res_mtt/file/mem_heads_up_placeholder.png" : "https://res.imtt.qq.com/res_mtt/file/delete_feedback_anim_palceholder.png");
SimpleSkinBuilder.a((ImageView) qBWebImageView).f();
addView(qBWebImageView, layoutParams4);
if (this.f65818a == 3) {
LottieAnimHelper.a().h();
} else {
LottieAnimHelper.a().c();
}
}
private int getBtnColor() {
int i = this.f65818a;
return i == 1 ? e.h : i == 2 ? e.i : e.f;
}
private String getBtnText() {
int i = this.f65818a;
return i == 0 ? "立即清理" : i == 1 ? "微信专清" : i == 2 ? "QQ专清" : i == 3 ? "一键加速" : i == 4 ? "释放空间" : "立即清理";
}
public void a() {
LottieAnimHelper a2;
LottieAnimationView lottieAnimationView;
String str;
StringBuilder sb;
if (!this.f65821d || TextUtils.isEmpty(this.e)) {
return;
}
if (this.f65818a == 3) {
a2 = LottieAnimHelper.a();
lottieAnimationView = this.f65820c;
str = this.e + File.separator + "rocket.json";
sb = new StringBuilder();
} else {
a2 = LottieAnimHelper.a();
lottieAnimationView = this.f65820c;
str = this.e + File.separator + "brush.json";
sb = new StringBuilder();
}
sb.append(this.e);
sb.append(File.separator);
sb.append("images");
a2.a(lottieAnimationView, str, sb.toString());
}
@Override
public boolean onTouchEvent(MotionEvent motionEvent) {
return false;
}
}