package com.lynx.tasm.behavior.ui.list;

import X.C4398QmZ;
import X.C4549Qp0;
import X.LC5;
import X.QNL;
import android.view.ViewGroup;
import com.bytedance.covode.number.Covode;
import com.lynx.react.bridge.JavaOnlyMap;
import com.lynx.react.bridge.ReadableType;
import com.lynx.tasm.TemplateAssembler;
import com.lynx.tasm.base.LLog;
import com.lynx.tasm.behavior.ui.LynxBaseUI;
import com.lynx.tasm.behavior.ui.LynxUI;
import com.lynx.tasm.behavior.ui.view.UIComponent;
import com.lynx.tasm.behavior.ui.view.UISimpleView;

public abstract class AbsLynxList<T extends ViewGroup> extends UISimpleView<T> {
    public C4549Qp0 LIZ;
    public LynxBaseUI LIZIZ;
    public int[] LIZJ = new int[2];
    public int[] LIZLLL = new int[2];

    static {
        Covode.recordClassIndex(46697);
    }

    public boolean isScrollable() {
        return true;
    }

    public void onInsertChild(LynxBaseUI lynxBaseUI, int i) {
    }

    @QNL(LIZ = "cache-queue-ratio", LIZIZ = "1")
    public abstract void setCacheQueueRatio(LC5 lc5);

    @QNL(LIZ = "column-count", LJ = 1)
    public abstract void setColumnCount(int i);

    @QNL(LIZ = "list-cross-axis-gap", LIZIZ = "0")
    public abstract void setCrossAxisGap(float f);

    @QNL(LIZ = "paging-enabled", LIZIZ = "false")
    public abstract void setEnablePagerSnap(LC5 lc5);

    @QNL(LIZ = "sticky")
    public abstract void setEnableSticky(LC5 lc5);

    @QNL(LIZ = "initial-scroll-index", LIZIZ = "0")
    public abstract void setInitialScrollIndex(LC5 lc5);

    @QNL(LIZ = "list-type", LIZIZ = "single")
    public abstract void setListType(String str);

    @QNL(LIZ = "lower-threshold", LJ = 50)
    public abstract void setLowerThreshold(LC5 lc5);

    @QNL(LIZ = "lower-threshold-item-count", LJ = 0)
    public void setLowerThresholdItemCount(LC5 lc5) {
    }

    @QNL(LIZ = "list-main-axis-gap", LIZIZ = "0")
    public abstract void setMainAxisGap(float f);

    @QNL(LIZ = "needs-visible-cells", LJFF = false)
    public abstract void setNeedVisibleCells(boolean z);

    @QNL(LIZ = "no-invalidate", LJFF = false)
    public abstract void setNoInvalidate(boolean z);

    @QNL(LIZ = "enable-scroll", LIZIZ = "true")
    public abstract void setScrollEnable(LC5 lc5);

    @QNL(LIZ = "scroll-event-throttle", LIZIZ = "200")
    public abstract void setScrollEventThrottle(LC5 lc5);

    @QNL(LIZ = "scroll-state-change-event-throttle", LIZIZ = "10")
    public abstract void setScrollStateChangeEventThrottle(String str);

    @QNL(LIZ = "scroll-x", LIZIZ = "false")
    public abstract void setScrollX(LC5 lc5);

    @QNL(LIZ = "scroll-y", LIZIZ = "true")
    public abstract void setScrollY(LC5 lc5);

    @QNL(LIZ = "sticky-offset", LJ = 0)
    public abstract void setStickyOffset(LC5 lc5);

    @QNL(LIZ = "touch-scroll", LIZIZ = "true")
    public abstract void setTouchScroll(LC5 lc5);

    @QNL(LIZ = "update-animation", LIZIZ = "none")
    public abstract void setUpdateAnimation(String str);

    @QNL(LIZ = "upper-threshold", LJ = 50)
    public abstract void setUpperThreshold(LC5 lc5);

    @QNL(LIZ = "upper-threshold-item-count", LJ = 0)
    public void setUpperThresholdItemCount(LC5 lc5) {
    }

