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

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


package com.tencent.mtt.external.market.ui.page;

import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import com.tencent.common.utils.UrlUtils;
import com.tencent.mtt.R;
import com.tencent.mtt.base.functionwindow.IFunctionWndFactory;
import com.tencent.mtt.base.skin.MttResources;
import com.tencent.mtt.base.stat.StatManager;
import com.tencent.mtt.base.webview.QBWebView;
import com.tencent.mtt.browser.window.UrlParams;
import com.tencent.mtt.browser.window.data.PageInfo;
import com.tencent.mtt.businesscenter.facade.IFrameworkDelegate;
import com.tencent.mtt.cmc.CMC;
import com.tencent.mtt.external.market.MTT.QBAppReportUserAction;
import com.tencent.mtt.external.market.QQMPageData;
import com.tencent.mtt.external.market.QQMarketContainer;
import com.tencent.mtt.external.market.ui.QQMarketTitleBarAreaBuilder;
import com.tencent.mtt.external.market.ui.frame.IQQMarketFrame;
import com.tencent.mtt.external.market.ui.frame.QQMarketFrameFactory;
import com.tencent.mtt.external.market.ui.frame.QQMarketWebViewFrame;
import com.tencent.mtt.external.market.ui.list.QQMarketSoftItemData;
import com.tencent.mtt.external.market.utils.QQMarketCommonUtils;
import com.tencent.mtt.external.market.utils.QQMarketUIUtils;
import com.tencent.mtt.external.market.utils.QQMarketUrlUtil;
import com.tencent.mtt.external.setting.base.ImageLoadManager;
import com.tencent.mtt.history.base.IHistory;
import com.tencent.mtt.qbcontext.core.QBContext;
import com.tencent.mtt.sdkcontext.SDKContext;
import com.tencent.mtt.view.common.QBImageTextView;
import com.tencent.mtt.view.common.QBImageView;
import com.tencent.mtt.view.common.QBTextView;
import com.tencent.mtt.view.common.QBViewResourceManager;
import com.tencent.mtt.view.layout.QBFrameLayout;
import com.tencent.mtt.view.layout.QBLinearLayout;
import com.tencent.qqlive.module.videoreport.collect.EventCollector;
import java.util.HashMap;
import java.util.Map;
import qb.a.f;
import qb.a.h;

public class QQMarketBusinessPage extends BaseNativePage implements View.OnClickListener {

    public QQMPageData f54120a;

    protected String f54121b;

    QQMarketContainer f54122c;

    private IQQMarketFrame f54123d;
    private String e;
    private QBLinearLayout f;
    private String g;
    private boolean h;
    private QBTextView i;
    private QBImageTextView j;
    private QBImageView k;
    private View l;
    private View m;
    private boolean n;

    public QQMarketBusinessPage(QQMarketContainer qQMarketContainer, Context context, QQMPageData qQMPageData, String str) {
        super(context, new FrameLayout.LayoutParams(-1, -1), qQMarketContainer, 0);
        String a2;
        QBFrameLayout qBFrameLayout = null;
        this.f54120a = null;
        this.f54123d = null;
        this.e = "";
        this.f54121b = "";
        this.f = null;
        this.g = "";
        this.h = false;
        this.f54122c = null;
        this.i = null;
        this.j = null;
        this.k = null;
        this.l = null;
        this.m = null;
        this.n = false;
        this.f54122c = qQMarketContainer;
        this.f54120a = qQMPageData;
        this.f = new QBLinearLayout(getContext());
        this.f.setOrientation(1);
        QQMarketUIUtils.a(this, this.f);
        int i = QQMarketTitleBarAreaBuilder.f54104a;
        this.g = QQMarketUrlUtil.a("ref", str);
        if (b()) {
            qBFrameLayout = QQMarketTitleBarAreaBuilder.a(context, true);
            setNormalEntryWidget(qBFrameLayout);
        } else {
            QQMPageData qQMPageData2 = this.f54120a;
            if (qQMPageData2 == null || qQMPageData2.f53830a.f53827c != 109) {
                QQMPageData qQMPageData3 = this.f54120a;
                if (qQMPageData3 != null && qQMPageData3.f53830a.f53827c != 109 && this.f54120a.f53830a.f53827c != 104) {
                    int i2 = this.f54120a.f53830a.f53827c;
                }
                QQMPageData qQMPageData4 = this.f54120a;
                boolean z = ((qQMPageData4 == null || qQMPageData4.f53830a.f53827c == 108) && (a2 = QQMarketUrlUtil.a("showtitlebar", str)) != null && a2.equals("0")) ? false : true;
                boolean z2 = !this.f54122c.c();
                if (z) {
                    qBFrameLayout = QQMarketTitleBarAreaBuilder.a(getContext(), z2);
                }
            } else {
                qBFrameLayout = QQMarketTitleBarAreaBuilder.a(context);
                setUpdateTitleWidget(qBFrameLayout);
            }
        }
        a(i, qBFrameLayout);
        this.f.setOrientation(1);
        this.f.setBackgroundNormalIds(QBViewResourceManager.D, R.color.qqmarket_default_bkg);
    }

