package com.ss.android.ugc.aweme.cell;

import X.070;
import X.2yN;
import X.3EX;
import X.4FI;
import X.7he;
import X.AnonymousClass9w1;
import X.C1915Ajv;
import X.C1922Ak2;
import X.C1925Ak5;
import X.Crj;
import X.M12;
import X.QHW;
import X.QJt;
import X.Qeg;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.powerlist.PowerCell;
import com.bytedance.lighten.loader.SmartImageView;
import com.ss.android.ugc.aweme.base.model.UrlModel;
import com.ss.android.ugc.aweme.feed.model.Aweme;
import com.ss.android.ugc.aweme.feed.model.AwemeStatistics;
import com.ss.android.ugc.aweme.out.AVExternalServiceImpl;
import com.ss.android.ugc.aweme.services.video.IAVPublishService;
import kotlin.h.b.n;

public class BaseVideoCell<T> extends PowerCell<C1925Ak5> {
    public SmartImageView LIZ;
    public Drawable LIZIZ;
    public Qeg LJIIIZ;
    public ViewGroup LJIIJ;
    public 4FI LJIIJJI;
    public View LJIIL;
    public Aweme LJIILIIL;
    public final IAVPublishService LJIILJJIL;
    public final String LJIILL;
    public final Crj LJIILLIIL = 7he.LIZ(new C1915Ajv(this));

    static {
        Covode.recordClassIndex(55521);
    }

    public final Context LJIJI() {
        return (Context) this.LJIILLIIL.getValue();
    }

    public final SmartImageView LIZ() {
        SmartImageView smartImageView = this.LIZ;
        if (smartImageView == null) {
            n.LIZ("");
        }
        return smartImageView;
    }

    public final Qeg LIZIZ() {
        Qeg qeg = this.LJIIIZ;
        if (qeg == null) {
            n.LIZ("");
        }
        return qeg;
    }

    public final ViewGroup LIZJ() {
        ViewGroup viewGroup = this.LJIIJ;
        if (viewGroup == null) {
            n.LIZ("");
        }
        return viewGroup;
    }

    public final 4FI LIZLLL() {
        4FI r1 = this.LJIIJJI;
        if (r1 == null) {
            n.LIZ("");
        }
        return r1;
    }

    public final View LJ() {
        View view = this.LJIIL;
        if (view == null) {
            n.LIZ("");
        }
        return view;
    }

    public final Aweme LJFF() {
        Aweme aweme = this.LJIILIIL;
        if (aweme == null) {
            n.LIZ("");
        }
        return aweme;
    }

    public BaseVideoCell() {
        IAVPublishService publishService = AVExternalServiceImpl.LIZ().publishService();
        this.LJIILJJIL = publishService;
        this.LJIILL = publishService.getCurrentUserId();
    }

    public final void LIZ(4FI r1) {
        M12.LIZ(r1);
        this.LJIIJJI = r1;
    }

    public final void LIZIZ(ViewGroup viewGroup) {
        M12.LIZ(viewGroup);
        this.LJIIJ = viewGroup;
    }

    public final void LIZ(Qeg qeg) {
        M12.LIZ(qeg);
        this.LJIIIZ = qeg;
    }

    public final void LIZ(View view) {
        M12.LIZ(view);
        this.LJIIL = view;
    }

    public final void LIZ(C1925Ak5 ak5) {
        long j;
        M12.LIZ(ak5);
        AwemeStatistics statistics = ak5.LIZ.getStatistics();
        Qeg qeg = this.LJIIIZ;
        if (qeg == null) {
            n.LIZ("");
        }
        qeg.setVisibility(0);
        if (statistics != null) {
            j = statistics.getPlayCount();
        } else {
            j = 0;
        }
        String LIZ2 = 2yN.LIZ(j);
        if (this.LIZIZ == null) {
            this.LIZIZ = LJIJI().getDrawable(2131233602);
        }
        Qeg qeg2 = this.LJIIIZ;
        if (qeg2 == null) {
            n.LIZ("");
        }
        LIZ((TextView) qeg2, this.LIZIZ);
        Qeg qeg3 = this.LJIIIZ;
        if (qeg3 == null) {
            n.LIZ("");
        }
        qeg3.setText(LIZ2);
        Qeg qeg4 = this.LJIIIZ;
        if (qeg4 == null) {
            n.LIZ("");
        }
        qeg4.setTextColor(070.LIZJ(LJIJI(), 2131099659));
        Qeg qeg5 = this.LJIIIZ;
        if (qeg5 == null) {
            n.LIZ("");
        }
        qeg5.setTuxFont(72);
    }

    public final void LIZ(SmartImageView smartImageView) {
        M12.LIZ(smartImageView);
        this.LIZ = smartImageView;
    }

    public final void LIZ(Aweme aweme) {
        M12.LIZ(aweme);
        this.LJIILIIL = aweme;
    }

    public final void LIZ(TextView textView, Drawable drawable) {
        if (textView != null) {
            textView.setCompoundDrawablesRelativeWithIntrinsicBounds(drawable, (Drawable) null, (Drawable) null, (Drawable) null);
        }
    }

    public final void LIZ(UrlModel urlModel, String str) {
        Aweme aweme = this.LJIILIIL;
        if (aweme == null) {
            n.LIZ("");
        }
        LIZ(urlModel, str, aweme);
    }

    public final void LIZ(UrlModel urlModel, String str, Aweme aweme) {
        QJt LIZ2 = QHW.LIZ(3EX.LIZ(urlModel));
        int[] LIZ3 = AnonymousClass9w1.LIZ(200);
        if (LIZ3 != null) {
            LIZ2.LIZIZ(LIZ3);
        }
        SmartImageView smartImageView = this.LIZ;
        if (smartImageView == null) {
            n.LIZ("");
        }
        LIZ2.LJJIIZ = smartImageView;
        LIZ2.LIZ(str);
        LIZ2.LIZJ();
        if (aweme != null && aweme.getVideo() != null && !C1922Ak2.LIZ()) {
            aweme.getVideo().setCachedOuterCoverUrl(urlModel);
            aweme.getVideo().setCachedOuterCoverSize(LIZ3);
        }
    }
}
