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

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


package com.tencent.mtt.file.page.zippage.result;

import android.animation.Animator;
import android.content.Context;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import com.tencent.mtt.base.skin.MttResources;
import com.tencent.mtt.browser.setting.manager.SkinManager;
import com.tencent.mtt.file.pagecommon.views.AdvSyncImageView;
import com.tencent.mtt.file.pagecommon.views.SuccessTipViewHelper;
import com.tencent.mtt.newskin.SimpleSkinBuilder;
import com.tencent.mtt.view.layout.QBFrameLayout;
import qb.a.g;

public class HeaderLayout extends QBFrameLayout {

    private static final int f63726a = MttResources.s(80);

    private AdvSyncImageView f63727b;

    private boolean f63728c;

    private SuccessTipViewHelper f63729d;

    public HeaderLayout(Context context) {
        super(context);
        this.f63729d = new SuccessTipViewHelper(context);
        setMinimumHeight(f63726a);
    }

    private void a(View view) {
        if (view == null) {
            return;
        }
        view.clearAnimation();
    }

    private void b(View view) {
        if (view == null) {
            return;
        }
        view.clearAnimation();
        view.setVisibility(8);
    }

    private void c() {
        View a2 = this.f63729d.a();
        if (a2 == null || a2.getParent() == null) {
            int i = f63726a;
            addView(a2, new FrameLayout.LayoutParams(i, i));
        }
    }

    private void c(View view) {
        if (view == null || view.getVisibility() == 0) {
            return;
        }
        view.clearAnimation();
        view.setAlpha(1.0f);
        view.setScaleX(1.0f);
        view.setScaleY(1.0f);
        view.setVisibility(0);
    }

    private void d() {
        AdvSyncImageView advSyncImageView = this.f63727b;
        if (advSyncImageView == null || advSyncImageView.getParent() == null) {
            if (this.f63727b == null) {
                this.f63727b = new AdvSyncImageView(getContext());
                this.f63727b.setPlaceHolderDrawableId(g.f85882a);
                this.f63727b.setUseMaskForNightMode(true);
                this.f63727b.setUrl("https://static.res.qq.com/qbt/process/icon_error_240.png");
                SimpleSkinBuilder.a((ImageView) this.f63727b).f();
            }
            AdvSyncImageView advSyncImageView2 = this.f63727b;
            int i = f63726a;
            addView(advSyncImageView2, new FrameLayout.LayoutParams(i, i));
        }
    }

    public void a() {
        b(this.f63729d.a());
        d();
        c(this.f63727b);
    }

    public void a(final Runnable runnable) {
        b(this.f63727b);
        if (this.f63728c) {
            return;
        }
        c();
        c(this.f63729d.a());
        if (SkinManager.s().l()) {
            this.f63729d.a().setAlpha(0.4f);
        }
        this.f63729d.a(new SuccessTipViewHelper.AnimationEnd() {
            @Override
            public void a(Animator animator) {
                HeaderLayout.this.f63729d.b(this);
                runnable.run();
            }
        });
        this.f63729d.b();
    }

    public void b() {
        b(this.f63729d.a());
        b(this.f63727b);
    }

    @Override
    protected void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        this.f63728c = true;
        a(this.f63729d.a());
        this.f63729d.c();
    }
}