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

import X.0CM;
import X.2ce;
import X.3PM;
import X.78T;
import X.C3494EGk;
import X.C3496EGm;
import X.EH1;
import X.EHE;
import X.M12;
import X.PMk;
import X.PMp;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.powerlist.PowerCell;
import com.ss.android.ugc.aweme.notification.module.NotificationChunkVM;

public class BaseChunkCell<T extends EHE> extends PowerCell<T> {
    public static final /* synthetic */ PMp[] LIZ = {new PMk(BaseChunkCell.class, "control", "getControl()Lcom/ss/android/ugc/aweme/notification/module/NotificationChunk$CellControl;", 0)};
    public int LIZIZ = -1;
    public final 78T LJIIIZ = new C3496EGm(this);
    public final 0CM<Boolean> LJIIJ = new EH1(this);

    static {
        Covode.recordClassIndex(95648);
    }

    private final NotificationChunkVM LIZIZ() {
        C3494EGk eGk = (C3494EGk) this.LJIIIZ.LIZ(this, LIZ[0]);
        if (eGk != null) {
            return eGk.LIZIZ;
        }
        return null;
    }

    public void bE_() {
        2ce<Boolean> LIZIZ2;
        super.bE_();
        NotificationChunkVM LIZIZ3 = LIZIZ();
        if (LIZIZ3 != null && (LIZIZ2 = LIZIZ3.LIZIZ()) != null) {
            LIZIZ2.observe(this, this.LJIIJ);
        }
    }

    public void bF_() {
        2ce<Boolean> LIZIZ2;
        super.bF_();
        NotificationChunkVM LIZIZ3 = LIZIZ();
        if (LIZIZ3 != null && (LIZIZ2 = LIZIZ3.LIZIZ()) != null) {
            LIZIZ2.removeObserver(this.LJIIJ);
        }
    }

    public void LIZ() {
        Integer num;
        StringBuilder sb = new StringBuilder("onPositionChanged:[");
        sb.append(this.LIZIZ);
        sb.append(", ");
        EHE ehe = (EHE) this.LIZLLL;
        if (ehe != null) {
            num = Integer.valueOf(ehe.LIZ);
        } else {
            num = null;
        }
        sb.append(num);
        sb.append(']');
        3PM.LIZ("ChunkCell", sb.toString());
    }

    public void LIZ(T t) {
        M12.LIZ(t);
        super.LIZ(t);
        this.LIZIZ = t.LIZ;
    }
}
