package com.ss.android.ugc.aweme.influencer.ecommercelive.framework.settings;

import X.0EJ;
import X.1Cv;
import X.9EH;
import X.C4398QmZ;
import X.C4502QoF;
import X.C4628QqH;
import X.C4629QqI;
import X.C4630QqJ;
import X.C4632QqL;
import X.M12;
import X.Q39;
import X.QNL;
import X.QWT;
import android.content.res.Resources;
import android.os.Looper;
import androidx.recyclerview.widget.RecyclerView;
import com.bytedance.covode.number.Covode;
import com.lynx.react.bridge.JavaOnlyMap;
import com.lynx.tasm.behavior.ui.list.UIList;
import kotlin.h.b.n;

public final class LynxDragListUIView extends UIList {
    public static final C4632QqL LJIILL = new C4632QqL((byte) 0);
    public 1Cv LJIIJ;
    public int LJIIJJI = 100;
    public int LJIIL = -1;
    public final C4630QqJ LJIILIIL = new C4630QqJ(this, Looper.getMainLooper());
    public final 0EJ LJIILJJIL = new C4629QqI(this);
    public boolean LJIILLIIL;
    public C4628QqH LJIIZILJ;

    static {
        Covode.recordClassIndex(88413);
    }

    public final void onPropsUpdated() {
        super.onPropsUpdated();
        JavaOnlyMap LIZ = LIZ();
        n.LIZIZ(LIZ, Q39.LIZJ);
        LIZ.getMap("diffResult");
        C4628QqH qqH = this.LJIIZILJ;
        if (qqH != null) {
            qqH.LIZJ();
        }
    }

    @QNL(LIZ = "drag-trigger-duration", LJ = 100)
    public final void setDragTriggerDuration(int i) {
        if (this.LJIIJJI != i) {
            this.LJIIJJI = i;
        }
    }

    public LynxDragListUIView(C4398QmZ qmZ) {
        super(qmZ);
    }

    @QNL(LIZ = "drag-slide-speed", LJ = -1)
    public final void setDragSlideSpeed(int i) {
        int i2 = -1;
        if (i != -1) {
            Resources resources = 9EH.LJJIFFI.LIZ().getResources();
            n.LIZIZ(resources, Q39.LIZJ);
            i2 = (int) ((resources.getDisplayMetrics().density * ((float) i)) + 0.5f);
        }
        if (this.LJIIL != i2) {
            this.LJIIL = i2;
        }
    }

    @QNL(LIZ = "drag-enable", LJFF = false)
    public final void setDragEnable(boolean z) {
        if (this.LJIILLIIL != z) {
            this.LJIILLIIL = z;
            if (z) {
                C4628QqH qqH = new C4628QqH(this);
                1Cv r2 = new 1Cv(qqH);
                r2.LIZ((RecyclerView) this.mView);
                ((RecyclerView) this.mView).LIZ(this.LJIILJJIL);
                this.LJIIZILJ = qqH;
                this.LJIIJ = r2;
                return;
            }
            this.LJIIZILJ = null;
            1Cv r0 = this.LJIIJ;
            if (r0 != null) {
                r0.LIZ((RecyclerView) null);
            }
            ((RecyclerView) this.mView).LIZIZ(this.LJIILJJIL);
            this.LJIIJ = null;
            this.LJIILIIL.removeCallbacksAndMessages((Object) null);
        }
    }

    public final void LIZ(String str, int i) {
        M12.LIZ(str);
        QWT qwt = new QWT(getSign(), "dragstatechange");
        qwt.LIZ("state", str);
        qwt.LIZ("position", Integer.valueOf(i));
        C4398QmZ qmZ = this.mContext;
        n.LIZIZ(qmZ, Q39.LIZJ);
        qmZ.LJFF.LIZ((C4502QoF) qwt);
    }
}
