QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 SearchIconContainer.java 源代码,内容仅作参考
package com.tencent.mtt.browser.homepage.view.search;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.view.animation.DecelerateInterpolator;
import android.widget.FrameLayout;
import com.tencent.mtt.browser.homepage.view.search.hotword.OnSearchIconAnimListener;
import com.tencent.mtt.browser.homepage.view.search.simplemode.SearchBarResourceProxy;
import com.tencent.mtt.costtimelite.CostTimeLite;
import com.tencent.mtt.search.hotwords.SearchHotwordInfo;
import com.tencent.mtt.view.toast.MttToaster;
import qb.a.g;
public class SearchIconContainer extends FrameLayout {
private boolean f41017a;
private boolean f41018b;
private SearchIcon f41019c;
private SearchIcon f41020d;
private final Context e;
private final View.OnClickListener f;
private int g;
private final int h;
private final int i;
private final boolean j;
private boolean k;
private final SearchBarResourceProxy l;
public SearchIconContainer(Context context, View.OnClickListener onClickListener, int i, int i2, int i3, boolean z, SearchBarResourceProxy searchBarResourceProxy) {
super(context);
this.f41017a = false;
this.f41018b = false;
this.f41020d = null;
this.l = searchBarResourceProxy;
searchBarResourceProxy.a(this);
this.e = context;
this.f = onClickListener;
this.g = i;
this.j = z;
CostTimeLite.a("Boot", "SearchBarView.mSearchIcon");
this.h = i2;
this.i = i3;
this.f41019c = new SearchIcon(context, onClickListener, i, i2, this.i, this.j, searchBarResourceProxy);
addView(this.f41019c);
CostTimeLite.b("Boot", "SearchBarView.mSearchIcon");
}
public SearchIconContainer(Context context, View.OnClickListener onClickListener, int i, SearchBarResourceProxy searchBarResourceProxy) {
this(context, onClickListener, i, g.cZ, SearchBarView.e, false, searchBarResourceProxy);
}
private String a(SearchHotwordInfo searchHotwordInfo) {
if (this.f41017a) {
MttToaster.show("搜索Tag的测试开关当前处于打开状态", 0);
int random = (int) (Math.random() * 5.0d);
if (random == 0) {
return "https://static.res.qq.com/nav/hotword_xin.png";
}
if (random == 1) {
return "https://static.res.qq.com/nav/hotword_re.png";
}
if (random == 2) {
return "https://static.res.qq.com/nav/hotword_jian.png";
}
if (random == 3) {
return "https://static.res.qq.com/nav/hotword_bao.png";
}
if (random == 4) {
return null;
}
}
if (b(searchHotwordInfo)) {
return searchHotwordInfo.c().get(0).sTagUrl;
}
return null;
}
public void a(float f, View view) {
view.setScaleX(f);
view.setScaleY(f);
}
private void a(View view) {
view.setVisibility(0);
view.setAlpha(1.0f);
a(1.0f, view);
}
private void a(final OnSearchIconAnimListener onSearchIconAnimListener) {
ValueAnimator ofFloat = ValueAnimator.ofFloat(0.0f, 1.0f);
ofFloat.setDuration(400L);
ofFloat.setInterpolator(new DecelerateInterpolator());
ofFloat.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
long floatValue = ((Float) valueAnimator.getAnimatedValue()).floatValue() * 400.0f;
if (floatValue >= 320) {
SearchIconContainer searchIconContainer = SearchIconContainer.this;
searchIconContainer.a(((((float) (floatValue - 320)) / 80.0f) * (-0.100000024f)) + 1.1f, searchIconContainer.f41020d);
return;
}
float f = ((float) floatValue) / 320.0f;
SearchIconContainer.this.f41020d.setAlpha((0.36f * f) + 0.64f);
float f2 = ((-1.0f) * f) + 1.0f;
SearchIconContainer.this.f41019c.setAlpha(f2);
SearchIconContainer searchIconContainer2 = SearchIconContainer.this;
searchIconContainer2.a((f * 1.1f) + 0.0f, searchIconContainer2.f41020d);
SearchIconContainer searchIconContainer3 = SearchIconContainer.this;
searchIconContainer3.a(f2, searchIconContainer3.f41019c);
}
});
ofFloat.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animator) {
super.onAnimationEnd(animator);
onSearchIconAnimListener.a();
}
});
ofFloat.start();
}
private boolean a(String str) {
return TextUtils.equals(str, "setEngineIcon");
}
private boolean b(SearchHotwordInfo searchHotwordInfo) {
return (searchHotwordInfo == null || searchHotwordInfo.c() == null || searchHotwordInfo.c().size() <= 0 || searchHotwordInfo.c().get(0) == null) ? false : true;
}
private void c() {
if (this.f41020d == null) {
this.f41020d = new SearchIcon(this.e, this.f, this.g, this.h, this.i, this.j, this.l);
addView(this.f41020d);
}
}
public void d() {
SearchIcon searchIcon = this.f41019c;
this.f41019c = this.f41020d;
this.f41020d = searchIcon;
this.f41020d.setVisibility(8);
}
public void a() {
this.f41019c.k();
SearchIcon searchIcon = this.f41020d;
if (searchIcon != null) {
searchIcon.k();
}
}
public void a(int i) {
this.f41019c.a(i);
SearchIcon searchIcon = this.f41020d;
if (searchIcon != null) {
searchIcon.a(i);
}
}
public void a(Integer num, boolean z) {
this.f41019c.a(num, z);
}
public void a(boolean z, SearchHotwordInfo searchHotwordInfo) {
if (this.k) {
return;
}
String lastAction = this.f41019c.getLastAction();
String a2 = a(searchHotwordInfo);
if (a(lastAction)) {
return;
}
if (TextUtils.equals(lastAction, "setDefaultBitmap") && SearchIcon.a(a2)) {
return;
}
if (TextUtils.equals(lastAction, "setOperationIcon_" + a2)) {
return;
}
c();
a(this.f41019c);
a(this.f41020d);
this.f41020d.bringToFront();
this.f41020d.setOperationImgUrl(a2);
this.f41020d.k();
if (!z) {
d();
} else {
this.f41018b = true;
a(new OnSearchIconAnimListener() {
@Override
public void a() {
SearchIconContainer.this.d();
SearchIconContainer.this.f41018b = false;
}
});
}
}
public boolean b() {
return this.f41018b;
}
public void setDefaultIcon(boolean z) {
this.k = z;
}
}