QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 QQGameLoadingProgressView.java 源代码,内容仅作参考
package com.tencent.mtt.qqgamesdkbridge;
import android.R;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ClipDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.LayerDrawable;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.ProgressBar;
import com.tencent.mtt.base.skin.MttResources;
import com.tencent.mtt.base.ui.widget.QBWebImageView;
import com.tencent.mtt.newskin.SimpleSkinBuilder;
import com.tencent.mtt.qqgamesdkbridge.QQGameServiceImpl;
import com.tencent.mtt.view.common.QBTextView;
import com.tencent.mtt.view.layout.QBFrameLayout;
import java.util.Random;
import qb.a.g;
public class QQGameLoadingProgressView extends QBFrameLayout {
public QBWebImageView f69687a;
public QBTextView f69688b;
public ProgressBar f69689c;
public QBTextView f69690d;
public QBTextView e;
public Handler f;
public String g;
public String h;
class MHandler extends Handler {
public MHandler() {
}
@Override
public void handleMessage(Message message) {
Random random = new Random();
int i = message.what;
if (i == 0) {
QQGameLoadingProgressView.this.f69689c.setProgress(message.arg1);
QQGameLoadingProgressView.this.e.setText(message.arg1 + "%");
if (message.arg1 >= 88 || QQGameLoadingProgressView.this.f69689c.getProgress() == 100) {
return;
}
int nextInt = random.nextInt(6) + message.arg1;
Message obtain = Message.obtain();
obtain.what = 0;
obtain.arg1 = nextInt;
QQGameLoadingProgressView.this.f.sendMessageDelayed(obtain, 100L);
return;
}
if (i != 1) {
if (i != 2) {
return;
}
Message obtain2 = Message.obtain();
int i2 = message.arg1 - 1;
message.arg1 = i2;
obtain2.arg1 = i2;
if (obtain2.arg1 == 0) {
QQGameServiceImpl.getInstance().a(-1, new MResultCallBack());
return;
} else {
obtain2.what = 2;
QQGameLoadingProgressView.this.f.sendMessageDelayed(obtain2, 1000L);
return;
}
}
QQGameLoadingProgressView.this.f69689c.setProgress(100);
QQGameLoadingProgressView.this.f69689c.setVisibility(4);
QQGameLoadingProgressView.this.e.setVisibility(4);
QQGameLoadingProgressView.this.f69687a.f();
QQGameLoadingProgressView.this.f69687a.setUrl("https://img.nfa.qq.com/gmaster_prod/15933024/gmaster_4uilyhdvaza0_done_icon.png");
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) QQGameLoadingProgressView.this.f69687a.getLayoutParams();
layoutParams.width = MttResources.s(45);
layoutParams.height = MttResources.s(45);
layoutParams.leftMargin = MttResources.s(36);
layoutParams.topMargin = MttResources.s(55);
QQGameLoadingProgressView.this.f69687a.setLayoutParams(layoutParams);
QQGameLoadingProgressView.this.f69688b.setText(QQGameLoadingProgressView.this.g);
QQGameLoadingProgressView.this.f69690d.setText(QQGameLoadingProgressView.this.h);
QQGameLoadingProgressView.this.f69690d.setTextSize(MttResources.s(18));
}
}
private static class MResultCallBack implements QQGameServiceImpl.OnLoadResultCallback {
private MResultCallBack() {
}
@Override
public void a(boolean z, int i, String str) {
if (!z || TextUtils.isEmpty(QQGameServiceImpl.getInstance().f69705a.f69749b)) {
return;
}
if (!TextUtils.isEmpty(QQGameServiceImpl.getInstance().f69705a.f69748a)) {
QQGameSdkBridge.a(QQGameServiceImpl.getInstance().f69705a.f69748a, QQGameServiceImpl.getInstance().f69705a.f69749b, QQGameServiceImpl.getInstance().f69705a.f69750c);
} else {
if (TextUtils.isEmpty(QQGameServiceImpl.getInstance().f69705a.f69751d) || QQGameServiceImpl.getInstance().f69705a.e == Integer.MIN_VALUE) {
return;
}
QQGameSdkBridge.a(QQGameServiceImpl.getInstance().f69705a.f69751d, QQGameServiceImpl.getInstance().f69705a.e, QQGameServiceImpl.getInstance().f69705a.f69749b, QQGameServiceImpl.getInstance().f69705a.f69750c);
}
}
}
public QQGameLoadingProgressView(Context context) {
super(context);
this.f = new MHandler();
setLayoutParams(new ViewGroup.LayoutParams(-1, -1));
GradientDrawable gradientDrawable = new GradientDrawable();
gradientDrawable.setColor(-1);
float s = MttResources.s(3);
gradientDrawable.setCornerRadii(new float[]{s, s, s, s, s, s, s, s});
setBackgroundDrawable(gradientDrawable);
this.f69687a = new QBWebImageView(context);
this.f69687a.setUrl("https://img.nfa.qq.com/bigfiles_prod/15934752/gmaster_25drc1r9eibk_qb_game_gif.gif");
this.f69687a.setPlaceHolderDrawableId(g.f85882a);
SimpleSkinBuilder.a((ImageView) this.f69687a).f();
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(MttResources.s(100), MttResources.s(100));
layoutParams.topMargin = MttResources.s(18);
layoutParams.leftMargin = MttResources.s(3);
layoutParams.bottomMargin = MttResources.s(38);
addView(this.f69687a, layoutParams);
this.f69688b = new QBTextView(context);
this.f69688b.setTextSize(MttResources.s(18));
this.f69688b.setTextColor(Color.parseColor("#242424"));
FrameLayout.LayoutParams layoutParams2 = new FrameLayout.LayoutParams(-2, -2);
layoutParams2.leftMargin = MttResources.s(100);
layoutParams2.topMargin = MttResources.s(54);
addView(this.f69688b, layoutParams2);
this.f69690d = new QBTextView(context);
this.f69690d.setTextSize(MttResources.s(14));
this.f69690d.setTextColor(Color.parseColor("#242424"));
FrameLayout.LayoutParams layoutParams3 = new FrameLayout.LayoutParams(-2, -2);
layoutParams3.leftMargin = MttResources.s(100);
layoutParams3.topMargin = MttResources.s(80);
addView(this.f69690d, layoutParams3);
this.e = new QBTextView(context);
this.e.setTextSize(MttResources.s(14));
this.e.setText("0%");
this.e.setTextColor(Color.parseColor("#3FBFCA"));
FrameLayout.LayoutParams layoutParams4 = new FrameLayout.LayoutParams(-2, -2);
layoutParams4.gravity = 81;
layoutParams4.bottomMargin = MttResources.s(11);
addView(this.e, layoutParams4);
this.f69689c = new ProgressBar(context, null, R.attr.progressBarStyleHorizontal);
GradientDrawable gradientDrawable2 = new GradientDrawable();
gradientDrawable2.setColor(Color.parseColor("#f2f2f2"));
gradientDrawable2.setCornerRadii(new float[]{0.0f, 0.0f, 0.0f, 0.0f, s, s, s, s});
GradientDrawable gradientDrawable3 = new GradientDrawable();
gradientDrawable3.setCornerRadii(new float[]{0.0f, 0.0f, 0.0f, 0.0f, s, s, s, s});
gradientDrawable3.setColor(Color.parseColor("#3FBFCA"));
LayerDrawable layerDrawable = new LayerDrawable(new Drawable[]{gradientDrawable2, new ClipDrawable(gradientDrawable3, 3, 1)});
layerDrawable.setId(0, R.id.background);
layerDrawable.setId(1, R.id.progress);
this.f69689c.setProgressDrawable(layerDrawable);
this.f69689c.setMax(100);
FrameLayout.LayoutParams layoutParams5 = new FrameLayout.LayoutParams(-1, MttResources.s(5));
layoutParams5.gravity = 80;
layoutParams5.topMargin = MttResources.s(151);
addView(this.f69689c, layoutParams5);
}
public void a() {
int nextInt = new Random().nextInt(4);
Message obtain = Message.obtain();
obtain.what = 0;
obtain.arg1 = nextInt;
this.f.sendMessage(obtain);
Message obtain2 = Message.obtain();
obtain2.what = 2;
obtain2.arg1 = 15;
this.f.sendMessage(obtain2);
}
public void b() {
this.f.removeCallbacksAndMessages(null);
}
}