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

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


package com.tencent.mtt.fileclean.deletefeedback;

import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Handler;
import android.os.Looper;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.text.style.ForegroundColorSpan;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.LinearInterpolator;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import com.tencent.luggage.wxa.gq.a;
import com.tencent.mtt.R;
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.browser.window.UrlParams;
import com.tencent.mtt.businesscenter.facade.IFrameworkDelegate;
import com.tencent.mtt.file.page.statistics.FileKeyEvent;
import com.tencent.mtt.fileclean.stat.JunkEventHelper;
import com.tencent.mtt.fileclean.utils.JunkFileUtils;
import com.tencent.mtt.fileclean.utils.LottieAnimHelper;
import com.tencent.mtt.lottie.LottieAnimationView;
import com.tencent.mtt.newskin.SimpleSkinBuilder;
import com.tencent.mtt.qbcontext.core.QBContext;
import com.tencent.mtt.resource.UIResourceDimen;
import com.tencent.mtt.setting.PublicSettingManager;
import com.tencent.mtt.view.common.QBImageView;
import com.tencent.mtt.view.common.QBTextView;
import com.tencent.mtt.view.dialog.QBDialogBase;
import com.tencent.mtt.view.layout.QBLinearLayout;
import com.tencent.mtt.view.layout.QBRelativeLayout;
import com.tencent.qqlive.module.videoreport.collect.EventCollector;
import java.io.File;
import qb.a.e;
import qb.a.g;

public class DeleteFeedbackDialog extends QBDialogBase {

    public static final int f65692a = UIResourceDimen.a(10.0f);

    public static final int f65693b = UIResourceDimen.a(50.0f);
    private static final int h = MttResources.s(108);
    private static int i = 5000;

    FeedBackContentView f65694c;

    String f65695d;
    int e;
    String f;
    int g;

    public class FeedBackContentView extends QBRelativeLayout implements View.OnClickListener {

        LottieAnimationView f65700a;

        boolean f65701b;

        String f65702c;
        private final int e;
        private final int f;
        private final int g;

        public FeedBackContentView(Context context) {
            super(context);
            this.e = 1;
            this.f = 2;
            this.g = 3;
            this.f65701b = false;
            this.f65701b = LottieAnimHelper.a().a("file_delete_feedback_anim");
            a(context);
        }

