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

import X.0HH;
import X.1Bn;
import X.2UX;
import X.2nK;
import X.7he;
import X.C0295Crj;
import X.C0372Cui;
import X.C0436Cwu;
import X.C1481DaP;
import X.C3549EIn;
import X.C3550EIo;
import X.C3551EIp;
import X.C3558EIw;
import X.CE9;
import X.CuG;
import X.M12;
import X.Qeg;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.powerlist.PowerCell;
import com.bytedance.tiktok.proxy.LifecycleForceNotifyObserver;
import com.ss.android.ugc.aweme.notification.vm.GuideUserSwitchVM;
import kotlin.h.b.n;

public final class GuideOutPushSwitchCell extends PowerCell<C3551EIp> implements View.OnClickListener {
    public static final C3558EIw LIZ = new C3558EIw((byte) 0);
    public CE9 LIZIZ;
    public Qeg LJIIIZ;
    public final C0295Crj LJIIJ = 7he.LIZ(new C3549EIn(this));

    static {
        Covode.recordClassIndex(95967);
    }

    private final GuideUserSwitchVM LIZ() {
        return (GuideUserSwitchVM) this.LJIIJ.getValue();
    }

    public final /* synthetic */ void LIZ(C1481DaP daP) {
        C3551EIp eIp = (C3551EIp) daP;
        M12.LIZ(eIp);
        super.LIZ(eIp);
        Qeg qeg = this.LJIIIZ;
        if (qeg == null) {
            n.LIZ("");
        }
        qeg.setText(eIp.LIZJ);
    }

    public final View LIZ(ViewGroup viewGroup) {
        GuideUserSwitchVM LIZ2;
        1Bn r4;
        M12.LIZ(viewGroup);
        View LIZ3 = 0HH.LIZ(LayoutInflater.from(viewGroup.getContext()), 2131558856, viewGroup, false);
        CE9 findViewById = LIZ3.findViewById(2131371317);
        n.LIZIZ(findViewById, "");
        this.LIZIZ = findViewById;
        Qeg findViewById2 = LIZ3.findViewById(2131370965);
        n.LIZIZ(findViewById2, "");
        this.LJIIIZ = findViewById2;
        CE9 ce9 = this.LIZIZ;
        if (ce9 == null) {
            n.LIZ("");
        }
        ce9.setOnClickListener(this);
        CE9 ce92 = this.LIZIZ;
        if (ce92 == null) {
            n.LIZ("");
        }
        ce92.setVisibility(0);
        if (!(bA_() == null || (LIZ2 = LIZ()) == null || (r4 = LIZ2.LIZ) == null)) {
            C3550EIo eIo = C3550EIo.LIZ;
            M12.LIZ(r4, eIo);
            M12.LIZ(r4, eIo);
            CuG aV_ = aV_();
            if (aV_ != null) {
                r4.observe(aV_, new LifecycleForceNotifyObserver(aV_, new C0372Cui(aV_, r4, eIo)));
            }
        }
        n.LIZIZ(LIZ3, "");
        return LIZ3;
    }

    public final void onClick(View view) {
        C3551EIp eIp;
        String str;
        GuideUserSwitchVM LIZ2;
        M12.LIZ(view);
        if ((view instanceof CE9) && (eIp = (C3551EIp) this.LIZLLL) != null) {
            String str2 = eIp.LIZLLL;
            if (!(str2 == null || (LIZ2 = LIZ()) == null)) {
                C0436Cwu cwu = new C0436Cwu(str2, Boolean.valueOf(((CE9) view).isChecked()));
                M12.LIZ(cwu);
                LIZ2.LIZ.postValue(cwu);
            }
            2UX r2 = new 2UX();
            r2.LIZ("enter_from", eIp.LIZ);
            r2.LIZ("trigger", eIp.LIZIZ);
            String str3 = eIp.LIZLLL;
            if (str3 != null) {
                switch (str3.hashCode()) {
                    case -2081740044:
                        if (str3.equals("digg_push")) {
                            r2.LIZ("sub_type", "likes");
                            break;
                        }
                        break;
                    case 795516154:
                        if (str3.equals("comment_push")) {
                            r2.LIZ("sub_type", "comments");
                            break;
                        }
                        break;
                    case 1596510952:
                        if (str3.equals("follow_push")) {
                            r2.LIZ("sub_type", "new_followers");
                            break;
                        }
                        break;
                    case 2009230415:
                        if (str3.equals("mention_push")) {
                            r2.LIZ("sub_type", "mentions");
                            break;
                        }
                        break;
                }
            }
            if (((CE9) view).isChecked()) {
                str = "on";
            } else {
                str = "off";
            }
            r2.LIZ("to_status", str);
            2nK.LIZ("click_push_permission", r2.LIZ);
        }
    }
}
