package com.ss.android.ugc.aweme.crossplatform.activity;

import X.3bC;
import X.3bg;
import X.4UX;
import X.Cbz;
import X.JX3;
import X.JX4;
import X.Kqz;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.webkit.WebView;
import android.widget.PopupWindow;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.crossplatform.business.proxy.ReportBusinessProxy;

public class MixActivityContainer$3 implements Kqz {
    public final /* synthetic */ MixActivityContainer LIZ;

    static {
        Covode.recordClassIndex(62889);
    }

    public final void LIZLLL() {
        this.LIZ.LJIILIIL();
    }

    public final void LJ() {
        if (this.LIZ.LJ != null) {
            this.LIZ.LJ.run();
        }
    }

    public final void LIZ() {
        if (!this.LIZ.LIZIZ((Runnable) null)) {
            this.LIZ.LJIIJ = "click_button";
            this.LIZ.LJJI();
        }
    }

    public final void LIZIZ() {
        this.LIZ.LIZLLL.LIZ(ReportBusinessProxy.class).LIZ(this.LIZ.LIZ);
    }

    public final void LIZJ() {
        WebView LJIL = this.LIZ.LJIL();
        if (LJIL != null) {
            this.LIZ.LIZLLL.LIZ(ReportBusinessProxy.class).LIZ(this.LIZ.LIZ, LJIL.getUrl(), this.LIZ.LJIIZILJ());
        }
    }

    public MixActivityContainer$3(MixActivityContainer mixActivityContainer) {
        this.LIZ = mixActivityContainer;
    }

    public final void LIZ(View view) {
        boolean z;
        JX3 jx3 = this.LIZ.LJIIJJI;
        if (jx3.LIZLLL == null || jx3.LIZLLL.isEmpty()) {
            jx3.LIZ.setVisibility(0);
            jx3.LIZIZ.setVisibility(0);
            jx3.LIZJ.setVisibility(0);
        } else {
            if (jx3.LIZLLL.contains(Integer.valueOf(JX4.refresh.id))) {
                Cbz.LIZ(jx3.LIZ, 8);
                z = false;
            } else {
                Cbz.LIZ(jx3.LIZ, 0);
                z = true;
            }
            if (jx3.LIZLLL.contains(Integer.valueOf(JX4.copylink.id))) {
                jx3.LIZIZ.setVisibility(8);
            } else {
                jx3.LIZIZ.setVisibility(0);
                z = true;
            }
            if (jx3.LIZLLL.contains(Integer.valueOf(JX4.openwithbrowser.id))) {
                jx3.LIZJ.setVisibility(8);
                if (!z) {
                    return;
                }
            } else {
                jx3.LIZJ.setVisibility(0);
            }
        }
        PopupWindow LIZ2 = this.LIZ.LJIIJJI.LIZ();
        if (3bC.LIZ()) {
            3bg.LIZ();
        }
        if (4UX.LIZ.LIZ()) {
            try {
                3bg.LIZIZ();
                Window window = (Window) 3bg.LIZIZ.get((WindowManager) 3bg.LIZ.get(LIZ2));
                WindowManager.LayoutParams attributes = window.getAttributes();
                int i = attributes.flags;
                boolean booleanValue = ((Boolean) 3bg.LIZJ.get(window)).booleanValue();
                3bg.LIZJ.set(window, false);
                attributes.flags &= -16777217;
                LIZ2.showAsDropDown(view, 0, -12);
                3bg.LIZJ.set(window, Boolean.valueOf(booleanValue));
                attributes.flags = i;
            } catch (Throwable unused) {
                LIZ2.showAsDropDown(view, 0, -12);
            }
        } else {
            LIZ2.showAsDropDown(view, 0, -12);
        }
    }
}