        private void a(Context context) {
            SpannableStringBuilder spannableStringBuilder;
            String str;
            String str2;
            QBLinearLayout qBLinearLayout = new QBLinearLayout(context);
            qBLinearLayout.setGravity(16);
            qBLinearLayout.setOrientation(0);
            qBLinearLayout.setBackgroundNormalIds(R.drawable.aaz, 0);
            qBLinearLayout.setUseMaskForNightMode(true);
            RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, MttResources.s(64));
            layoutParams.addRule(12);
            layoutParams.bottomMargin = MttResources.s(22);
            int s = MttResources.s(8);
            layoutParams.rightMargin = s;
            layoutParams.leftMargin = s;
            addView(qBLinearLayout, layoutParams);
            QBTextView qBTextView = new QBTextView(context);
            qBTextView.setMaxLines(2);
            qBTextView.setEllipsize(TextUtils.TruncateAt.END);
            qBTextView.setTextSize(MttResources.s(14));
            if (DeleteFeedbackDialog.this.g != 104) {
                long j = PublicSettingManager.a().getLong("key_last_scan_done_size", 0L);
                float f = (float) j;
                if (f > 1.048576E8f) {
                    str = " " + JunkFileUtils.a(j, 1) + " ";
                } else {
                    str = "无用";
                }
                if (DeleteFeedbackDialog.this.e > 0) {
                    str2 = "已删除" + DeleteFeedbackDialog.this.e + "项文件,发现";
                } else {
                    str2 = "删除成功,发现 ";
                }
                String str3 = str2 + str + "垃圾可清理";
                spannableStringBuilder = new SpannableStringBuilder(str3);
                int indexOf = str3.indexOf(str);
                int indexOf2 = str3.indexOf("垃圾可清理");
                int i = e.V;
                if (f > 1.048576E8f) {
                    i = f > 3.22122547E9f ? e.g : f > 1.07374182E9f ? e.l : e.f;
                }
                spannableStringBuilder.setSpan(new ForegroundColorSpan(MttResources.c(e.V)), 0, indexOf, 33);
                spannableStringBuilder.setSpan(new ForegroundColorSpan(MttResources.c(i)), indexOf, indexOf2, 33);
                spannableStringBuilder.setSpan(new ForegroundColorSpan(MttResources.c(e.V)), indexOf2, str3.length(), 33);
            } else {
                spannableStringBuilder = new SpannableStringBuilder("删除成功,发现6项隐私记录可清理");
                spannableStringBuilder.setSpan(new ForegroundColorSpan(MttResources.c(e.V)), 0, 7, 33);
                spannableStringBuilder.setSpan(new ForegroundColorSpan(MttResources.c(e.f)), 7, 9, 33);
                spannableStringBuilder.setSpan(new ForegroundColorSpan(MttResources.c(e.V)), 9, 16, 33);
            }
            qBTextView.setText(spannableStringBuilder);
            LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(-1, -2);
            layoutParams2.weight = 1.0f;
            layoutParams2.leftMargin = MttResources.s(80);
            qBLinearLayout.addView(qBTextView, layoutParams2);
            QBTextView qBTextView2 = new QBTextView(context);
            qBTextView2.setGravity(17);
            qBTextView2.setText("去清理");
            qBTextView2.setTextSize(MttResources.s(14));
            qBTextView2.setTextColorNormalIds(R.color.theme_common_color_c5);
            qBTextView2.setWidth(MttResources.s(56));
            qBTextView2.setHeight(MttResources.s(28));
            qBTextView2.setBackgroundNormalIds(R.drawable.r7, e.f);
            qBTextView2.setId(2);
            qBTextView2.setOnClickListener(this);
            LinearLayout.LayoutParams layoutParams3 = new LinearLayout.LayoutParams(-2, -2);
            layoutParams3.rightMargin = MttResources.s(13);
            qBLinearLayout.addView(qBTextView2, layoutParams3);
            QBImageView qBImageView = new QBImageView(context);
            qBImageView.setImageNormalIds(g.j);
            qBImageView.setUseMaskForNightMode(true);
            qBImageView.setId(3);
            qBImageView.setOnClickListener(this);
            LinearLayout.LayoutParams layoutParams4 = new LinearLayout.LayoutParams(MttResources.s(14), MttResources.s(14));
            layoutParams4.rightMargin = MttResources.s(16);
            qBLinearLayout.addView(qBImageView, layoutParams4);
            RelativeLayout.LayoutParams layoutParams5 = new RelativeLayout.LayoutParams(MttResources.s(82), MttResources.s(96));
            layoutParams5.addRule(12);
            layoutParams5.addRule(9);
            layoutParams5.bottomMargin = MttResources.s(25);
            layoutParams5.leftMargin = MttResources.s(6);
            if (this.f65701b) {
                this.f65702c = LottieAnimHelper.a().b("file_delete_feedback_anim");
                this.f65700a = new LottieAnimationView(DeleteFeedbackDialog.this.mContext);
                addView(this.f65700a, layoutParams5);
                this.f65700a.setId(1);
                return;
            }
            QBWebImageView qBWebImageView = new QBWebImageView(DeleteFeedbackDialog.this.mContext);
            qBWebImageView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
            qBWebImageView.setUseMaskForNightMode(true);
            qBWebImageView.setPlaceHolderDrawableId(g.f85882a);
            qBWebImageView.setUrl("https://res.imtt.qq.com/res_mtt/file/delete_feedback_anim_palceholder.png");
            qBWebImageView.setId(1);
            SimpleSkinBuilder.a((ImageView) qBWebImageView).f();
            addView(qBWebImageView, layoutParams5);
            LottieAnimHelper.a().c();
        }

        public void a() {
            if (!this.f65701b || TextUtils.isEmpty(this.f65702c)) {
                return;
            }
            LottieAnimHelper.a().a(this.f65700a, this.f65702c + File.separator + "brush.json", this.f65702c + File.separator + "images");
        }