    private void a(int i, ViewGroup viewGroup) {
        if (viewGroup != null) {
            this.i = (QBTextView) viewGroup.findViewById(2);
            this.j = (QBImageTextView) viewGroup.findViewById(1);
            this.k = (QBImageView) viewGroup.findViewById(3);
            QBImageTextView qBImageTextView = this.j;
            if (qBImageTextView != null) {
                qBImageTextView.setOnClickListener(this);
            }
            QBImageView qBImageView = this.k;
            if (qBImageView != null) {
                qBImageView.setOnClickListener(this);
            }
            this.f.addView(viewGroup, new FrameLayout.LayoutParams(-1, i));
        }
    }

    private boolean b() {
        if (!this.f54122c.c()) {
            if (TextUtils.isEmpty(this.g)) {
                this.g = QQMarketUrlUtil.f54180a;
                return true;
            }
            if (!this.g.startsWith("qb://market/") && !this.g.startsWith("qb://search")) {
                return true;
            }
        }
        return false;
    }

    private void c() {
        this.f54123d = QQMarketFrameFactory.a(this.f54120a, this.f54122c, getContext());
        IQQMarketFrame iQQMarketFrame = this.f54123d;
        if (iQQMarketFrame != null) {
            iQQMarketFrame.setBusinessPage(this);
            this.f.addView(this.f54123d.getView(), new LinearLayout.LayoutParams(-1, -1));
            if (this.f54122c.d()) {
                return;
            }
            this.f54123d.e();
        }
    }

    private void setNormalEntryWidget(ViewGroup viewGroup) {
        this.j = (QBImageTextView) viewGroup.findViewById(1);
        QBImageTextView qBImageTextView = this.j;
        if (qBImageTextView != null) {
            qBImageTextView.mQBTextView.setText(MttResources.l(R.string.b22));
            this.j.mQBTextView.setTextSize(MttResources.h(f.da));
            this.j.setId(5);
            this.j.setOnClickListener(this);
        }
        this.i = (QBTextView) viewGroup.findViewById(2);
        QBTextView qBTextView = this.i;
        if (qBTextView != null) {
            qBTextView.setVisibility(4);
        }
    }

    private void setUpdateTitleWidget(ViewGroup viewGroup) {
        this.l = viewGroup.findViewById(7);
        View view = this.l;
        if (view != null) {
            view.setOnClickListener(this);
        }
        this.m = viewGroup.findViewById(8);
        View view2 = this.m;
        if (view2 != null) {
            view2.setOnClickListener(this);
        }
    }

    public void a() {
        IQQMarketFrame iQQMarketFrame;
        if (!this.f54122c.c() || (iQQMarketFrame = this.f54123d) == null) {
            return;
        }
        iQQMarketFrame.e();
    }

    public void a(String str, boolean z) {
        QQMPageData qQMPageData = this.f54120a;
        if (qQMPageData != null && qQMPageData.f53830a.f53827c == 108 && !this.h) {
            this.h = true;
            ((IHistory) SDKContext.getInstance().getService(IHistory.class)).addHistory(str, getUrl());
        }
        this.f54121b = str;
        QBTextView qBTextView = this.i;
        if (qBTextView != null) {
            qBTextView.setText(this.f54121b);
            this.i.setContentDescription(this.f54121b);
        }
        if (this.h || !z || this.f54120a == null) {
            return;
        }
        this.h = true;
        ((IHistory) SDKContext.getInstance().getService(IHistory.class)).addHistory(this.f54120a.f53830a.f53826b, getUrl());
    }

