package com.ss.android.ugc.aweme.social.widget.card.rec.cell;

import X.070;
import X.0HH;
import X.2UX;
import X.2nK;
import X.4ZZ;
import X.7he;
import X.7xU;
import X.C0295Crj;
import X.C1481DaP;
import X.C1978DiQ;
import X.C1986DiY;
import X.C1987DiZ;
import X.C1988Dia;
import X.C1989Dib;
import X.CbG;
import X.LnI;
import X.M12;
import X.Qeg;
import android.content.res.Resources;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.powerlist.PowerCell;
import com.bytedance.router.SmartRoute;
import com.bytedance.router.SmartRouter;
import com.ss.android.ugc.aweme.social.widget.card.rec.vm.SocialCardVM;
import java.util.Map;
import kotlin.h.b.n;

public final class InviteFriendCell extends PowerCell<C1987DiZ> {
    public View LIZ;
    public C1987DiZ LIZIZ;
    public final C0295Crj LJIIIZ = 7he.LIZ(new C1986DiY(this));

    static {
        Covode.recordClassIndex(114797);
    }

    private final SocialCardVM LIZIZ() {
        return (SocialCardVM) this.LJIIIZ.getValue();
    }

    public final void bE_() {
        super.bE_();
        SocialCardVM LIZIZ2 = LIZIZ();
        C1987DiZ diZ = this.LIZIZ;
        if (diZ == null) {
            n.LIZ("");
        }
        LIZIZ2.LIZ((C1481DaP) diZ);
    }

    public final void LIZ() {
        SocialCardVM LIZIZ2 = LIZIZ();
        C1987DiZ diZ = this.LIZIZ;
        if (diZ == null) {
            n.LIZ("");
        }
        M12.LIZ(diZ);
        Map<String, String> map = LIZIZ2.LJI;
        M12.LIZ(map);
        2UX r0 = new 2UX();
        r0.LIZ("enter_from", map.get("enter_from"));
        2nK.LIZ("invite_friends", r0.LIZ);
        View view = this.itemView;
        n.LIZIZ(view, "");
        SmartRoute buildRoute = SmartRouter.buildRoute(view.getContext(), "//friends/invite");
        buildRoute.withParam("enter_from", "homepage_friends");
        buildRoute.open();
    }

    public final View LIZ(ViewGroup viewGroup) {
        M12.LIZ(viewGroup);
        View LIZ2 = 0HH.LIZ(LayoutInflater.from(viewGroup.getContext()), 2131561358, viewGroup, false);
        n.LIZIZ(LIZ2, "");
        this.LIZ = LIZ2;
        if (LIZ2 == null) {
            n.LIZ("");
        }
        return LIZ2;
    }

