package com.ss.android.ugc.aweme.feed.adapter;

import X.2GO;
import X.2Gn;
import X.2HT;
import X.4Zv;
import X.4aP;
import X.4lx;
import X.7hc;
import X.8Fb;
import X.A7H;
import X.AT6;
import X.ATY;
import X.BDX;
import X.BDY;
import X.C1109ASr;
import X.C1116ASy;
import X.C2188AoK;
import X.Crj;
import X.CsT;
import X.Cso;
import X.CuD;
import X.CuS;
import X.CzM;
import X.Czg;
import X.D1G;
import X.KEM;
import X.M12;
import com.bytedance.covode.number.Covode;
import com.bytedance.lighten.loader.SmartImageView;
import com.ss.android.ugc.aweme.feed.assem.photos.PhotoViewModel;
import com.ss.android.ugc.aweme.feed.model.Aweme;
import com.ss.android.ugc.aweme.feed.model.BaseFeedPageParams;
import com.ss.android.ugc.aweme.feed.model.Video;
import com.ss.android.ugc.aweme.feed.model.VideoUrlModel;
import com.ss.android.ugc.aweme.share.ShareServiceImpl;
import kotlin.h.b.n;

public final class FeedPhotosViewHolder extends VideoViewCell implements 2GO {
    public final C1109ASr LIZLLL;
    public final Crj LJ;
    public Aweme LJFF;

    static {
        Covode.recordClassIndex(76432);
    }

    public final PhotoViewModel LJJIIZI() {
        return (PhotoViewModel) this.LJ.getValue();
    }

    public final Aweme LJJJ() {
        return this.LJFF;
    }

    public final void LJII() {
        FeedPhotosViewHolder.super.LJII();
        LJJIJIIJIL();
    }

    public final void LJIILJJIL() {
        FeedPhotosViewHolder.super.LJIILJJIL();
        LJJIJIIJIL();
    }

    public final void LJJJLIIL() {
        this.LIZLLL.LIZ();
    }

    public final /* synthetic */ CuD aM_() {
        return cr_();
    }

    private final void LJJIJIIJIL() {
        C1109ASr aSr = this.LIZLLL;
        Aweme LIZIZ = LIZIZ();
        n.LIZIZ(LIZIZ, "");
        aSr.LIZ(LIZIZ);
    }

    public final void LJI() {
        FeedPhotosViewHolder.super.LJI();
        this.LIZLLL.LIZ();
    }

    public final void LJJIFFI() {
        FeedPhotosViewHolder.super.LJJIFFI();
        LJJIIZI().LJIIIZ();
    }

    public final CzM cr_() {
        if (this.LJLIIIL != null) {
            CzM czM = this.LJLIIIL;
            n.LIZIZ(czM, "");
            return czM;
        }
        BaseFeedPageParams baseFeedPageParams = this.LJLJJLL;
        n.LIZIZ(baseFeedPageParams, "");
        this.LJLIIIL = new Czg(baseFeedPageParams, new BDX(this), LJIIJJI(), this.LIZLLL);
        CzM czM2 = this.LJLIIIL;
        n.LIZIZ(czM2, "");
        return czM2;
    }

    public final void LIZIZ(int i) {
        FeedPhotosViewHolder.super.LIZIZ(i);
        LJJIJIIJIL();
    }

    public final void LIZ(Aweme aweme) {
        this.LJFF = aweme;
        FeedPhotosViewHolder.super.LIZ(4lx.LIZJ(aweme));
    }

    public final void LIZIZ(long j) {
        this.LIZLLL.LJ += j;
    }

    public final void LIZJ(int i) {
        FeedPhotosViewHolder.super.LIZJ(i);
        LJJIIZI().LJIIIZ();
    }

    public final void onPlaying(String str) {
        FeedPhotosViewHolder.super.onPlaying(str);
        LJJIIZI().LJIIIZ();
    }

    public final void LIZ(2Gn r3) {
        M12.LIZ(r3);
        if (n.LIZ(r3.LIZIZ, "HOME")) {
            this.LIZLLL.LIZ();
        } else {
            LJJIJIIJIL();
        }
    }