    @Override
    public void active() {
        super.active();
        if (!this.n) {
            this.n = true;
            c();
        }
        IQQMarketFrame iQQMarketFrame = this.f54123d;
        if (iQQMarketFrame != null) {
            iQQMarketFrame.g();
        }
        QQMPageData qQMPageData = this.f54120a;
        if (qQMPageData == null || qQMPageData.f53830a == null || this.f54120a.f53830a.f53827c != 110) {
            return;
        }
        CMC.a("cmc://statistics/m?cmd=onStatEntryType&action=912", null);
    }

    @Override
    public boolean can(int i) {
        QQMPageData qQMPageData;
        if (i == 9 && (qQMPageData = this.f54120a) != null && qQMPageData.f53830a != null && this.f54120a.f53830a.f53827c == 108) {
            return true;
        }
        return super.can(i);
    }

    @Override
    public boolean coverToolbar() {
        return this.f54122c.e != null;
    }

    @Override
    public void deactive() {
        super.deactive();
        IQQMarketFrame iQQMarketFrame = this.f54123d;
        if (iQQMarketFrame != null) {
            iQQMarketFrame.h();
        }
    }

    @Override
    public void destroy() {
        super.destroy();
        IQQMarketFrame iQQMarketFrame = this.f54123d;
        if (iQQMarketFrame != null) {
            iQQMarketFrame.l();
        }
    }

    @Override
    public String getPageTitle() {
        return this.f54121b;
    }

    @Override
    public QBWebView getQBWebView() {
        return null;
    }

    @Override
    public String getRestoreUrl() {
        return this.e;
    }

    @Override
    public PageInfo getShareBundle() {
        QQMPageData qQMPageData = this.f54120a;
        if (qQMPageData == null || qQMPageData.f53830a == null || this.f54120a.f53830a.f53827c != 108) {
            return null;
        }
        String a2 = QQMarketUrlUtil.a("url", getUrl());
        PageInfo pageInfo = new PageInfo(0);
        pageInfo.a(this.f54121b);
        pageInfo.d(String.format(MttResources.l(R.string.b1b), this.f54121b));
        pageInfo.b(a2);
        return pageInfo;
    }

    @Override
    public String getUrl() {
        return UrlUtils.removeArg(this.e, "ref");
    }

    @Override
    public void loadUrl(String str) {
        super.loadUrl(str);
        loadUrlExt(str, new HashMap());
    }

    @Override
    public void loadUrlExt(String str, Map<String, Object> map) {
        QQMPageData qQMPageData;
        super.loadUrlExt(str, map);
        int intValue = ((Integer) QQMarketCommonUtils.a(map, "categoryid", -1)).intValue();
        if (intValue >= 0 && (qQMPageData = this.f54120a) != null && qQMPageData.f53830a.f53825a < 0) {
            this.f54120a.f53830a.f53825a = intValue;
        }
        this.e = str;
        QQMPageData qQMPageData2 = this.f54120a;
        a(qQMPageData2 != null ? qQMPageData2.f53830a.f53826b : "", false);
    }

