package com.ss.android.ugc.aweme.feed.adapter;

import X.0CM;
import X.2GO;
import X.33g;
import X.4RT;
import X.4aP;
import X.4dX;
import X.7RF;
import X.7TE;
import X.7dl;
import X.C0017Cgr;
import X.C0065Cin;
import X.LGp;
import X.M12;
import X.SsI;
import android.widget.FrameLayout;
import com.bytedance.covode.number.Covode;
import com.bytedance.lighten.loader.SmartImageView;
import com.ss.android.ugc.aweme.ad.FeedAdServiceImpl;
import com.ss.android.ugc.aweme.ad.feed.IFeedAdService;
import com.ss.android.ugc.aweme.feed.model.Aweme;
import com.ss.android.ugc.aweme.feed.model.Video;
import java.lang.ref.WeakReference;
import kotlin.h.b.n;

public final class DynamicAdViewHolder extends VideoViewCell implements 7RF, 2GO {
    public final C0065Cin LIZLLL;

    static {
        Covode.recordClassIndex(76431);
    }

    public final void LJJIJIIJI() {
        this.LIZLLL.LIZJ();
        7dl.LIZIZ.LIZIZ();
    }

    public final boolean LJJIIZI() {
        if (this.LIZLLL.LJ()) {
            LJJIJIIJI();
            return false;
        }
        LJJIJ();
        return true;
    }

    public final void LJJIJ() {
        this.LIZLLL.LIZIZ();
        4RT r0 = this.LJJLIL;
        if (r0 != null) {
            r0.LJJIJIL();
        }
        7dl.LIZIZ.LIZ();
    }

    public final void LJIILL() {
        super.LJIILL();
        this.LJL.LIZ("ad_on_holder_resume", (0CM<33g>) this);
        this.LJL.LIZ("ad_on_fragment_pager_resume", (0CM<33g>) this);
        this.LJL.LIZ("ad_on_holder_pause", (0CM<33g>) this);
        this.LJL.LIZ("ad_on_fragment_pager_pause", (0CM<33g>) this);
    }

    public final /* synthetic */ void onChanged(Object obj) {
        onChanged((33g) obj);
    }

    public final void LIZ(Video video) {
        SmartImageView smartImageView = this.LJIJI;
        n.LIZIZ(smartImageView, "");
        smartImageView.setVisibility(8);
        this.LJJZ = false;
    }

    public final void LJ(Aweme aweme) {
        M12.LIZ(aweme);
        super.LJ(aweme);
        this.LIZLLL.LIZ(this.LJIIL);
    }

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public DynamicAdViewHolder(4aP r4) {
        super(r4);
        M12.LIZ(r4);
        IFeedAdService LJFF = FeedAdServiceImpl.LJFF();
        FrameLayout frameLayout = this.LJJJJ;
        n.LIZIZ(frameLayout, "");
        this.LIZLLL = LJFF.LIZ(frameLayout);
    }

    public final void LIZLLL(boolean z) {
        7TE LJZI;
        super.LIZLLL(z);
        4dX.LIZ = null;
        SsI.LIZIZ(this.LIZLLL);
        C0017Cgr cgr = this.LJLJJI;
        if (!(cgr == null || (LJZI = cgr.LJZI()) == null)) {
            this.LIZLLL.LIZIZ(LJZI);
        }
        this.LIZLLL.LIZLLL();
    }

    public final void LIZ(int i) {
        7TE LJZI;
        super.LIZ(i);
        C0065Cin cin = this.LIZLLL;
        M12.LIZ(cin);
        4dX.LIZ = new WeakReference(cin);
        SsI.LIZ(this.LIZLLL);
        C0017Cgr cgr = this.LJLJJI;
        if (!(cgr == null || (LJZI = cgr.LJZI()) == null)) {
            this.LIZLLL.LIZ((LGp) LJZI);
        }
        this.LIZLLL.LIZIZ();
    }

    /* JADX WARNING: Code restructure failed: missing block: B:14:0x0036, code lost:
        LJJIJ();
     */
    /* JADX WARNING: Code restructure failed: missing block: B:18:?, code lost:
        return;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:21:?, code lost:
        return;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:9:0x0021, code lost:
        LJJIJIIJI();
     */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void LIZ(X.33g r3) {
        /*
            r2 = this;
            super.onChanged((X.33g) r3)
            if (r3 != 0) goto L_0x0006
            return
        L_0x0006:
            java.lang.String r1 = r3.LIZ
            int r0 = r1.hashCode()
            switch(r0) {
                case -2066092964: goto L_0x002e;
                case -895459340: goto L_0x0025;
                case 347029479: goto L_0x0019;
                case 1493170511: goto L_0x0010;
                default: goto L_0x000f;
            }
        L_0x000f:
            return
        L_0x0010:
            java.lang.String r0 = "ad_on_fragment_pager_pause"
            boolean r0 = r1.equals(r0)
            if (r0 == 0) goto L_0x000f
            goto L_0x0021
        L_0x0019:
            java.lang.String r0 = "ad_on_holder_pause"
            boolean r0 = r1.equals(r0)
            if (r0 == 0) goto L_0x000f
        L_0x0021:
            r2.LJJIJIIJI()
            goto L_0x000f
        L_0x0025:
            java.lang.String r0 = "ad_on_fragment_pager_resume"
            boolean r0 = r1.equals(r0)
            if (r0 == 0) goto L_0x000f
            goto L_0x0036
        L_0x002e:
            java.lang.String r0 = "ad_on_holder_resume"
            boolean r0 = r1.equals(r0)
            if (r0 == 0) goto L_0x000f
        L_0x0036:
            r2.LJJIJ()
            goto L_0x000f
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.feed.adapter.DynamicAdViewHolder.LIZ(X.33g):void");
    }
}
