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

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


package com.tencent.mtt.fileclean.page.view;

import MTT.WelfareDetail;
import MTT.WelfareTaskInfo;
import android.R;
import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.view.Window;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.tencent.beacon.event.open.EventResult;
import com.tencent.mtt.account.base.IAccount;
import com.tencent.mtt.account.base.UserLoginListener;
import com.tencent.mtt.base.functionwindow.ActivityHandler;
import com.tencent.mtt.base.skin.MttResources;
import com.tencent.mtt.base.ui.widget.QBWebImageView;
import com.tencent.mtt.base.wup.PreferenceData;
import com.tencent.mtt.browser.setting.manager.SkinManager;
import com.tencent.mtt.browser.share.export.socialshare.qqshare.QQShareActivity;
import com.tencent.mtt.file.page.statistics.FileKeyEvent;
import com.tencent.mtt.fileclean.stat.JunkEventHelper;
import com.tencent.mtt.newskin.SimpleSkinBuilder;
import com.tencent.mtt.nxeasy.page.EasyPageContext;
import com.tencent.mtt.sdkcontext.SDKContext;
import com.tencent.qqlive.module.videoreport.collect.EventCollector;
import com.tencent.qqlive.module.videoreport.inject.dialog.ReportDialog;
import qb.a.g;

public class ObtainJunkGoldDialog extends ReportDialog implements View.OnClickListener, UserLoginListener {

    Context f66124a;

    EasyPageContext f66125b;

    TextView f66126c;

    LinearLayout f66127d;
    ObtainListener e;
    boolean f;

    public interface ObtainListener {
        void a();
    }

    public ObtainJunkGoldDialog(EasyPageContext easyPageContext, WelfareTaskInfo welfareTaskInfo, ObtainListener obtainListener) {
        super(easyPageContext.f68800c);
        this.f66125b = easyPageContext;
        this.f66124a = easyPageContext.f68800c;
        this.e = obtainListener;
        this.f = TextUtils.equals(PreferenceData.a("JUNK_SHOW_WELFARE_BUBBLE"), "1");
        b();
        a(welfareTaskInfo);
    }

    private void a(WelfareTaskInfo welfareTaskInfo) {
        TextView textView;
        String str;
        int i = (welfareTaskInfo.isContinueTask ? welfareTaskInfo.continueTaskDays : welfareTaskInfo.completed) + 1;
        WelfareDetail welfareDetail = welfareTaskInfo.welfares.get(Integer.valueOf(i));
        if (welfareDetail != null) {
            if (welfareDetail.welfareInfo.value != 0) {
                textView = this.f66126c;
                str = "恭喜获得" + welfareDetail.welfareInfo.value + "金币";
            } else {
                textView = this.f66126c;
                str = "恭喜获得金币大礼包";
            }
            textView.setText(str);
        }
        WelfareDetail welfareDetail2 = welfareTaskInfo.welfares.get(Integer.valueOf(i + 1));
        if (this.f && welfareDetail2 != null && welfareDetail != null && (welfareDetail2.welfareInfo.value * 100) / welfareDetail.welfareInfo.value == 200 && this.f) {
            this.f66127d.setVisibility(0);
        } else {
            this.f66127d.setVisibility(8);
        }
    }

