QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 BaiduActivity.java 源代码,内容仅作参考
package com.tencent.mtt.browser.desktop.baidu;
import android.content.res.Configuration;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.tencent.mtt.QbActivityBase;
import com.tencent.mtt.R;
import com.tencent.mtt.base.functionwindow.ActivityHandler;
import com.tencent.mtt.base.skin.MttResources;
import com.tencent.mtt.base.stat.StatManager;
import com.tencent.mtt.base.ui.widget.QBWebImageView;
import com.tencent.mtt.base.utils.CommonUtils;
import com.tencent.mtt.browser.desktop.baidu.HotwordWallView;
import com.tencent.mtt.view.common.QBTextView;
import com.tencent.mtt.view.layout.QBLinearLayout;
import com.tencent.qqlive.module.videoreport.collect.EventCollector;
import java.util.List;
import qb.a.e;
import qb.a.f;
public class BaiduActivity extends QbActivityBase implements ActivityHandler.ApplicationStateListener, EnterSearchView {
public static final String KEY_NAME = "baiduNative";
private BaiduPresenter f36458a;
private QBLinearLayout f36459b;
private HotwordWallView f36460c;
public static final int BAIDU_LOGO_WIDTH = MttResources.g(f.bJ);
public static final int BAIDU_LOGO_HEIGHT = MttResources.g(f.ae);
public static final int INPUT_CONTAINER_HEIGHT = MttResources.g(f.U);
public static final int INPUT_CONTAINER_MARGIN = MttResources.g(f.r);
public static final int BAIDU_BT_MARGIN = MttResources.g(f.f85881d);
public static final int BAIDU_HOTWORD_PANEL_HEIGHT = MttResources.g(R.dimen.j1);
@Override
public boolean dispatchTouchEvent(MotionEvent motionEvent) {
EventCollector.getInstance().onActivityDispatchTouchEvent(this, motionEvent, false, true);
boolean dispatchTouchEvent = super.dispatchTouchEvent(motionEvent);
EventCollector.getInstance().onActivityDispatchTouchEvent(this, motionEvent, dispatchTouchEvent, false);
return dispatchTouchEvent;
}
@Override
public void onApplicationState(ActivityHandler.State state) {
if (state == ActivityHandler.State.finish) {
finish();
}
}
@Override
public void onBackPressed() {
finish();
}
@Override
public void onConfigurationChanged(Configuration configuration) {
super.onConfigurationChanged(configuration);
EventCollector.getInstance().onActivityConfigurationChanged(this, configuration);
}
@Override
public void onCreate(Bundle bundle) {
CommonUtils.a(getIntent());
super.onCreate(bundle);
if (checkShuttingStatus(false)) {
return;
}
StatManager.b().c("AWND020");
ActivityHandler.b().a((ActivityHandler.ApplicationStateListener) this);
this.f36458a = new BaiduPresenterImp(this);
BaiduPresenter baiduPresenter = this.f36458a;
baiduPresenter.a(new HotwordDataManager(baiduPresenter));
this.f36458a.c();
getWindow().setSoftInputMode(16);
this.f36459b = new QBLinearLayout(this);
this.f36459b.setOrientation(1);
this.f36459b.setGravity(17);
this.f36459b.setBackgroundColor(MttResources.c(R.color.h3));
QBWebImageView qBWebImageView = new QBWebImageView(this);
qBWebImageView.setScaleType(ImageView.ScaleType.FIT_XY);
qBWebImageView.setUrl("https://res.imtt.qq.com/res_mtt/common/baidu.png");
this.f36459b.addView(qBWebImageView, new LinearLayout.LayoutParams(BAIDU_LOGO_WIDTH, BAIDU_LOGO_HEIGHT));
QBLinearLayout qBLinearLayout = new QBLinearLayout(this);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, INPUT_CONTAINER_HEIGHT);
int i = INPUT_CONTAINER_MARGIN;
layoutParams.topMargin = i;
layoutParams.leftMargin = i;
layoutParams.rightMargin = i;
qBLinearLayout.setGravity(5);
qBLinearLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
EventCollector.getInstance().onViewClickedBefore(view);
BaiduActivity.this.f36458a.a();
EventCollector.getInstance().onViewClicked(view);
}
});
qBLinearLayout.setOrientation(0);
GradientDrawable gradientDrawable = new GradientDrawable();
gradientDrawable.setCornerRadius(MttResources.g(f.f85879c));
gradientDrawable.setColor(MttResources.c(R.color.h3));
gradientDrawable.setStroke(1, MttResources.c(e.f));
qBLinearLayout.setBackgroundDrawable(gradientDrawable);
this.f36459b.addView(qBLinearLayout, layoutParams);
QBTextView qBTextView = new QBTextView(this);
LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(MttResources.h(f.aw), -1);
qBTextView.setTextSize(MttResources.h(f.r));
qBTextView.setText(MttResources.n(R.string.my));
qBTextView.setTextColor(-1);
qBTextView.setBackgroundColor(-11756806);
qBTextView.setGravity(17);
qBLinearLayout.addView(qBTextView, layoutParams2);
this.f36460c = new HotwordWallView(this);
LinearLayout.LayoutParams layoutParams3 = new LinearLayout.LayoutParams(-1, BAIDU_HOTWORD_PANEL_HEIGHT);
layoutParams3.leftMargin = MttResources.g(f.r);
layoutParams3.rightMargin = MttResources.g(f.r);
layoutParams3.topMargin = MttResources.g(f.z);
this.f36460c.setHotwordOnClickListener(new HotwordWallView.HotwordOnClickListener() {
@Override
public void a(String str) {
if (TextUtils.isEmpty(str)) {
return;
}
BaiduActivity.this.f36458a.a(str);
}
});
this.f36459b.addView(this.f36460c, layoutParams3);
setContentView(this.f36459b);
}
@Override
public void onDestroy() {
ActivityHandler.b().b((ActivityHandler.ApplicationStateListener) this);
this.f36458a.d();
super.onDestroy();
}
@Override
public void onResume() {
super.onResume();
this.f36458a.b();
}
@Override
public void setData(List<String> list) {
if (list == null || list.size() <= 0) {
this.f36460c.setVisibility(4);
} else {
this.f36460c.setVisibility(0);
this.f36460c.a(list);
}
}
}