    public final void LIZJ(long j) {
        this.LIZLLL.LIZ = Long.valueOf(j);
    }

    public final void LIZLLL(boolean z) {
        FeedPhotosViewHolder.super.LIZLLL(z);
        PhotoViewModel LJJIIZI = LJJIIZI();
        LJJIIZI.withState(new AT6(LJJIIZI));
        LJJIJIIJIL();
    }

    public final void LJFF(String str) {
        M12.LIZ(str);
        PhotoViewModel LJJIIZI = LJJIIZI();
        M12.LIZ(str);
        C1116ASy aSy = LJJIIZI.LIZJ;
        M12.LIZ(str);
        aSy.LIZ = str;
    }

    public final void onResumePlay(String str) {
        FeedPhotosViewHolder.super.onResumePlay(str);
        LJJIIZI().LJIIIZ();
        if (this.LIZLLL.LIZIZ == -1) {
            this.LIZLLL.LIZ();
        }
    }

    public final void LIZ(int i) {
        FeedPhotosViewHolder.super.LIZ(i);
        ShareServiceImpl.LJ().LIZ(LJJIIZI().getState().LIZLLL);
        this.LIZLLL.LIZ();
        this.LIZLLL.LJI = 4Zv.LIZ(2);
        PhotoViewModel LJJIIZI = LJJIIZI();
        LJJIIZI.LIZJ.LJ = false;
        LJJIIZI.setStateImmediate(ATY.LIZ);
        LJJIIZI.LJIIIZ();
    }

    /* JADX WARNING: type inference failed for: r13v0, types: [X.BDg, com.bytedance.ext_power_list.AssemReusedContainer, com.ss.android.ugc.aweme.feed.adapter.FeedPhotosViewHolder] */
    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public FeedPhotosViewHolder(4aP r14) {
        super(r14);
        7hc r12;
        M12.LIZ(r14);
        D1G LIZ = KEM.LIZ.LIZ(PhotoViewModel.class);
        BDY bdy = BDY.INSTANCE;
        if (CuS.LJIIIIZZ) {
            r12 = 7hc.SYNCHRONIZED;
        } else {
            r12 = 7hc.NONE;
        }
        this.LJ = new CsT(LIZ, Cso.LIZ(this, LIZ.LIZIZ()), Cso.LIZ(false), C2188AoK.LIZ(this, false), this, A7H.LIZ, bdy, aS_(), r12);
        this.LIZLLL = new C1109ASr(r14.LJIIIZ, (byte) 0);
    }

    public final void LIZ(2HT r2) {
        if (r2 == null) {
            return;
        }
        if (r2.LIZ) {
            LJJIIZI().LJI();
            this.LIZLLL.LIZ();
            return;
        }
        LJJIIZI().LJII();
        LJJIJIIJIL();
    }

    public final void onPausePlay(String str) {
        String str2;
        VideoUrlModel playAddr;
        FeedPhotosViewHolder.super.onPausePlay(str);
        if (str != null) {
            Aweme LIZIZ = LIZIZ();
            n.LIZIZ(LIZIZ, "");
            if (!n.LIZ(str, LIZIZ.getAid())) {
                Aweme LIZIZ2 = LIZIZ();
                n.LIZIZ(LIZIZ2, "");
                Video video = LIZIZ2.getVideo();
                if (video == null || (playAddr = video.getPlayAddr()) == null) {
                    str2 = null;
                } else {
                    str2 = playAddr.getSourceId();
                }
                if (!n.LIZ(str, str2)) {
                    return;
                }
            }
        }
        LJJIIZI().LJIIJ();
    }

    public final void LIZ(Video video) {
        SmartImageView smartImageView = this.LJIJI;
        n.LIZIZ(smartImageView, "");
        smartImageView.setVisibility(8);
        this.LJJZ = false;
    }

    public final void onRenderFirstFrame(String str, 8Fb r3) {
        FeedPhotosViewHolder.super.onRenderFirstFrame(str, r3);
        LJJIIZI().LJIIIZ();
    }
}