    public final JavaOnlyMap LIZ() {
        C4549Qp0 qp0 = this.LIZ;
        int sign = getSign();
        if (qp0.LIZ == null) {
            return null;
        }
        TemplateAssembler templateAssembler = qp0.LIZ;
        if (!templateAssembler.LJI) {
            return templateAssembler.nativeGetListPlatformInfo(templateAssembler.LIZ, sign);
        }
        LLog.LIZ(6, "TemplateAssembler", "getListPlatformInfo while tasm is destoryed: listSign ".concat(String.valueOf(sign)));
        return null;
    }

    public AbsLynxList(C4398QmZ qmZ) {
        super(qmZ);
        this.LIZ = qmZ.LJII;
        this.LIZIZ = null;
    }

    public final void LIZIZ(LynxUI lynxUI) {
        C4549Qp0 qp0 = this.LIZ;
        int sign = getSign();
        int sign2 = lynxUI.getSign();
        if (qp0.LIZ != null) {
            TemplateAssembler templateAssembler = qp0.LIZ;
            if (templateAssembler.LJI) {
                LLog.LIZ(6, "TemplateAssembler", "recycleChild: listSign " + sign + ", childSign " + sign2);
                return;
            }
            templateAssembler.nativeRecycleChild(templateAssembler.LIZ, sign, sign2);
        }
    }

    @QNL(LIZ = "over-scroll", LIZIZ = "true")
    public void setOverScroll(LC5 lc5) {
        boolean LIZIZ2;
        ReadableType LJIIIIZZ = lc5.LJIIIIZZ();
        if (LJIIIIZZ == ReadableType.String) {
            LIZIZ2 = "true".equals(lc5.LJFF());
        } else {
            if (LJIIIIZZ == ReadableType.Boolean) {
                LIZIZ2 = lc5.LIZIZ();
            }
            ((ViewGroup) this.mView).setOverScrollMode(0);
        }
        if (!LIZIZ2) {
            ((ViewGroup) this.mView).setOverScrollMode(2);
            return;
        }
        ((ViewGroup) this.mView).setOverScrollMode(0);
    }

    public final void LIZ(LynxUI lynxUI) {
        C4549Qp0 qp0 = this.LIZ;
        int sign = getSign();
        int sign2 = lynxUI.getSign();
        if (qp0.LIZ != null) {
            TemplateAssembler templateAssembler = qp0.LIZ;
            if (templateAssembler.LJI) {
                LLog.LIZ(6, "TemplateAssembler", "removeChild: listSign " + sign + ", childSign " + sign2);
                return;
            }
            templateAssembler.nativeRemoveChild(templateAssembler.LIZ, sign, sign2);
        }
    }

    public final void insertChild(LynxBaseUI lynxBaseUI, int i) {
        this.LIZIZ = lynxBaseUI;
        lynxBaseUI.setParent(this);
        this.mChildren.add(this.mChildren.size(), lynxBaseUI);
        onInsertChild(lynxBaseUI, i);
    }

    public final LynxUI LIZ(int i, long j) {
        LynxBaseUI LIZ2;
        C4549Qp0 qp0 = this.LIZ;
        int sign = getSign();
        if (qp0.LIZ == null) {
            return null;
        }
        TemplateAssembler templateAssembler = qp0.LIZ;
        int i2 = i;
        if (templateAssembler.LJI) {
            LLog.LIZ(6, "TemplateAssembler", "obtainChild: listSign " + sign + ", index " + i2);
            return null;
        }
        int nativeObtainChild = templateAssembler.nativeObtainChild(templateAssembler.LIZ, sign, i2, j);
        if (nativeObtainChild <= 0 || (LIZ2 = this.mContext.LIZ(nativeObtainChild)) == null || !(LIZ2 instanceof UIComponent)) {
            return null;
        }
        return (LynxUI) LIZ2;
    }

    public final void LIZ(LynxUI lynxUI, int i, long j) {
        C4549Qp0 qp0 = this.LIZ;
        int sign = getSign();
        int sign2 = lynxUI.getSign();
        if (qp0.LIZ != null) {
            TemplateAssembler templateAssembler = qp0.LIZ;
            int i2 = i;
            if (templateAssembler.LJI) {
                LLog.LIZ(6, "TemplateAssembler", "renderChild: listSign " + sign + ", oldSign " + sign2 + ", newIndex " + i2);
                return;
            }
            templateAssembler.nativeUpdateChild(templateAssembler.LIZ, sign, sign2, i2, j);
        }
    }
}
