QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 CenterTextLoadingView.java 源代码,内容仅作参考
package com.tencent.mtt.file.page.doctranslate.resultpage;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.view.animation.LinearInterpolator;
import android.widget.FrameLayout;
import com.tencent.mtt.base.skin.MttResources;
import com.tencent.mtt.base.ui.widget.QBWebImageView;
import com.tencent.mtt.view.common.QBTextView;
import com.tencent.mtt.view.layout.QBFrameLayout;
import qb.a.e;
import qb.a.g;
public class CenterTextLoadingView extends QBFrameLayout {
private int f60550a;
private int f60551b;
private QBWebImageView f60552c;
private QBTextView f60553d;
private ObjectAnimator e;
private String f;
private boolean g;
public CenterTextLoadingView(Context context) {
super(context);
this.f60550a = MttResources.s(61);
this.f60551b = MttResources.s(16);
c();
}
private void c() {
removeAllViews();
if (this.f60552c == null) {
this.f60552c = new QBWebImageView(getContext());
this.f60552c.setPlaceHolderDrawableId(g.f85882a);
this.f60552c.setEnableNoPicMode(false);
this.f60552c.setUseMaskForNightMode(true);
this.f60552c.setUrl("https://static.res.qq.com/qbt/process/loading.png");
}
int i = this.f60550a;
addView(this.f60552c, new FrameLayout.LayoutParams(i, i));
if (this.f60553d == null) {
this.f60553d = new QBTextView(getContext());
this.f60553d.setIncludeFontPadding(false);
this.f60553d.setTextColorNormalIds(e.f);
}
this.f60553d.setTextSize(0, this.f60551b);
this.f60553d.setText(this.f);
this.f60553d.setGravity(17);
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(-1, -1);
layoutParams.gravity = 17;
addView(this.f60553d, layoutParams);
if (this.g) {
a();
}
}
protected void a() {
b();
float rotation = this.f60552c.getRotation();
this.e = ObjectAnimator.ofFloat(this.f60552c, "rotation", rotation, rotation + 360.0f).setDuration(1200L);
this.e.setInterpolator(new LinearInterpolator());
this.e.setRepeatCount(-1);
this.e.start();
}
protected void b() {
ObjectAnimator objectAnimator = this.e;
if (objectAnimator != null) {
objectAnimator.cancel();
this.e = null;
}
}
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
this.g = true;
a();
}
@Override
protected void onDetachedFromWindow() {
this.g = false;
b();
super.onDetachedFromWindow();
}
public void setLoadingSize(int i) {
this.f60550a = i;
}
public void setLoadingText(String str) {
this.f = str;
this.f60553d.setText(str);
}
public void setTextSize(int i) {
this.f60551b = i;
}
}