package com.ss.android.ugc.aweme.search.theme.dark;

import X.0CB;
import X.0CM;
import X.0CN;
import X.1hK;
import X.2ce;
import X.2fL;
import X.7he;
import X.C3403SWx;
import X.C3404SWy;
import X.C3430SXy;
import X.Crj;
import X.EvA;
import X.M12;
import X.SXY;
import X.SY9;
import X.SYT;
import android.view.Window;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.setting.services.SettingServiceImpl;

public final class GlobalDarkThemeController implements 2fL {
    public static final Crj LJ = 7he.LIZ(C3404SWy.LIZ);
    public static final C3403SWx LJFF = new C3403SWx((byte) 0);
    public final String LIZ;
    public final String LIZIZ;
    public final 0CM<Integer> LIZJ;
    public final 1hK LIZLLL;
    public final Window LJI;
    public final Crj LJII;
    public final Crj LJIIIIZZ;

    public final 2ce<Integer> LIZ() {
        return (2ce) this.LJIIIIZZ.getValue();
    }

    @0CN(LIZ = 0CB.ON_CREATE)
    public final void onCreate() {
        EvA.onCreate(this);
    }

    @0CN(LIZ = 0CB.ON_PAUSE)
    public final void onPause() {
        EvA.onPause(this);
    }

    @0CN(LIZ = 0CB.ON_RESUME)
    public final void onResume() {
        EvA.onResume(this);
    }

    @0CN(LIZ = 0CB.ON_START)
    public final void onStart() {
        EvA.onStart(this);
    }

    @0CN(LIZ = 0CB.ON_STOP)
    public final void onStop() {
        EvA.onStop(this);
    }

    static {
        Covode.recordClassIndex(104682);
    }

    public final void onDestroy() {
        LIZ().removeObserver(this.LIZJ);
        LJFF.LIZ().remove(this.LIZLLL.hashCode());
    }

    public GlobalDarkThemeController(1hK r3) {
        this.LIZLLL = r3;
        r3.getLifecycle().LIZ(this);
        this.LIZ = SXY.LIZIZ(r3).LIZ;
        this.LIZIZ = SXY.LIZ();
        this.LJI = r3.getWindow();
        this.LJII = 7he.LIZ(new SY9(this));
        this.LJIIIIZZ = 7he.LIZ(new C3430SXy(this));
        this.LIZJ = new SYT(this);
    }

    public final void LIZ(String str) {
        M12.LIZ(str);
        M12.LIZ(str);
        ((ThemeViewModel) this.LJII.getValue()).LJ().postValue(str);
        SettingServiceImpl.LJIJJ().LIZ(this.LIZLLL.hashCode(), str);
    }

    public /* synthetic */ GlobalDarkThemeController(1hK r1, byte b) {
        this(r1);
    }
}
