QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685

以下内容为反编译后的 NovelShelfBannerContainerV2.java 源代码,内容仅作参考


package com.tencent.mtt.external.novel.home;

import android.graphics.Paint;
import android.graphics.Rect;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import com.tencent.mtt.ContextHolder;
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.DeviceUtils;
import com.tencent.mtt.external.novel.base.MTT.stShelfBanner;
import com.tencent.mtt.external.novel.base.tools.NovelContext;
import com.tencent.mtt.external.novel.base.ui.NovelBaseContainer;
import com.tencent.mtt.external.novel.ui.inter.INovelShelfListView;
import com.tencent.mtt.newskin.SimpleSkinBuilder;
import com.tencent.mtt.view.common.QBImageView;
import com.tencent.mtt.view.layout.QBFrameLayout;
import com.tencent.qqlive.module.videoreport.collect.EventCollector;
import java.util.HashMap;
import java.util.HashSet;

public class NovelShelfBannerContainerV2 extends QBFrameLayout implements View.OnClickListener {
    static final int k = MttResources.u(2);
    static final int l = MttResources.u(5);
    static final int m = MttResources.u(5) - NovelShelfGridCommon.h();

    QBFrameLayout f55135a;

    String f55136b;

    String f55137c;

    public String f55138d;
    int e;
    HashSet<View.OnClickListener> f;
    boolean g;
    Paint h;
    Rect i;
    final float[] j;
    int n;
    QBImageView o;
    QBWebImageView p;
    INovelShelfListView q;
    private NovelContext r;