    public final /* synthetic */ void LIZ(C1481DaP daP) {
        C1987DiZ diZ = (C1987DiZ) daP;
        M12.LIZ(diZ);
        super.LIZ(diZ);
        this.LIZIZ = diZ;
        if (diZ.LIZ) {
            View view = this.LIZ;
            if (view == null) {
                n.LIZ("");
            }
            Qeg findViewById = view.findViewById(2131371242);
            if (findViewById != null) {
                View view2 = this.itemView;
                n.LIZIZ(view2, "");
                findViewById.setTextColor(070.LIZJ(view2.getContext(), 2131099664));
            }
            View view3 = this.LIZ;
            if (view3 == null) {
                n.LIZ("");
            }
            Qeg findViewById2 = view3.findViewById(2131364007);
            if (findViewById2 != null) {
                View view4 = this.itemView;
                n.LIZIZ(view4, "");
                findViewById2.setTextColor(070.LIZJ(view4.getContext(), 2131099689));
            }
            View view5 = this.LIZ;
            if (view5 == null) {
                n.LIZ("");
            }
            4ZZ findViewById3 = view5.findViewById(2131365854);
            if (findViewById3 != null) {
                View view6 = this.itemView;
                n.LIZIZ(view6, "");
                findViewById3.setTintColor(070.LIZJ(view6.getContext(), 2131099685));
            }
        }
        View view7 = this.LIZ;
        if (view7 == null) {
            n.LIZ("");
        }
        FrameLayout frameLayout = (FrameLayout) view7.findViewById(2131365861);
        if (frameLayout != null) {
            ViewGroup.LayoutParams layoutParams = frameLayout.getLayoutParams();
            if (layoutParams != null) {
                float value = (float) diZ.LIZIZ.getValue();
                Resources system = Resources.getSystem();
                n.LIZIZ(system, "");
                layoutParams.width = LnI.LIZ(TypedValue.applyDimension(1, value, system.getDisplayMetrics()));
                float value2 = (float) diZ.LIZIZ.getValue();
                Resources system2 = Resources.getSystem();
                n.LIZIZ(system2, "");
                layoutParams.height = LnI.LIZ(TypedValue.applyDimension(1, value2, system2.getDisplayMetrics()));
                frameLayout.setLayoutParams(layoutParams);
            } else {
                throw new 7xU("null cannot be cast to non-null type android.view.ViewGroup.LayoutParams");
            }
        }
        View view8 = this.LIZ;
        if (view8 == null) {
            n.LIZ("");
        }
        float LIZ2 = (float) C1978DiQ.LIZ(diZ.LIZIZ);
        Resources system3 = Resources.getSystem();
        n.LIZIZ(system3, "");
        view8.setPadding(view8.getPaddingLeft(), LnI.LIZ(TypedValue.applyDimension(1, LIZ2, system3.getDisplayMetrics())), view8.getPaddingRight(), C1978DiQ.LIZ(diZ.LIZIZ));
        View view9 = this.LIZ;
        if (view9 == null) {
            n.LIZ("");
        }
        4ZZ findViewById4 = view9.findViewById(2131365854);
        if (findViewById4 != null) {
            ViewGroup.LayoutParams layoutParams2 = findViewById4.getLayoutParams();
            if (layoutParams2 != null) {
                float LIZIZ2 = (float) C1978DiQ.LIZIZ(diZ.LIZIZ);
                Resources system4 = Resources.getSystem();
                n.LIZIZ(system4, "");
                layoutParams2.width = LnI.LIZ(TypedValue.applyDimension(1, LIZIZ2, system4.getDisplayMetrics()));
                float LIZIZ3 = (float) C1978DiQ.LIZIZ(diZ.LIZIZ);
                Resources system5 = Resources.getSystem();
                n.LIZIZ(system5, "");
                layoutParams2.height = LnI.LIZ(TypedValue.applyDimension(1, LIZIZ3, system5.getDisplayMetrics()));
                findViewById4.setLayoutParams(layoutParams2);
            } else {
                throw new 7xU("null cannot be cast to non-null type android.view.ViewGroup.LayoutParams");
            }
        }
        View view10 = this.LIZ;
        if (view10 == null) {
            n.LIZ("");
        }
        Qeg findViewById5 = view10.findViewById(2131371242);
        if (findViewById5 != null) {
            View view11 = this.itemView;
            n.LIZIZ(view11, "");
            findViewById5.setText(view11.getResources().getString(2131822227));
        }
        View view12 = this.LIZ;
        if (view12 == null) {
            n.LIZ("");
        }
        4ZZ findViewById6 = view12.findViewById(2131365854);
        if (findViewById6 != null) {
            findViewById6.setIconRes(2131755190);
        }
        View view13 = this.LIZ;
        if (view13 == null) {
            n.LIZ("");
        }
        Qeg findViewById7 = view13.findViewById(2131364007);
        if (findViewById7 != null) {
            View view14 = this.itemView;
            n.LIZIZ(view14, "");
            findViewById7.setText(view14.getResources().getString(2131825336));
        }
        View view15 = this.LIZ;
        if (view15 == null) {
            n.LIZ("");
        }
        CbG findViewById8 = view15.findViewById(2131363083);
        if (findViewById8 != null) {
            View view16 = this.itemView;
            n.LIZIZ(view16, "");
            findViewById8.setText(view16.getResources().getString(2131826296));
        }
        View view17 = this.LIZ;
        if (view17 == null) {
            n.LIZ("");
        }
        view17.setOnClickListener(new C1988Dia(this));
        View view18 = this.LIZ;
        if (view18 == null) {
            n.LIZ("");
        }
        CbG findViewById9 = view18.findViewById(2131363083);
        if (findViewById9 != null) {
            findViewById9.setOnClickListener(new C1989Dib(this));
        }
    }
}