    @Override
    public void onClick(View view) {
        QBAppReportUserAction qBAppReportUserAction;
        String str;
        String str2;
        EventCollector.getInstance().onViewClickedBefore(view);
        if (view != null) {
            int id = view.getId();
            if (id == 1) {
                QQMarketContainer qQMarketContainer = this.f54122c;
                if (qQMarketContainer.f53837d != 1) {
                    qQMarketContainer.a(this.g);
                } else {
                    qQMarketContainer.e();
                }
            } else if (id != 3) {
                if (id != 5) {
                    if (id == 7) {
                        Bundle bundle = new Bundle();
                        bundle.putInt("ViewID", 44);
                        ((IFrameworkDelegate) QBContext.getInstance().getService(IFrameworkDelegate.class)).doLoad(new UrlParams(IFunctionWndFactory.WND_SETTING).d(2).a(bundle).d(true));
                        StatManager.b().b("ARNR61", StatManager.SamplingRate.PERCENT_20);
                        qBAppReportUserAction = this.f54120a.e;
                        str = "Update_Download_Setting";
                        str2 = "title_setting";
                    } else if (id == 8) {
                        QQMarketContainer qQMarketContainer2 = this.f54122c;
                        qQMarketContainer2.b(QQMarketUrlUtil.a(QQMarketUrlUtil.c("https://ag.qq.com/usercenter", MttResources.l(h.aB)), getUrl(), getPageTitle(), qQMarketContainer2.f53834a, this.f54120a.e) + "&pageType=1", null);
                        qBAppReportUserAction = this.f54120a.e;
                        str = "Home_Account";
                        str2 = "3";
                    }
                    QQMarketSoftItemData.a(qBAppReportUserAction, str, str2);
                } else {
                    QQMarketContainer qQMarketContainer3 = this.f54122c;
                    if (qQMarketContainer3 != null) {
                        QQMPageData qQMPageData = this.f54120a;
                        String a2 = QQMarketUrlUtil.a("qb://market/", qQMarketContainer3, qQMPageData != null ? qQMPageData.f : null);
                        HashMap hashMap = new HashMap();
                        hashMap.put("softentry", true);
                        qQMarketContainer3.b(a2, hashMap);
                        qBAppReportUserAction = this.f54120a.e;
                        str = "Businesspage_Home";
                        str2 = "title_home";
                        QQMarketSoftItemData.a(qBAppReportUserAction, str, str2);
                    }
                }
            } else {
                QQMarketContainer qQMarketContainer4 = this.f54122c;
                if (qQMarketContainer4 != null) {
                    ((IFrameworkDelegate) QBContext.getInstance().getService(IFrameworkDelegate.class)).doLoad(new UrlParams(QQMarketUrlUtil.b("qb://search?vertical=3&searchFrom=10", "qb://search?vertical=3&searchFrom=10", getPageTitle(), qQMarketContainer4.f53834a)).c(0).b(1));
                    StatManager.b().c("ARNR5");
                    qBAppReportUserAction = this.f54120a.e;
                    str = "Businesspage_Search";
                    str2 = "title_search";
                    QQMarketSoftItemData.a(qBAppReportUserAction, str, str2);
                }
            }
        }
        EventCollector.getInstance().onViewClicked(view);
    }

    @Override
    public void onImageLoadConfigChanged() {
        IQQMarketFrame iQQMarketFrame = this.f54123d;
        if (iQQMarketFrame != null) {
            iQQMarketFrame.c(ImageLoadManager.getInstance().getIsEnableLoadImage());
        }
    }

    @Override
    public void onSkinChanged() {
        super.onSkinChanged();
        IQQMarketFrame iQQMarketFrame = this.f54123d;
        if (iQQMarketFrame != null) {
            iQQMarketFrame.d();
        }
    }

    @Override
    public boolean pageDown(boolean z) {
        IQQMarketFrame iQQMarketFrame = this.f54123d;
        if (iQQMarketFrame != null) {
            return iQQMarketFrame.a(z);
        }
        return false;
    }

    @Override
    public boolean pageUp(boolean z) {
        IQQMarketFrame iQQMarketFrame = this.f54123d;
        if (iQQMarketFrame != null) {
            return iQQMarketFrame.b(z);
        }
        return false;
    }

    @Override
    public void reload() {
        IQQMarketFrame iQQMarketFrame = this.f54123d;
        if (iQQMarketFrame instanceof QQMarketWebViewFrame) {
            ((QQMarketWebViewFrame) iQQMarketFrame).k();
            return;
        }
        deactive();
        destroy();
        IQQMarketFrame iQQMarketFrame2 = this.f54123d;
        if (iQQMarketFrame2 != null) {
            removeView(iQQMarketFrame2.getView());
        }
        c();
        IQQMarketFrame iQQMarketFrame3 = this.f54123d;
        if (iQQMarketFrame3 != null) {
            iQQMarketFrame3.e();
        }
        active();
    }
}