package com.ss.android.ugc.aweme.notification.service;

import X.C4052Eam;
import X.C5062Er4;
import X.C5066Er8;
import X.Lnj;
import X.M12;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import com.bytedance.ies.uikit.base.AbsFragment;
import com.ss.android.ugc.aweme.homepage.api.interaction.ScrollSwitchStateManager;
import com.ss.android.ugc.aweme.notice.api.services.INoticeCountTabBadgePresentHost;
import com.ss.android.ugc.aweme.notice.api.services.INoticeCountTabBadgePresentService;

public final class NoticeCountTabBadgePresentServiceImpl implements INoticeCountTabBadgePresentService {
    public C5066Er8 LIZ;
    public boolean LIZIZ;

    static {
        Covode.recordClassIndex(95735);
    }

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

    public final void LIZLLL() {
        C5066Er8 er8 = this.LIZ;
        if (er8 != null) {
            er8.LJII();
        }
    }

    public final void LIZIZ() {
        C4052Eam.LIZIZ.LIZLLL();
        C5066Er8 er8 = this.LIZ;
        if (er8 != null) {
            er8.LJ();
        }
    }

    public final boolean LJ() {
        C5066Er8 er8 = this.LIZ;
        if (er8 != null) {
            return er8.LJ;
        }
        return false;
    }

    public final void LJFF() {
        if (this.LIZIZ) {
            this.LIZIZ = false;
            return;
        }
        C5066Er8 er8 = this.LIZ;
        if (er8 != null) {
            er8.LJIIIZ();
        }
    }

    public final void LIZJ() {
        C5066Er8 er8 = this.LIZ;
        if (er8 != null) {
            er8.LJIIIIZZ = false;
            if (er8.LJIIIZ) {
                er8.LJIIIZ = false;
                er8.LJI();
            }
        }
    }

    public static INoticeCountTabBadgePresentService LJI() {
        MethodCollector.i(9772);
        INoticeCountTabBadgePresentService iNoticeCountTabBadgePresentService = (INoticeCountTabBadgePresentService) Lnj.LIZ(INoticeCountTabBadgePresentService.class, false);
        if (iNoticeCountTabBadgePresentService != null) {
            MethodCollector.o(9772);
            return iNoticeCountTabBadgePresentService;
        }
        Object LIZIZ2 = Lnj.LIZIZ(INoticeCountTabBadgePresentService.class, false);
        if (LIZIZ2 != null) {
            INoticeCountTabBadgePresentService iNoticeCountTabBadgePresentService2 = (INoticeCountTabBadgePresentService) LIZIZ2;
            MethodCollector.o(9772);
            return iNoticeCountTabBadgePresentService2;
        }
        if (Lnj.I == null) {
            synchronized (INoticeCountTabBadgePresentService.class) {
                try {
                    if (Lnj.I == null) {
                        Lnj.I = new NoticeCountTabBadgePresentServiceImpl();
                    }
                } catch (Throwable th) {
                    MethodCollector.o(9772);
                    throw th;
                }
            }
        }
        NoticeCountTabBadgePresentServiceImpl noticeCountTabBadgePresentServiceImpl = (NoticeCountTabBadgePresentServiceImpl) Lnj.I;
        MethodCollector.o(9772);
        return noticeCountTabBadgePresentServiceImpl;
    }

    public final void LIZIZ(boolean z) {
        C5066Er8 er8 = this.LIZ;
        if (er8 != null) {
            er8.LJII = z;
        }
    }

    public final void LIZJ(boolean z) {
        C5066Er8 er8 = this.LIZ;
        if (er8 != null) {
            er8.LJIIIIZZ = z;
        }
    }

    public final void LIZ(boolean z) {
        C5066Er8 er8 = this.LIZ;
        if (er8 != null) {
            er8.LJFF = z;
        }
    }

    public final void LIZ(AbsFragment absFragment, ScrollSwitchStateManager scrollSwitchStateManager, INoticeCountTabBadgePresentHost iNoticeCountTabBadgePresentHost) {
        M12.LIZ(absFragment, scrollSwitchStateManager, iNoticeCountTabBadgePresentHost);
        C5062Er4.LIZIZ.LIZ();
        C5066Er8 er8 = this.LIZ;
        if (er8 != null) {
            this.LIZIZ = true;
            er8.LJIIIZ();
        }
        this.LIZ = new C5066Er8(absFragment, scrollSwitchStateManager, iNoticeCountTabBadgePresentHost);
    }
}
