package com.bytedance.android.live.pin.widget;

import X.2GD;
import X.6Is;
import X.AnonymousClass0CB;
import X.AnonymousClass0CH;
import X.AnonymousClass0HH;
import X.C03060Bs;
import X.C03070Bt;
import X.C03090Bv;
import X.C03110Bx;
import X.C03120By;
import X.C255810i;
import X.C36201cA;
import X.C36251cF;
import X.GbG;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
import com.bytedance.android.live.pin.PinMessageViewModel;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import com.bytedance.provider.vm.ScopeViewModel;
import kotlin.h.b.n;

public final class ExtendScreenCommentPinnedWidget extends BaseCommentPinnedWidget implements 6Is {
    static {
        Covode.recordClassIndex(9743);
    }

    public final int getLayoutId() {
        return 2131561903;
    }

    public final void onStateChanged(AnonymousClass0CH r1, AnonymousClass0CB r2) {
        super.onStateChanged(r1, r2);
    }

    public final C36251cF LIZJ() {
        MethodCollector.i(6795);
        View view = getView();
        C255810i r3 = null;
        if (!(view instanceof ViewGroup)) {
            view = null;
        }
        ViewGroup viewGroup = (ViewGroup) view;
        if (viewGroup != null) {
            View LIZ = AnonymousClass0HH.LIZ(LayoutInflater.from(this.context), 2131561902, viewGroup, false);
            viewGroup.addView(LIZ);
            n.LIZIZ(LIZ, "");
            PinMessageViewModel pinMessageViewModel = this.LIZJ;
            if (pinMessageViewModel != null) {
                r3 = pinMessageViewModel.LIZ;
            }
            C36251cF r1 = new C36251cF(LIZ, r3);
            MethodCollector.o(6795);
            return r1;
        }
        MethodCollector.o(6795);
        return null;
    }

    public final C36201cA LIZLLL() {
        MethodCollector.i(6989);
        View view = getView();
        C255810i r3 = null;
        if (!(view instanceof ViewGroup)) {
            view = null;
        }
        ViewGroup viewGroup = (ViewGroup) view;
        if (viewGroup != null) {
            View LIZ = AnonymousClass0HH.LIZ(LayoutInflater.from(this.context), 2131561901, viewGroup, false);
            viewGroup.addView(LIZ);
            n.LIZIZ(LIZ, "");
            PinMessageViewModel pinMessageViewModel = this.LIZJ;
            if (pinMessageViewModel != null) {
                r3 = pinMessageViewModel.LIZ;
            }
            C36201cA r1 = new C36201cA(LIZ, r3);
            MethodCollector.o(6989);
            return r1;
        }
        MethodCollector.o(6989);
        return null;
    }

    public final void LIZIZ() {
        Fragment fragment;
        C03070Bt LIZ;
        GbG gbG = this.widgetCallback;
        if (gbG != null && (fragment = gbG.getFragment()) != null && fragment.getActivity() != null) {
            Fragment fragment2 = gbG.getFragment();
            C03110Bx LIZ2 = C03120By.LIZ(fragment2, (C03090Bv) null);
            if (2GD.LIZ) {
                C03060Bs.LIZ(LIZ2, fragment2);
            }
            Class cls = PinMessageViewModel.class;
            if (cls.equals(ScopeViewModel.class)) {
                LIZ = LIZ2.LIZ("extended", cls);
            } else {
                LIZ = LIZ2.LIZ("extended", cls);
                if (2GD.LIZ) {
                    C03060Bs.LIZ(LIZ, LIZ2);
                }
            }
            this.LIZJ = (PinMessageViewModel) LIZ;
        }
    }
}