    private void b() {
        Window window = getWindow();
        window.setBackgroundDrawableResource(R.color.transparent);
        window.setWindowAnimations(com.tencent.mtt.R.style.sw);
        LinearLayout linearLayout = new LinearLayout(this.f66124a);
        linearLayout.setGravity(17);
        linearLayout.setOrientation(1);
        setFeatureDrawableAlpha(0, 0);
        linearLayout.setBackgroundColor(MttResources.c(com.tencent.mtt.R.color.transparent));
        setContentView(linearLayout);
        QBWebImageView qBWebImageView = new QBWebImageView(getContext());
        qBWebImageView.setEnableNoPicMode(false);
        qBWebImageView.setPlaceHolderDrawableId(g.f85882a);
        qBWebImageView.setUseMaskForNightMode(true);
        qBWebImageView.setUrl("https://m4.publicimg.browser.qq.com/publicimg/nav/file/icon_junkgold_dialog_header.png");
        linearLayout.addView(qBWebImageView, new LinearLayout.LayoutParams(MttResources.s(256), MttResources.s(98)));
        SimpleSkinBuilder.a((ImageView) qBWebImageView).f();
        LinearLayout linearLayout2 = new LinearLayout(this.f66124a);
        linearLayout2.setOrientation(1);
        linearLayout2.setGravity(1);
        linearLayout.addView(linearLayout2, new LinearLayout.LayoutParams(MttResources.s(256), MttResources.s(270)));
        linearLayout2.setBackground(MttResources.i((SkinManager.s().l() || SkinManager.s().g()) ? com.tencent.mtt.R.drawable.eh : com.tencent.mtt.R.drawable.eg));
        LinearLayout linearLayout3 = new LinearLayout(this.f66124a);
        linearLayout3.setOrientation(1);
        linearLayout3.setGravity(16);
        linearLayout2.addView(linearLayout3, new LinearLayout.LayoutParams(-1, MttResources.s(EventResult.ERROR_CODE_OTHER)));
        this.f66126c = new TextView(this.f66124a);
        this.f66126c.setTextSize(0, MttResources.s(16));
        this.f66126c.setGravity(17);
        SimpleSkinBuilder.a(this.f66126c).g(com.tencent.mtt.R.color.theme_common_color_b2).f();
        linearLayout3.addView(this.f66126c, new LinearLayout.LayoutParams(-1, -2));
        LinearLayout linearLayout4 = new LinearLayout(this.f66124a);
        linearLayout4.setOrientation(0);
        linearLayout4.setGravity(16);
        ImageView imageView = new ImageView(this.f66124a);
        imageView.setImageDrawable(MttResources.i(com.tencent.mtt.R.drawable.aor));
        SimpleSkinBuilder.a(imageView).f();
        imageView.setScaleType(ImageView.ScaleType.CENTER);
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(MttResources.s(24), MttResources.s(24));
        layoutParams.leftMargin = MttResources.s(45);
        linearLayout4.addView(imageView, layoutParams);
        TextView textView = new TextView(this.f66124a);
        textView.setTextSize(0, MttResources.s(14));
        SimpleSkinBuilder.a(textView).g(com.tencent.mtt.R.color.theme_common_color_a3).f();
        textView.setText("连续清理得现金奖励");
        LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(-2, -2);
        layoutParams2.leftMargin = MttResources.s(6);
        linearLayout4.addView(textView, layoutParams2);
        LinearLayout.LayoutParams layoutParams3 = new LinearLayout.LayoutParams(-2, MttResources.s(24));
        layoutParams3.topMargin = MttResources.s(26);
        linearLayout3.addView(linearLayout4, layoutParams3);
        this.f66127d = new LinearLayout(this.f66124a);
        this.f66127d.setOrientation(0);
        this.f66127d.setGravity(16);
        ImageView imageView2 = new ImageView(this.f66124a);
        imageView2.setImageDrawable(MttResources.i(com.tencent.mtt.R.drawable.anq));
        SimpleSkinBuilder.a(imageView2).f();
        imageView2.setScaleType(ImageView.ScaleType.CENTER);
        this.f66127d.addView(imageView2, layoutParams);
        TextView textView2 = new TextView(this.f66124a);
        textView2.setTextSize(0, MttResources.s(14));
        SimpleSkinBuilder.a(textView2).g(com.tencent.mtt.R.color.theme_common_color_a3).f();
        textView2.setText("明天清理可得双倍奖励");
        LinearLayout.LayoutParams layoutParams4 = new LinearLayout.LayoutParams(-2, -2);
        layoutParams4.leftMargin = MttResources.s(6);
        this.f66127d.addView(textView2, layoutParams4);
        LinearLayout.LayoutParams layoutParams5 = new LinearLayout.LayoutParams(-2, MttResources.s(24));
        layoutParams5.topMargin = MttResources.s(9);
        linearLayout3.addView(this.f66127d, layoutParams5);
        LinearLayout linearLayout5 = new LinearLayout(this.f66124a);
        linearLayout5.setOrientation(0);
        linearLayout5.setGravity(16);
        ImageView imageView3 = new ImageView(this.f66124a);
        imageView3.setImageDrawable(MttResources.i(com.tencent.mtt.R.drawable.aoq));
        imageView3.setScaleType(ImageView.ScaleType.CENTER);
        SimpleSkinBuilder.a(imageView3).f();
        linearLayout5.addView(imageView3, layoutParams);
        TextView textView3 = new TextView(this.f66124a);
        textView3.setTextSize(0, MttResources.s(14));
        SimpleSkinBuilder.a(textView3).g(com.tencent.mtt.R.color.theme_common_color_a3).f();
        textView3.setText("清理7天可得金币大礼包");
        LinearLayout.LayoutParams layoutParams6 = new LinearLayout.LayoutParams(-2, -2);
        layoutParams6.leftMargin = MttResources.s(6);
        linearLayout5.addView(textView3, layoutParams6);
        LinearLayout.LayoutParams layoutParams7 = new LinearLayout.LayoutParams(-2, MttResources.s(24));
        layoutParams7.topMargin = MttResources.s(9);
        linearLayout3.addView(linearLayout5, layoutParams7);
        TextView textView4 = new TextView(this.f66124a);
        textView4.setId(1001);
        textView4.setText("立即领取");
        SimpleSkinBuilder.a(textView4).g(com.tencent.mtt.R.color.theme_common_color_a5).f();
        textView4.setGravity(17);
        textView4.setBackground(MttResources.i(SkinManager.s().l() ? com.tencent.mtt.R.drawable.eb : com.tencent.mtt.R.drawable.ea));
        linearLayout2.addView(textView4, new LinearLayout.LayoutParams(MttResources.s(192), MttResources.s(42)));
        textView4.setOnClickListener(this);
        ImageView imageView4 = new ImageView(this.f66124a);
        imageView4.setId(1002);
        imageView4.setImageDrawable(MttResources.i(com.tencent.mtt.R.drawable.ane));
        LinearLayout.LayoutParams layoutParams8 = new LinearLayout.LayoutParams(MttResources.s(40), MttResources.s(40));
        imageView4.setScaleType(ImageView.ScaleType.CENTER);
        SimpleSkinBuilder.a(imageView4).f();
        layoutParams8.topMargin = MttResources.s(22);
        linearLayout.addView(imageView4, layoutParams8);
        imageView4.setOnClickListener(this);
    }