        @Override
        public void onClick(View view) {
            FileKeyEvent fileKeyEvent;
            EventCollector.getInstance().onViewClickedBefore(view);
            if (view.getId() == 3) {
                DeleteFeedbackDialog.this.dismiss();
            } else if (view.getId() == 2) {
                StatManager.b().c("BMRB257");
                DeleteFeedbackDialog.this.dismiss();
                if (!TextUtils.isEmpty(DeleteFeedbackDialog.this.f65695d)) {
                    JunkEventHelper.a("del_tips_toast");
                    ((IFrameworkDelegate) QBContext.getInstance().getService(IFrameworkDelegate.class)).doLoad(new UrlParams(DeleteFeedbackDialog.this.f65695d));
                }
                if (DeleteFeedbackDialog.this.g == 101) {
                    fileKeyEvent = new FileKeyEvent("JUNK_0053", DeleteFeedbackDialog.this.f, "", "", "", "");
                } else if (DeleteFeedbackDialog.this.g == 102) {
                    fileKeyEvent = new FileKeyEvent("JUNK_0057", DeleteFeedbackDialog.this.f, "", "", "", "");
                } else if (DeleteFeedbackDialog.this.g == 104) {
                    fileKeyEvent = new FileKeyEvent("JUNK_0061", DeleteFeedbackDialog.this.f, "", "", "", "");
                } else if (DeleteFeedbackDialog.this.g == 103) {
                    fileKeyEvent = new FileKeyEvent("JUNK_0098", DeleteFeedbackDialog.this.f, "", "", "", "");
                }
                fileKeyEvent.a();
            }
            EventCollector.getInstance().onViewClicked(view);
        }

        @Override
        public boolean onTouchEvent(MotionEvent motionEvent) {
            return false;
        }
    }

    public DeleteFeedbackDialog(Context context, int i2, String str, String str2, int i3) {
        super(context, R.style.iq);
        requestWindowFeature(1);
        getWindow().addFlags(40);
        setCanceledOnTouchOutside(false);
        this.f65695d = str;
        this.e = i2;
        this.f = str2;
        this.g = i3;
        this.f65694c = new FeedBackContentView(context);
        setContentView(this.f65694c, new FrameLayout.LayoutParams(-1, h));
        final AnimatorSet animatorSet = new AnimatorSet();
        AnimatorSet animatorSet2 = new AnimatorSet();
        ObjectAnimator duration = ObjectAnimator.ofFloat(this.f65694c, "translationY", f65693b, 0.0f).setDuration(200L);
        duration.setInterpolator(new DecelerateInterpolator(2.5f));
        ObjectAnimator duration2 = ObjectAnimator.ofFloat(this.f65694c, "translationY", 0.0f, f65692a).setDuration(100L);
        duration2.setInterpolator(new LinearInterpolator());
        animatorSet2.playTogether(duration);
        animatorSet.playSequentially(animatorSet2, duration2);
        setOnShowListener(new DialogInterface.OnShowListener() {
            @Override
            public void onShow(DialogInterface dialogInterface) {
                animatorSet.start();
                DeleteFeedbackDialog.this.f65694c.a();
            }
        });
    }

    public void b() {
        super.dismiss();
    }

    protected void a() {
        int ac = DeviceUtils.ac();
        WindowManager.LayoutParams attributes = getWindow().getAttributes();
        attributes.gravity = 51;
        attributes.x = 0;
        attributes.y = ac - MttResources.s(12);
        attributes.width = DeviceUtils.af();
        getWindow().setAttributes(attributes);
    }

    @Override
    public void dismiss() {
        AnimatorSet animatorSet = new AnimatorSet();
        ObjectAnimator duration = ObjectAnimator.ofFloat(this.f65694c, "translationY", f65692a, f65693b).setDuration(200L);
        ObjectAnimator duration2 = ObjectAnimator.ofFloat(this.f65694c, a.ab, 1.0f, 0.0f).setDuration(200L);
        animatorSet.setInterpolator(new AccelerateInterpolator(1.0f));
        animatorSet.playTogether(duration, duration2);
        animatorSet.start();
        animatorSet.addListener(new Animator.AnimatorListener() {
            @Override
            public void onAnimationCancel(Animator animator) {
            }

            @Override
            public void onAnimationEnd(Animator animator) {
                DeleteFeedbackDialog.this.b();
            }

            @Override
            public void onAnimationRepeat(Animator animator) {
            }

            @Override
            public void onAnimationStart(Animator animator) {
            }
        });
    }

    @Override
    public boolean onTouchEvent(MotionEvent motionEvent) {
        return false;
    }

    @Override
    public void show() {
        a();
        super.show();
        new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
            @Override
            public void run() {
                if (DeleteFeedbackDialog.this.isShowing()) {
                    DeleteFeedbackDialog.this.dismiss();
                }
            }
        }, i);
    }
}