    public NovelShelfBannerContainerV2(NovelContext novelContext, INovelShelfListView iNovelShelfListView) {
        super(ContextHolder.getAppContext());
        this.f55135a = null;
        this.f55136b = null;
        this.f55137c = "";
        this.f55138d = "";
        this.e = 0;
        this.f = new HashSet<>();
        this.g = false;
        this.h = null;
        this.i = new Rect();
        this.j = new float[28];
        this.n = 0;
        this.o = null;
        this.p = null;
        this.r = novelContext;
        this.q = iNovelShelfListView;
        int u = MttResources.u(12);
        MttResources.u(9);
        setLayoutParams(new FrameLayout.LayoutParams(-1, u + l + m, 17));
        this.f55135a = new QBFrameLayout(this.q.getContext());
        FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(DeviceUtils.H() - MttResources.s(96), -1);
        layoutParams.topMargin = l;
        layoutParams.bottomMargin = m;
        addView(this.f55135a, layoutParams);
        this.o = new QBImageView(this.q.getContext());
        this.o.setFocusable(true);
        this.o.setBackgroundNormalPressIds(0, 0, 0, 0);
        this.o.setOnClickListener(this);
        FrameLayout.LayoutParams layoutParams2 = new FrameLayout.LayoutParams(-1, -1);
        layoutParams2.topMargin = l;
        layoutParams2.bottomMargin = m;
        addView(this.o, layoutParams2);
        this.p = new QBWebImageView(getContext());
        FrameLayout.LayoutParams layoutParams3 = new FrameLayout.LayoutParams(MttResources.s(80), MttResources.s(48));
        layoutParams3.gravity = 5;
        layoutParams3.topMargin = l;
        layoutParams3.bottomMargin = m;
        addView(this.p, layoutParams3);
        StatManager.b().c("AKH263");
        this.p.setScaleType(ImageView.ScaleType.FIT_XY);
        this.p.setUrl("https://res.imtt.qq.com/bookshelf/images/huodong/novel_welfares_default_bg-1533634007.png");
        this.p.e();
        this.p.setUseNightModeMask(true);
        SimpleSkinBuilder.a((ImageView) this.p).f();
        this.p.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                EventCollector.getInstance().onViewClickedBefore(view);
                Bundle bundle = new Bundle();
                bundle.putString("book_quan_post_info_url", "https://bookshelf.html5.qq.com/discovery.html#!/benefits");
                bundle.putBoolean("book_quan_from_titlebar", false);
                if (NovelShelfBannerContainerV2.this.q.getHomePageBase() != null) {
                    ((NovelBaseContainer) NovelShelfBannerContainerV2.this.q.getHomePageBase().getNativeGroup()).a(36, bundle, true, (Object) null);
                }
                StatManager.b().c("AKH264");
                EventCollector.getInstance().onViewClicked(view);
            }
        });
    }

    public void a(View view, String str, int i, String str2, String str3) {
        this.f55135a.removeAllViews();
        this.f55135a.addView(view, new FrameLayout.LayoutParams(-1, -1));
        this.f55136b = str;
        this.e = i;
        this.f55137c = str2;
        this.f55138d = str3;
    }

    public void a(final stShelfBanner stshelfbanner) {
        if (stshelfbanner == null || TextUtils.isEmpty(stshelfbanner.sPicurl) || TextUtils.isEmpty(stshelfbanner.sRefer)) {
            this.r.h().c("", 27, 1);
            return;
        }
        if (this.p == null) {
            this.p = new QBWebImageView(getContext());
            FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(MttResources.s(80), MttResources.s(48));
            layoutParams.gravity = 5;
            layoutParams.topMargin = l;
            layoutParams.bottomMargin = m;
            addView(this.p, layoutParams);
        }
        this.p.setScaleType(ImageView.ScaleType.CENTER);
        this.p.setUrl(stshelfbanner.sPicurl);
        this.p.setUseNightModeMask(true);
        HashMap hashMap = new HashMap();
        hashMap.put("key", "AKH263");
        hashMap.put("slotid", stshelfbanner.sSlotId);
        hashMap.put("url", stshelfbanner.sRefer);
        StatManager.b().b("novel_operation_data", hashMap);
        this.r.h().c(stshelfbanner.sSlotId, 27, 0);
        this.p.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                EventCollector.getInstance().onViewClickedBefore(view);
                Bundle bundle = new Bundle();
                bundle.putString("book_quan_post_info_url", stshelfbanner.sRefer);
                bundle.putBoolean("book_quan_from_titlebar", false);
                if (NovelShelfBannerContainerV2.this.q.getHomePageBase() != null) {
                    ((NovelBaseContainer) NovelShelfBannerContainerV2.this.q.getHomePageBase().getNativeGroup()).a(36, bundle, true, (Object) null);
                }
                StatManager.b().c("AKH264");
                HashMap hashMap2 = new HashMap();
                hashMap2.put("key", "AKH264");
                hashMap2.put("slotid", stshelfbanner.sSlotId);
                hashMap2.put("url", stshelfbanner.sRefer);
                StatManager.b().b("novel_operation_data", hashMap2);
                EventCollector.getInstance().onViewClicked(view);
            }
        });
    }

    public void a(boolean z) {
        setEnabled(!z);
        setClickable(!z);
        QBImageView qBImageView = this.o;
        if (qBImageView != null) {
            qBImageView.setEnabled(!z);
            this.o.setClickable(!z);
        }
        QBWebImageView qBWebImageView = this.p;
        if (qBWebImageView != null) {
            qBWebImageView.setClickable(!z);
        }
    }

    @Override
    public void onClick(View view) {
        EventCollector.getInstance().onViewClickedBefore(view);
        StatManager.b().c(this.r.f54692a == 0 ? "H160" : "AKP41");
        HashMap hashMap = new HashMap();
        hashMap.put("key", this.r.f54692a != 0 ? "AKP41" : "H160");
        hashMap.put("url", this.f55136b);
        hashMap.put("slotid", this.f55137c);
        StatManager.b().b("novel_operation_data", hashMap);
        this.q.a(this.f55136b, this.e, null);
        StatManager.b().c("AKH201");
        hashMap.put("key", "AKH201");
        hashMap.put("slotid", this.f55137c);
        hashMap.put("url", this.f55136b);
        StatManager.b().b("novel_operation_data", new HashMap());
        EventCollector.getInstance().onViewClicked(view);
    }

    @Override
    public void switchSkin() {
        super.switchSkin();
        invalidate();
    }
}