    private void c() {
        ObtainListener obtainListener = this.e;
        if (obtainListener != null) {
            obtainListener.a();
        }
        dismiss();
    }

    protected void a() {
        new FileKeyEvent("JUNK_0253", this.f66125b.g, this.f66125b.h, "JUNK_FINISH", "JK", "", JunkEventHelper.b()).b();
        IAccount iAccount = (IAccount) SDKContext.getInstance().getService(IAccount.class);
        if (iAccount.getCurrentUserInfo().isLogined()) {
            c();
            return;
        }
        Bundle bundle = new Bundle();
        bundle.putInt(QQShareActivity.KEY_FROM_WHERE, 8);
        bundle.putBoolean(MttResources.l(com.tencent.mtt.R.string.f30776c), false);
        bundle.putInt("LOGIN_CUSTOM_TYPE", 3);
        iAccount.callUserLogin(ActivityHandler.b().a(), bundle);
        iAccount.addUIListener(this);
    }

    @Override
    public void onClick(View view) {
        EventCollector.getInstance().onViewClickedBefore(view);
        int id = view.getId();
        if (id == 1001) {
            a();
        } else if (id == 1002) {
            dismiss();
        }
        EventCollector.getInstance().onViewClicked(view);
    }

    @Override
    public void onLoginFailed(int i, String str) {
        dismiss();
    }

    @Override
    public void onLoginSuccess() {
        c();
    }
}