QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 SogouTransBeginnerTipsView.java 源代码,内容仅作参考
package com.tencent.mtt.external.explorerone.newcamera.scan.translate.sogou.tips.ui;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.RelativeLayout;
import androidx.viewpager.widget.ViewPager;
import com.tencent.common.utils.DeviceUtils;
import com.tencent.mtt.R;
import com.tencent.mtt.base.skin.MttResources;
import com.tencent.mtt.base.ui.widget.QBWebImageView;
import com.tencent.mtt.external.explorerone.newcamera.scan.translate.sogou.tips.banner.ScaleBanner;
import com.tencent.mtt.view.layout.QBFrameLayout;
public class SogouTransBeginnerTipsView extends QBFrameLayout implements ScaleBanner.IViewPagerContentView {
String[] f53612a;
private IOnPagerScrolledListener f53613b;
private View.OnClickListener f53614c;
private ImageButton f53615d;
private ScaleBanner e;
public interface IOnPagerScrolledListener {
void a(int i);
}
public SogouTransBeginnerTipsView(Context context) {
super(context);
this.f53612a = new String[]{"https://m4.publicimg.browser.qq.com/publicimg/nav/sogou_beginner_guide/trans_tips_common.png", "https://m4.publicimg.browser.qq.com/publicimg/nav/sogou_beginner_guide/trans_tips_smear.png", "https://m4.publicimg.browser.qq.com/publicimg/nav/sogou_beginner_guide/trans_tips_menu.png"};
a(context);
}
private void a(Context context) {
int i;
LayoutInflater.from(context).inflate(R.layout.ti, (ViewGroup) this, true);
RelativeLayout relativeLayout = (RelativeLayout) findViewById(R.id.beginner_guide_content);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, -2);
this.e = (ScaleBanner) findViewById(R.id.banner);
this.f53615d = (ImageButton) findViewById(R.id.tips_btn_close);
this.e.setPageMargin(10);
this.e.setDataCount(this.f53612a.length);
int R = DeviceUtils.R() - (MttResources.s(238) + DeviceUtils.Z());
int s = MttResources.s(362);
int s2 = R - MttResources.s(8);
if (s2 >= s) {
this.e.a(238, 309);
i = 181;
} else {
float f = (s2 * 1.0f) / s;
float f2 = 309.0f * f;
this.e.a((int) (f * 238.0f), (int) f2);
i = ((int) ((23.0f + f2) + 30.0f)) / 2;
}
layoutParams.bottomMargin = MttResources.s(176) + ((s2 / 2) - MttResources.s(i));
layoutParams.addRule(12);
relativeLayout.setLayoutParams(layoutParams);
this.e.setViewPagerContentView(this);
this.e.setPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrollStateChanged(int i2) {
}
@Override
public void onPageScrolled(int i2, float f3, int i3) {
}
@Override
public void onPageSelected(int i2) {
if (SogouTransBeginnerTipsView.this.f53613b != null) {
SogouTransBeginnerTipsView.this.f53613b.a(i2);
}
}
});
RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(DeviceUtils.Q() / 2, -2);
layoutParams2.addRule(14);
layoutParams2.addRule(10);
this.e.setLayoutParams(layoutParams2);
}
@Override
public View a(int i) {
View inflate = LayoutInflater.from(getContext()).inflate(R.layout.th, (ViewGroup) null);
inflate.setTag(Integer.valueOf(i));
inflate.setOnClickListener(this.f53614c);
((QBWebImageView) inflate.findViewById(R.id.tip_image)).setImageURI(this.f53612a[i]);
return inflate;
}
public void setClickListener(View.OnClickListener onClickListener) {
this.f53614c = onClickListener;
this.f53615d.setOnClickListener(onClickListener);
}
public void setInitItem(int i) {
ScaleBanner scaleBanner = this.e;
if (scaleBanner != null) {
scaleBanner.setCurrentItem(1);
}
}
public void setScrollListener(IOnPagerScrolledListener iOnPagerScrolledListener) {
this.f53613b = iOnPagerScrolledListener;
}
}