package com.ss.android.ugc.aweme.sticker.panel.guide;

import X.0CB;
import X.0CH;
import X.0CN;
import X.C3811Nmw;
import X.C3813Nmy;
import X.C3817Nn2;
import X.NFC;
import X.NFG;
import android.widget.FrameLayout;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.effectmanager.effect.model.Effect;

public class DefaultStickerGuidePresenter implements NFC {
    public FrameLayout LIZ;
    public C3813Nmy LIZIZ;
    public C3817Nn2 LIZJ;
    public C3813Nmy LIZLLL;
    public C3817Nn2 LJ;
    public Effect LJFF;

    static {
        Covode.recordClassIndex(116035);
    }

    public final void LIZ() {
        this.LJFF = null;
    }

    @0CN(LIZ = 0CB.ON_DESTROY)
    public void hide() {
        C3813Nmy nmy = this.LIZIZ;
        if (nmy != null) {
            nmy.LIZ();
        }
    }

    @0CN(LIZ = 0CB.ON_DESTROY)
    public void hideNotice() {
        C3813Nmy nmy = this.LIZLLL;
        if (nmy != null) {
            nmy.LIZ();
        }
    }

    public final void LIZ(0CH r2) {
        r2.getLifecycle().LIZ(this);
    }

    public final void LIZIZ(Effect effect) {
        C3813Nmy nmy = this.LIZLLL;
        if (nmy != null) {
            nmy.LIZ();
        }
        if (effect != null) {
            this.LJFF = effect;
            C3813Nmy LIZ2 = this.LJ.LIZ(effect);
            this.LIZLLL = LIZ2;
            LIZ2.LIZ(this.LIZ);
        }
    }

    public final void LIZ(Effect effect) {
        C3813Nmy nmy;
        if (effect == null || !effect.equals(this.LJFF) || (nmy = this.LIZIZ) == null || !nmy.LIZIZ()) {
            C3813Nmy nmy2 = this.LIZIZ;
            if (nmy2 != null) {
                nmy2.LIZ();
            }
            if (effect == null || (!NFG.LJJIIZI(effect) && effect.equals(this.LJFF))) {
                this.LJFF = effect;
                return;
            }
            this.LJFF = effect;
            C3813Nmy LIZ2 = this.LIZJ.LIZ(effect);
            this.LIZIZ = LIZ2;
            LIZ2.LIZ(this.LIZ);
        }
    }

    public DefaultStickerGuidePresenter(C3817Nn2 nn2, FrameLayout frameLayout) {
        this(nn2, new C3811Nmw(), frameLayout);
    }

    public DefaultStickerGuidePresenter(C3817Nn2 nn2, C3817Nn2 nn22, FrameLayout frameLayout) {
        this.LIZ = frameLayout;
        this.LIZJ = nn2;
        this.LJ = nn22;
    }
}
