package com.lynx.tasm.behavior.ui;

import X.7tl;
import X.C3281QNa;
import X.C3283QNc;
import X.C3482QUt;
import X.C3890QeN;
import X.C3948QfJ;
import X.C4065QhC;
import X.C4201QjO;
import X.C4352Qlp;
import X.C4353Qlq;
import X.C4354Qlr;
import X.C4355Qls;
import X.C4356Qlt;
import X.C4367Qm4;
import X.C4368Qm5;
import X.C4369Qm6;
import X.C4378QmF;
import X.C4381QmI;
import X.C4382QmJ;
import X.C4383QmK;
import X.C4385QmM;
import X.C4387QmO;
import X.C4398QmZ;
import X.C4400Qmb;
import X.C4408Qmj;
import X.C4411Qmm;
import X.C4471Qnk;
import X.C4479Qns;
import X.C4480Qnt;
import X.C4495Qo8;
import X.C4502QoF;
import X.C4506QoJ;
import X.C4511QoO;
import X.LC0;
import X.LC5;
import X.MNo;
import X.Q39;
import X.QNK;
import X.QNL;
import X.QNX;
import X.QNY;
import X.QNZ;
import X.QWH;
import X.QWR;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.RectF;
import android.os.Build;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import com.lynx.react.bridge.Callback;
import com.lynx.react.bridge.JavaOnlyMap;
import com.lynx.react.bridge.ReadableArray;
import com.lynx.react.bridge.ReadableMap;
import com.lynx.react.bridge.ReadableMapKeySetIterator;
import com.lynx.react.bridge.ReadableType;
import com.lynx.tasm.LynxEnv;
import com.lynx.tasm.base.LLog;
import com.lynx.tasm.behavior.ui.scroll.AbsLynxUIScroll;
import com.lynx.tasm.behavior.ui.utils.BackgroundDrawable;
import com.lynx.tasm.behavior.utils.LynxUISetter;
import com.lynx.tasm.behavior.utils.PropsUpdater;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import org.json.JSONObject;

public abstract class LynxBaseUI implements C4511QoO, C4471Qnk {
    public static final float CAMERA_DISTANCE_NORMALIZATION_MULTIPLIER = ((float) Math.sqrt(5.0d));
    public static final int[] SPACING_TYPES = {8, 0, 2, 1, 3, 4, 5};
    public boolean hasTransformChanged;
    public int mAccessibilityElementStatus;
    public String mAccessibilityLabel;
    public int mBackgroundColor;
    public Bitmap.Config mBitmapConfig;
    public boolean mBlockNativeEvent;
    public int mBorderBottomWidth;
    public int mBorderLeftWidth;
    public int mBorderRightWidth;
    public int mBorderTopWidth;
    public Rect mBound;
    public int mCSSPosition;
    public final List<LynxBaseUI> mChildren;
    public boolean mClipToRadius;
    public C4398QmZ mContext;
    public ReadableMap mDataset;
    public C4471Qnk mDrawParent;
    public QWR mDrawableCallback;
    public boolean mEnableScrollMonitor;
    public Map<String, LC0> mEvents;
    public String mExposureID;
    public String mExposureScene;
    public float mExtraOffsetX;
    public float mExtraOffsetY;
    public int mFlattenChildrenCount;
    public boolean mFocusable;
    public float mFontSize;
    public boolean mHasRadius;
    public int mHeight;
    public String mIdSelector;
    public boolean mIgnoreFocus;
    public boolean mIsFirstAnimatedReady;
    public boolean mIsTransformNode;
    public final Point mLastSize;
    public float mLastTranslateZ;
    public final Point mLatestSize;
    public int mLeft;
    public C4369Qm6 mLynxBackground;
    public int mLynxDirection;
    public int mMarginBottom;
    public int mMarginLeft;
    public int mMarginRight;
    public int mMarginTop;
    public float mMaxHeight;
    public String mName;
    public boolean mNeedSortChildren;
    public LynxBaseUI mNextDrawUI;
    public WeakReference<int[]> mOffsetDescendantRectToLynxView;
    public boolean mOnResponceChain;
    public int mOriginLeft;
    public int mOriginTop;
    public int mOverflow;
    public int mPaddingBottom;
    public int mPaddingLeft;
    public int mPaddingRight;
    public int mPaddingTop;
    public Object mParam;
    public C4471Qnk mParent;
    public ReadableArray mPerspective;
    public LynxBaseUI mPreviousDrawUI;
    public final JavaOnlyMap mProps;
    public String mRefId;
    public String mScrollMonitorTag;
    public volatile C4479Qns mScrollStateChangeListener;
    public boolean mShouldAttachChildrenView;
    public int mSign;
    public volatile Set<C4479Qns> mStateChangeListeners;
    public Sticky mSticky;
    public String mTagName;
    public String mTestTagName;
    public int mTop;
    public float mTouchSlop;
    public C4387QmO mTransformOrigin;
    public List<C4368Qm5> mTransformRaw;
    public int mWidth;
    public boolean userInteractionEnabled;

    public boolean canHaveFlattenChild() {
        return true;
    }

    public void dispatchProperties(QNZ qnz) {
    }

    public boolean dispatchTouch(String str, MotionEvent motionEvent) {
        return false;
    }

    public boolean enableLayoutAnimation() {
        return false;
    }

    public ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams layoutParams) {
        return null;
    }

    public int getInitialOverflowType() {
        return 1;
    }

    public C4411Qmm getKeyframeManager() {
        return null;
    }

    public C4408Qmj getLayoutAnimator() {
        return null;
    }

    public float getScaleX() {
        return 1.0f;
    }

    public float getScaleY() {
        return 1.0f;
    }

    public int getScrollX() {
        return 0;
    }

    public int getScrollY() {
        return 0;
    }

    public C4400Qmb getTransitionAnimator() {
        return null;
    }

    public float getTranslationX() {
        return 0.0f;
    }

    public float getTranslationY() {
        return 0.0f;
    }

    public float getTranslationZ() {
        return 0.0f;
    }

    public boolean getVisibility() {
        return true;
    }

    public int getZIndex() {
        return 0;
    }

    public void initTransitionAnimator(ReadableMap readableMap) {
    }

    public void initialize() {
    }

    public void invalidate() {
    }

    public boolean isFlatten() {
        return false;
    }

    public boolean isScrollContainer() {
        return false;
    }

    public boolean isScrollable() {
        return false;
    }

    public boolean needCustomLayout() {
        return false;
    }

    public void offResponseChain() {
        this.mOnResponceChain = false;
    }

    public void onAnimationUpdated() {
    }

    public void onBeforeAnimation(int i, int i2, int i3, int i4, int i5, int i6, int i7, int i8) {
    }

    public void onBorderRadiusUpdated(int i) {
    }

    public void onDrawingPositionChanged() {
    }

    public void onFocusChanged(boolean z, boolean z2) {
    }

    public void onLayoutFinish(long j) {
    }

    public void onResponseChain() {
        this.mOnResponceChain = true;
    }

    public void renderIfNeeded() {
    }

    public void requestLayout() {
    }

    public float[] scrollBy(float f, float f2) {
        return new float[]{0.0f, 0.0f, f, f2};
    }

    public void setAnimation(ReadableArray readableArray) {
    }

    public void setAnimationData(String[] strArr, float[] fArr) {
    }

    @QNL(LIZ = "caret-color")
    public void setCaretColor(String str) {
    }

    public void setLayoutAnimationData(int i, long j, long j2, int i2, int i3, float f, float f2, float f3, float f4, int i4) {
    }

    public void setTransitionData(float[] fArr) {
    }

    public void updateExtraData(Object obj) {
    }

    public boolean blockNativeEvent() {
        return this.mBlockNativeEvent;
    }

    public CharSequence getAccessibilityLabel() {
        return this.mAccessibilityLabel;
    }

    public Rect getBound() {
        return this.mBound;
    }

    public List<LynxBaseUI> getChildren() {
        return this.mChildren;
    }

    public Map<String, LC0> getEvents() {
        return this.mEvents;
    }

    public int getHeight() {
        return this.mHeight;
    }

    public String getIdSelector() {
        return this.mIdSelector;
    }

    public int getLeft() {
        return this.mLeft;
    }

    public int getOriginLeft() {
        return this.mOriginLeft;
    }

    public int getOriginTop() {
        return this.mOriginTop;
    }

    public int getOverflow() {
        return this.mOverflow;
    }

    public JavaOnlyMap getProps() {
        return this.mProps;
    }

    public int getSign() {
        return this.mSign;
    }

    public String getTagName() {
        return this.mTagName;
    }

    public int getTop() {
        return this.mTop;
    }

    public int getWidth() {
        return this.mWidth;
    }

    public boolean ignoreFocus() {
        return this.mIgnoreFocus;
    }

    public boolean isFirstAnimatedReady() {
        return this.mIsFirstAnimatedReady;
    }

    public boolean isFocusable() {
        return this.mFocusable;
    }

    public boolean isOnResponseChain() {
        return this.mOnResponceChain;
    }

    public boolean isUserInteractionEnabled() {
        return this.userInteractionEnabled;
    }

    public void flattenChildrenCountDecrement() {
        this.mFlattenChildrenCount--;
    }

    public void flattenChildrenCountIncrement() {
        this.mFlattenChildrenCount++;
    }

    public LynxBaseUI getDrawParent() {
        return (LynxBaseUI) this.mDrawParent;
    }

    public final int getLatestHeight() {
        return this.mLatestSize.y;
    }

    public final int getLatestWidth() {
        return this.mLatestSize.x;
    }

    public JSONObject getPlatformCustomInfo() {
        return new JSONObject();
    }

    public String getTestID() {
        String str = this.mTestTagName;
        if (str == null) {
            return Q39.LIZJ;
        }
        return str;
    }

    public void recognizeGesturere() {
        C4398QmZ qmZ = this.mContext;
        if (qmZ != null) {
            qmZ.LIZ(this);
        }
    }

    private boolean isImageConfigBadCase() {
        if (Build.VERSION.SDK_INT != 25 || !isMeizu15()) {
            return false;
        }
        return true;
    }

    public void destroy() {
        this.mContext.LIZJ().LIZ(this);
    }

    public Rect getBoundRectForOverflow() {
        if (getOverflow() == 3) {
            return null;
        }
        return getClipBounds();
    }

    public LynxBaseUI getParentBaseUI() {
        C4471Qnk qnk = this.mParent;
        if (qnk instanceof UIShadowProxy) {
            return (LynxBaseUI) ((LynxBaseUI) qnk).mParent;
        }
        return (LynxBaseUI) qnk;
    }

    public final boolean hasSizeChanged() {
        if (!this.mLastSize.equals(this.mLatestSize)) {
            return true;
        }
        return false;
    }

    public boolean isClickable() {
        Map<String, LC0> map = this.mEvents;
        if (map == null || !map.containsKey("tap")) {
            return false;
        }
        return true;
    }

    public boolean isLongClickable() {
        Map<String, LC0> map = this.mEvents;
        if (map == null || !map.containsKey("longpress")) {
            return false;
        }
        return true;
    }

    public C4511QoO parent() {
        C4471Qnk qnk = this.mParent;
        if (qnk instanceof C4511QoO) {
            return (C4511QoO) qnk;
        }
        return null;
    }

    private float getTouchSlop() {
        if (this.mOnResponceChain) {
            return this.mTouchSlop * this.mContext.getResources().getDisplayMetrics().density;
        }
        return 0.0f;
    }

    private synchronized void initScrollStateChangeListener() {
        if (this.mScrollStateChangeListener == null) {
            this.mScrollStateChangeListener = new C4479Qns() {
                static {
                    Covode.recordClassIndex(46605);
                }

                public final void LIZ(int i) {
                    C4479Qns[] qnsArr;
                    MethodCollector.i(6001);
                    synchronized (LynxBaseUI.this) {
                        try {
                            qnsArr = (C4479Qns[]) LynxBaseUI.this.mStateChangeListeners.toArray(new C4479Qns[LynxBaseUI.this.mStateChangeListeners.size()]);
                        } finally {
                            MethodCollector.o(6001);
                        }
                    }
                    for (C4479Qns LIZ2 : qnsArr) {
                        LIZ2.LIZ(i);
                    }
                }
            };
        }
    }

    public static boolean isMeizu() {
        String str = Build.BRAND;
        if (str != null && str.toLowerCase(Locale.ENGLISH).indexOf("meizu") >= 0) {
            return true;
        }
        return false;
    }

    public static boolean isMeizu15() {
        if (!isMeizu() || TextUtils.isEmpty(Build.DEVICE)) {
            return false;
        }
        return Build.DEVICE.contains("15");
    }

    public int[] getOffsetDescendantRectToLynxView() {
        if (this.mOffsetDescendantRectToLynxView.get() != null) {
            return (int[]) this.mOffsetDescendantRectToLynxView.get();
        }
        return new int[]{Integer.MIN_VALUE, Integer.MIN_VALUE};
    }

    public void layout() {
        for (LynxBaseUI layout : this.mChildren) {
            layout.layout();
        }
    }

    public void measure() {
        for (LynxBaseUI measure : this.mChildren) {
            measure.measure();
        }
    }

    public void onAnimatedNodeReady() {
        if (this.mIsFirstAnimatedReady) {
            this.mIsFirstAnimatedReady = false;
        }
        this.mLastSize.x = this.mLatestSize.x;
        this.mLastSize.y = this.mLatestSize.y;
        this.hasTransformChanged = false;
    }

    static {
        Covode.recordClassIndex(46602);
    }

    private void sendLayoutChangeEvent() {
        Map<String, LC0> map = this.mEvents;
        if (map != null && map.containsKey("layoutchange")) {
            this.mContext.LJFF.LIZ(new C4502QoF(getSign(), "layoutchange", getPositionInfo()));
        }
    }

    public Rect getClipBounds() {
        int i;
        int width = getWidth();
        int height = getHeight();
        DisplayMetrics displayMetrics = this.mContext.LJIILIIL;
        int i2 = 0;
        if ((getOverflow() & 1) != 0) {
            i = 0 - displayMetrics.widthPixels;
            width += displayMetrics.widthPixels * 2;
        } else {
            i = 0;
        }
        if ((getOverflow() & 2) != 0) {
            i2 = 0 - displayMetrics.heightPixels;
            height += displayMetrics.heightPixels * 2;
        }
        return new Rect(i, i2, width + i, height + i2);
    }

    public Rect getRectToWindow() {
        C4506QoJ qoJ = this.mContext.LJIIIIZZ.LIZ;
        if (qoJ == null) {
            return new Rect();
        }
        int[] iArr = new int[2];
        qoJ.getLocationInWindow(iArr);
        Rect boundingClientRect = getBoundingClientRect();
        boundingClientRect.offset(iArr[0], iArr[1]);
        return boundingClientRect;
    }

    public void onAttach() {
        C4369Qm6 qm6 = this.mLynxBackground;
        if (qm6.LJ != null) {
            for (C4201QjO LIZLLL : qm6.LJ.LJFF.LIZ) {
                LIZLLL.LIZLLL();
            }
        }
    }

    public void onDetach() {
        C4369Qm6 qm6 = this.mLynxBackground;
        if (qm6.LJ != null) {
            for (C4201QjO LJ : qm6.LJ.LJFF.LIZ) {
                LJ.LJ();
            }
        }
    }

    public void onLayoutUpdated() {
        C4369Qm6 qm6 = this.mLynxBackground;
        float f = (float) this.mPaddingTop;
        float f2 = (float) this.mPaddingRight;
        float f3 = (float) this.mPaddingBottom;
        float f4 = (float) this.mPaddingLeft;
        BackgroundDrawable backgroundDrawable = qm6.LJ;
        if (backgroundDrawable != null) {
            backgroundDrawable.LIZ(1, f);
            backgroundDrawable.LIZ(2, f2);
            backgroundDrawable.LIZ(3, f3);
            backgroundDrawable.LIZ(0, f4);
        }
        invalidate();
        requestLayout();
    }

    public final boolean shouldDoTransform() {
        C4387QmO qmO;
        if (this.hasTransformChanged || ((C4368Qm5.LIZ(this.mTransformRaw) || ((qmO = this.mTransformOrigin) != null && ((qmO.LIZ() || qmO.LIZIZ()) && qmO.LJ()))) && hasSizeChanged())) {
            return true;
        }
        return false;
    }

    private JavaOnlyMap getPositionInfo() {
        Rect boundingClientRect = getBoundingClientRect();
        float f = this.mContext.LJIILIIL.density;
        JavaOnlyMap javaOnlyMap = new JavaOnlyMap();
        javaOnlyMap.putString("id", getIdSelector());
        javaOnlyMap.putMap("dataset", new JavaOnlyMap());
        javaOnlyMap.putDouble("left", (double) (((float) boundingClientRect.left) / f));
        javaOnlyMap.putDouble("top", (double) (((float) boundingClientRect.top) / f));
        javaOnlyMap.putDouble("right", (double) (((float) boundingClientRect.right) / f));
        javaOnlyMap.putDouble("bottom", (double) (((float) boundingClientRect.bottom) / f));
        javaOnlyMap.putDouble("width", (double) (((float) boundingClientRect.width()) / f));
        javaOnlyMap.putDouble(C4065QhC.LJFF, (double) (((float) boundingClientRect.height()) / f));
        return javaOnlyMap;
    }

    public Rect getRect() {
        float originLeft = ((float) getOriginLeft()) + (((float) getWidth()) / 2.0f);
        float originTop = ((float) getOriginTop()) + (((float) getHeight()) / 2.0f);
        float width = ((float) getWidth()) * getScaleX();
        float height = ((float) getHeight()) * getScaleY();
        float translationX = (originLeft - (width / 2.0f)) + getTranslationX();
        float translationY = (originTop - (height / 2.0f)) + getTranslationY();
        return new Rect((int) translationX, (int) translationY, (int) (translationX + width), (int) (translationY + height));
    }

    public void onPropsUpdated() {
        C4398QmZ qmZ = this.mContext;
        if (qmZ != null) {
            if (qmZ.LJIJJLI == null) {
                LLog.LIZ(6, "LynxContext", "addUIToExposuredMap failed, since mExposure is null");
            } else {
                C4385QmM qmM = qmZ.LJIJJLI;
                if (this.mExposureID != null) {
                    qmM.LIZ.put(this.mExposureScene + "_" + this.mExposureID, new WeakReference(this));
                    if (qmM.LIZ.size() == 1) {
                        ViewTreeObserver LIZLLL = qmM.LIZLLL();
                        if (LIZLLL == null) {
                            LLog.LIZLLL("Lynx.UIExposure", "UIExposure add listenners failed since observer is null");
                        }
                        qmM.LIZJ = new C4381QmI(qmM);
                        qmM.LIZLLL = new C4382QmJ(qmM);
                        qmM.LJ = new C4383QmK(qmM);
                        LIZLLL.addOnGlobalLayoutListener(qmM.LIZJ);
                        LIZLLL.addOnScrollChangedListener(qmM.LIZLLL);
                        LIZLLL.addOnDrawListener(qmM.LJ);
                    }
                }
            }
        }
        invalidate();
    }

    public Rect getBoundingClientRect() {
        int i;
        ViewGroup viewGroup = this.mContext.LJIIIIZZ.LIZ;
        int i2 = 0;
        if (viewGroup == null) {
            return new Rect(0, 0, getWidth() + 0, getHeight() + 0);
        }
        if (this instanceof LynxUI) {
            T t = ((LynxUI) this).mView;
            if (t instanceof C4352Qlp) {
                C4352Qlp qlp = (C4352Qlp) t;
                if (qlp.getChildCount() > 0) {
                    t = qlp.getChildAt(0);
                }
            }
            Rect rect = new Rect();
            View rootView = t.getRootView();
            if (viewGroup.getRootView() != rootView && (rootView instanceof ViewGroup)) {
                viewGroup = (ViewGroup) rootView;
            }
            try {
                viewGroup.offsetDescendantRectToMyCoords(t, rect);
                rect.offset(t.getScrollX(), t.getScrollY());
            } catch (IllegalArgumentException unused) {
            }
            int[] offsetDescendantRectToLynxView = getOffsetDescendantRectToLynxView();
            if (offsetDescendantRectToLynxView[0] != Integer.MIN_VALUE) {
                rect.offset(offsetDescendantRectToLynxView[0], offsetDescendantRectToLynxView[1]);
            }
            i = rect.top;
            i2 = rect.left;
        } else if (this instanceof LynxFlattenUI) {
            C4471Qnk qnk = this.mParent;
            if (qnk == null || qnk == this.mContext.LJIIIIZZ) {
                i2 = this.mLeft;
                i = this.mTop;
            } else {
                i = 0;
                LynxBaseUI lynxBaseUI = this;
                while ((lynxBaseUI instanceof LynxFlattenUI) && lynxBaseUI != this.mContext.LJIIIIZZ) {
                    i2 += lynxBaseUI.getOriginLeft();
                    i += lynxBaseUI.getOriginTop();
                    lynxBaseUI = lynxBaseUI.getParentBaseUI();
                }
                if (lynxBaseUI != null) {
                    Rect boundingClientRect = lynxBaseUI.getBoundingClientRect();
                    i2 += boundingClientRect.left - lynxBaseUI.getScrollX();
                    i += boundingClientRect.top - lynxBaseUI.getScrollY();
                }
            }
        } else {
            i = 0;
        }
        return new Rect(i2, i, getWidth() + i2, getHeight() + i);
    }

    @QNL(LIZ = "block-native-event", LJFF = false)
    public void setBlockNativeEvent(boolean z) {
        this.mBlockNativeEvent = z;
    }

    public void setBorderColor(Integer num) {
        setBorderColorForAllSpacingIndex(num);
    }

    public void setBound(Rect rect) {
        this.mBound = rect;
    }

    @QNL(LIZ = "position", LIZLLL = 1.0f)
    public final void setCSSPosition(int i) {
        this.mCSSPosition = i;
    }

    @QNL(LIZ = "dataset")
    public void setDataset(ReadableMap readableMap) {
        this.mDataset = readableMap;
    }

    @QNL(LIZ = "enable-scroll-monitor")
    public void setEnableScrollMonitor(boolean z) {
        this.mEnableScrollMonitor = z;
    }

    public void setEvents(Map<String, LC0> map) {
        this.mEvents = map;
    }

    @QNL(LIZ = "idSelector")
    public void setIdSelector(String str) {
        this.mIdSelector = str;
    }

    @QNL(LIZ = "direction", LJ = 3)
    public void setLynxDirection(int i) {
        this.mLynxDirection = i;
    }

    @QNL(LIZ = "name")
    public void setName(String str) {
        this.mName = str;
    }

    @QNL(LIZ = "perspective")
    public void setPerspective(ReadableArray readableArray) {
        this.mPerspective = readableArray;
    }

    @QNL(LIZ = "react-ref")
    public void setRefIdSelector(String str) {
        this.mRefId = str;
    }

    @QNL(LIZ = "scroll-monitor-tag")
    public void setScrollMonitorTag(String str) {
        this.mScrollMonitorTag = str;
    }

    @QNL(LIZ = "lynx-test-tag")
    public void setTestID(String str) {
        this.mTestTagName = str;
    }

    @QNL(LIZ = "user-interaction-enabled", LJFF = true)
    public void setUserInteractionEnabled(boolean z) {
        this.userInteractionEnabled = z;
    }

    public void updateAttributes(QNZ qnz) {
        updateProperties(qnz);
    }

    public class Sticky extends RectF {
        public float LIZ;
        public float LIZIZ;

        static {
            Covode.recordClassIndex(46606);
        }

        public Sticky() {
        }
    }

    public LynxBaseUI(C4398QmZ qmZ) {
        this(qmZ, (Object) null);
    }

    public void afterPropsUpdated(QNZ qnz) {
        onPropsUpdated();
        onAnimationUpdated();
    }

    public int getIndex(LynxBaseUI lynxBaseUI) {
        return this.mChildren.indexOf(lynxBaseUI);
    }

    public void setAttributes(QNZ qnz) {
        updateAttributes(qnz);
        onPropsUpdated();
    }

    public void setBorderColor(String str) {
        new RuntimeException("setBorderColor(String) is deprecated.This has no effect.");
    }

    @QNL(LIZ = "exposure-scene")
    public void setExposureScene(String str) {
        this.mContext.LIZIZ(this);
        this.mExposureScene = str;
    }

    public void setHeight(int i) {
        this.mHeight = i;
        onLayoutUpdated();
    }

    public void setLeft(int i) {
        this.mLeft = i;
        this.mOriginLeft = i;
        onLayoutUpdated();
    }

    public void setOffsetDescendantRectToLynxView(int[] iArr) {
        this.mOffsetDescendantRectToLynxView = new WeakReference<>(iArr);
    }

    public void setOverflow(int i) {
        setOverflowWithMask(3, i);
    }

    public void setTop(int i) {
        this.mTop = i;
        this.mOriginTop = i;
        onLayoutUpdated();
    }

    public void setWidth(int i) {
        this.mWidth = i;
        onLayoutUpdated();
    }

    public final void updateProperties(QNZ qnz) {
        updatePropertiesInterval(qnz);
        afterPropsUpdated(qnz);
    }

    public LynxBaseUI(Context context) {
        this((C4398QmZ) context);
    }

    public LynxBaseUI getChildAt(int i) {
        return this.mChildren.get(i);
    }

    public void removeChild(LynxBaseUI lynxBaseUI) {
        this.mChildren.remove(lynxBaseUI);
        lynxBaseUI.setParent((C4471Qnk) null);
    }

    @QNL(LIZ = "box-shadow")
    public void setBoxShadow(ReadableArray readableArray) {
        C4471Qnk qnk = this.mParent;
        if (qnk instanceof UIShadowProxy) {
            ((LynxBaseUI) qnk).setBoxShadow(readableArray);
        }
    }

    @QNL(LIZ = "focusable")
    public void setFocusable(Boolean bool) {
        boolean z;
        if (bool != null) {
            z = bool.booleanValue();
        } else {
            z = false;
        }
        this.mFocusable = z;
    }

    @QNL(LIZ = "font-size", LIZLLL = 1.0E21f)
    public void setFontSize(float f) {
        if (f != 1.0E21f) {
            this.mFontSize = f;
            this.mLynxBackground.LJI = f;
        }
    }

    @QNL(LIZ = "ignore-focus")
    public void setIgnoreFocus(Boolean bool) {
        boolean z;
        if (bool != null) {
            z = bool.booleanValue();
        } else {
            z = false;
        }
        this.mIgnoreFocus = z;
    }

    @QNL(LIZ = "outline-color", LJ = -16777216)
    public void setOutlineColor(int i) {
        C4471Qnk qnk = this.mParent;
        if (qnk instanceof UIShadowProxy) {
            ((LynxBaseUI) qnk).setOutlineColor(i);
        }
    }

    @QNL(LIZ = "outline-width", LJ = 0)
    public void setOutlineWidth(float f) {
        C4471Qnk qnk = this.mParent;
        if (qnk instanceof UIShadowProxy) {
            ((LynxBaseUI) qnk).setOutlineWidth(f);
        }
    }

    @QNL(LIZ = "overflow")
    public void setOverflow(Integer num) {
        int intValue;
        if (num == null) {
            intValue = getInitialOverflowType();
        } else {
            intValue = num.intValue();
        }
        setOverflow(intValue);
    }

    public void setOverflowFiber(int i) {
        this.mOverflow = i;
        C4471Qnk qnk = this.mParent;
        if (qnk instanceof UIShadowProxy) {
            ((LynxBaseUI) qnk).setOverflowFiber(i);
        }
    }

    @QNL(LIZ = "overflow-x")
    public void setOverflowX(Integer num) {
        int intValue;
        if (num == null) {
            intValue = getInitialOverflowType();
        } else {
            intValue = num.intValue();
        }
        setOverflowWithMask(1, intValue);
    }

    @QNL(LIZ = "overflow-y")
    public void setOverflowY(Integer num) {
        int intValue;
        if (num == null) {
            intValue = getInitialOverflowType();
        } else {
            intValue = num.intValue();
        }
        setOverflowWithMask(2, intValue);
    }

    private float toPix(String str) {
        UIBody uIBody = this.mContext.LJIIIIZZ;
        return QNX.LIZ(str, uIBody.mFontSize, this.mFontSize, (float) uIBody.getWidth(), (float) uIBody.getHeight(), 1.0E21f, this.mContext.LJIILIIL);
    }

    @QNL(LIZ = "bitmap-gradient")
    public void setEnableBitmapGradient(boolean z) {
        BackgroundDrawable LIZJ = this.mLynxBackground.LIZJ();
        LIZJ.LJFF.LJIIIZ = z;
        LIZJ.invalidateSelf();
        invalidate();
    }

    @QNL(LIZ = "outline-style", LJ = -1)
    public void setOutlineStyle(int i) {
        C4471Qnk qnk = this.mParent;
        if (qnk instanceof UIShadowProxy) {
            ((UIShadowProxy) qnk).LIZ().LIZ = C4367Qm4.parse(i);
        }
    }

    public void setTransform(ReadableArray readableArray) {
        this.hasTransformChanged = true;
        this.mTransformRaw = C4368Qm5.LIZ(readableArray);
        C4471Qnk qnk = this.mParent;
        if (qnk instanceof UIShadowProxy) {
            ((UIShadowProxy) qnk).LIZIZ();
        }
    }

    private void setBorderColorForAllSpacingIndex(Integer num) {
        float intValue;
        float f = 1.0E21f;
        if (num == null) {
            intValue = 1.0E21f;
        } else {
            intValue = (float) (num.intValue() & 16777215);
            f = (float) (num.intValue() >>> 24);
        }
        int i = 1;
        do {
            this.mLynxBackground.LIZ(SPACING_TYPES[i], intValue, f);
            i++;
        } while (i <= 4);
    }

    public void copyPropFromOldUiInUpdateFlatten(LynxBaseUI lynxBaseUI) {
        this.mIsFirstAnimatedReady = lynxBaseUI.mIsFirstAnimatedReady;
        this.mLastSize.set(lynxBaseUI.mLastSize.x, lynxBaseUI.mLastSize.y);
        this.mLatestSize.set(lynxBaseUI.mLatestSize.x, lynxBaseUI.mLatestSize.y);
        this.mFlattenChildrenCount = lynxBaseUI.mFlattenChildrenCount;
        setEvents(lynxBaseUI.getEvents());
    }

    public void notifyScrollStateChanged(int i) {
        C4479Qns[] qnsArr;
        if (this.mStateChangeListeners != null) {
            synchronized (this) {
                qnsArr = (C4479Qns[]) this.mStateChangeListeners.toArray(new C4479Qns[this.mStateChangeListeners.size()]);
            }
            for (C4479Qns LIZ : qnsArr) {
                LIZ.LIZ(i);
            }
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:12:0x0020, code lost:
        initScrollStateChangeListener();
        r1 = r2.mParent;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:13:0x0027, code lost:
        if ((r1 instanceof com.lynx.tasm.behavior.ui.LynxBaseUI) == false) goto L_?;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:14:0x0029, code lost:
        ((com.lynx.tasm.behavior.ui.LynxBaseUI) r1).registerScrollStateListener(r2.mScrollStateChangeListener);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:18:?, code lost:
        return;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:19:?, code lost:
        return;
     */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public void registerScrollStateListener(X.C4479Qns r3) {
        /*
            r2 = this;
            if (r3 != 0) goto L_0x0003
            return
        L_0x0003:
            monitor-enter(r2)
            java.util.Set<X.Qns> r0 = r2.mStateChangeListeners     // Catch:{ all -> 0x0031 }
            if (r0 != 0) goto L_0x000f
            java.util.HashSet r0 = new java.util.HashSet     // Catch:{ all -> 0x0031 }
            r0.<init>()     // Catch:{ all -> 0x0031 }
            r2.mStateChangeListeners = r0     // Catch:{ all -> 0x0031 }
        L_0x000f:
            java.util.Set<X.Qns> r0 = r2.mStateChangeListeners     // Catch:{ all -> 0x0031 }
            r0.add(r3)     // Catch:{ all -> 0x0031 }
            java.util.Set<X.Qns> r0 = r2.mStateChangeListeners     // Catch:{ all -> 0x0031 }
            int r1 = r0.size()     // Catch:{ all -> 0x0031 }
            r0 = 1
            if (r1 == r0) goto L_0x001f
            monitor-exit(r2)     // Catch:{ all -> 0x0031 }
            return
        L_0x001f:
            monitor-exit(r2)
            r2.initScrollStateChangeListener()
            X.Qnk r1 = r2.mParent
            boolean r0 = r1 instanceof com.lynx.tasm.behavior.ui.LynxBaseUI
            if (r0 == 0) goto L_0x0030
            com.lynx.tasm.behavior.ui.LynxBaseUI r1 = (com.lynx.tasm.behavior.ui.LynxBaseUI) r1
            X.Qns r0 = r2.mScrollStateChangeListener
            r1.registerScrollStateListener(r0)
        L_0x0030:
            return
        L_0x0031:
            r0 = move-exception
            monitor-exit(r2)
            throw r0
        */
        throw new UnsupportedOperationException("Method not decompiled: com.lynx.tasm.behavior.ui.LynxBaseUI.registerScrollStateListener(X.Qns):void");
    }

    @QNL(LIZ = "accessibility-element")
    public void setAccessibilityElement(LC5 lc5) {
        boolean z = true;
        if (lc5 != null) {
            ReadableType LJIIIIZZ = lc5.LJIIIIZZ();
            if (LJIIIIZZ == ReadableType.String) {
                z = Boolean.parseBoolean(lc5.LJFF());
            } else if (LJIIIIZZ == ReadableType.Int || LJIIIIZZ == ReadableType.Number || LJIIIIZZ == ReadableType.Long) {
                if (lc5.LIZLLL() == 0) {
                    z = false;
                }
            } else if (LJIIIIZZ == ReadableType.Boolean) {
                z = lc5.LIZIZ();
            }
        }
        this.mAccessibilityElementStatus = z ? 1 : 0;
    }

    @QNL(LIZ = "accessibility-label")
    public void setAccessibilityLabel(LC5 lc5) {
        String str;
        if (lc5 != null) {
            ReadableType LJIIIIZZ = lc5.LJIIIIZZ();
            if (LJIIIIZZ == ReadableType.String) {
                str = lc5.LJFF();
            } else if (LJIIIIZZ == ReadableType.Int || LJIIIIZZ == ReadableType.Number || LJIIIIZZ == ReadableType.Long) {
                str = String.valueOf(lc5.LIZLLL());
            } else if (LJIIIIZZ == ReadableType.Boolean) {
                str = String.valueOf(lc5.LIZIZ());
            }
            this.mAccessibilityLabel = str;
        }
        str = Q39.LIZJ;
        this.mAccessibilityLabel = str;
    }

    @QNL(LIZ = "background-clip")
    public void setBackgroundClip(ReadableArray readableArray) {
        BackgroundDrawable LIZJ = this.mLynxBackground.LIZJ();
        C4353Qlq qlq = LIZJ.LJFF;
        qlq.LIZLLL.clear();
        if (readableArray != null) {
            int size = readableArray.size();
            for (int i = 0; i < size; i++) {
                int i2 = readableArray.getInt(i);
                if (i2 < 0 || i2 > 2) {
                    qlq.LIZLLL.add(1);
                } else {
                    qlq.LIZLLL.add(Integer.valueOf(i2));
                }
            }
        }
        LIZJ.invalidateSelf();
    }

    @QNL(LIZ = "background-color", LJ = 0)
    public void setBackgroundColor(int i) {
        this.mBackgroundColor = i;
        if (getKeyframeManager() != null) {
            getKeyframeManager().LIZ("BackgroundColor", Integer.valueOf(i));
        }
        if (getTransitionAnimator() == null || !getTransitionAnimator().LIZ(64)) {
            this.mLynxBackground.LIZ(i);
            invalidate();
            return;
        }
        getTransitionAnimator().LIZ(this, 64, Integer.valueOf(i));
    }

    @QNL(LIZ = "background-origin")
    public void setBackgroundOrigin(ReadableArray readableArray) {
        BackgroundDrawable LIZJ = this.mLynxBackground.LIZJ();
        C4353Qlq qlq = LIZJ.LJFF;
        qlq.LIZJ.clear();
        if (readableArray != null) {
            int size = readableArray.size();
            for (int i = 0; i < size; i++) {
                int i2 = readableArray.getInt(i);
                if (i2 < 0 || i2 > 2) {
                    i2 = 1;
                }
                qlq.LIZJ.add(Integer.valueOf(i2));
            }
        }
        LIZJ.invalidateSelf();
        invalidate();
    }

    @QNL(LIZ = "background-position")
    public void setBackgroundPosition(ReadableArray readableArray) {
        BackgroundDrawable LIZJ = this.mLynxBackground.LIZJ();
        C4353Qlq qlq = LIZJ.LJFF;
        qlq.LIZIZ.clear();
        if (readableArray != null && readableArray.size() % 2 == 0) {
            for (int i = 0; i < readableArray.size(); i += 2) {
                qlq.LIZIZ.add(new C4356Qlt(readableArray.getDouble(i), readableArray.getInt(i + 1)));
            }
        }
        LIZJ.invalidateSelf();
        invalidate();
    }

    @QNL(LIZ = "background-repeat")
    public void setBackgroundRepeat(ReadableArray readableArray) {
        BackgroundDrawable LIZJ = this.mLynxBackground.LIZJ();
        C4353Qlq qlq = LIZJ.LJFF;
        qlq.LJ.clear();
        if (readableArray != null) {
            int size = readableArray.size();
            for (int i = 0; i < size; i++) {
                qlq.LJ.add(C4354Qlr.valueOf(readableArray.getInt(i)));
            }
        }
        LIZJ.invalidateSelf();
        invalidate();
    }

    @QNL(LIZ = "background-size")
    public void setBackgroundSize(ReadableArray readableArray) {
        BackgroundDrawable LIZJ = this.mLynxBackground.LIZJ();
        C4353Qlq qlq = LIZJ.LJFF;
        qlq.LJFF.clear();
        if (readableArray != null && readableArray.size() % 2 == 0) {
            int size = readableArray.size();
            for (int i = 0; i < size; i += 2) {
                qlq.LJFF.add(new C4355Qls(readableArray.getDouble(i), readableArray.getInt(i + 1)));
            }
        }
        LIZJ.invalidateSelf();
        invalidate();
    }

    @QNL(LIZ = "clip-radius")
    public void setClipToRadius(LC5 lc5) {
        boolean z;
        if (lc5 != null) {
            ReadableType LJIIIIZZ = lc5.LJIIIIZZ();
            if (LJIIIIZZ == ReadableType.Boolean) {
                z = lc5.LIZIZ();
            } else if (LJIIIIZZ == ReadableType.String) {
                String LJFF = lc5.LJFF();
                if (LJFF.equalsIgnoreCase("true") || LJFF.equalsIgnoreCase("yes")) {
                    z = true;
                } else {
                    z = false;
                }
            } else {
                return;
            }
            this.mClipToRadius = z;
        }
    }

    @QNL(LIZ = "intersection-observers")
    public void setIntersectionObservers(ReadableArray readableArray) {
        this.mContext.LIZJ().LIZ(this);
        if (readableArray != null && this.mEvents.containsKey("intersection")) {
            for (int i = 0; i < readableArray.size(); i++) {
                ReadableMap map = readableArray.getMap(i);
                if (map != null) {
                    this.mContext.LIZJ().LIZ(new C4495Qo8(this.mContext.LIZJ(), map, this));
                }
            }
        }
    }

    @QNL(LIZ = "transform-origin")
    public void setTransformOrigin(ReadableArray readableArray) {
        C4387QmO qmO;
        this.hasTransformChanged = true;
        this.mTransformOrigin = C4387QmO.LIZJ;
        if (readableArray != null) {
            if (readableArray.size() < 2) {
                qmO = null;
            } else {
                qmO = new C4387QmO(readableArray);
            }
            this.mTransformOrigin = qmO;
            if (qmO == null) {
                LLog.LIZ(6, "LynxBaseUI", "transform params error.");
                this.mTransformOrigin = C4387QmO.LIZJ;
            }
        }
    }

    public void unRegisterScrollStateListener(C4479Qns qns) {
        boolean isEmpty;
        if (qns != null && this.mStateChangeListeners != null) {
            synchronized (this) {
                this.mStateChangeListeners.remove(qns);
                isEmpty = this.mStateChangeListeners.isEmpty();
            }
            if (isEmpty) {
                C4471Qnk qnk = this.mParent;
                if (qnk instanceof LynxBaseUI) {
                    ((LynxBaseUI) qnk).unRegisterScrollStateListener(this.mScrollStateChangeListener);
                }
            }
        }
    }

    public void updateSticky(float[] fArr) {
        if (fArr == null || fArr.length < 4) {
            this.mSticky = null;
            return;
        }
        Sticky sticky = new Sticky();
        this.mSticky = sticky;
        sticky.left = fArr[0];
        this.mSticky.top = fArr[1];
        this.mSticky.right = fArr[2];
        this.mSticky.bottom = fArr[3];
        Sticky sticky2 = this.mSticky;
        sticky2.LIZIZ = 0.0f;
        sticky2.LIZ = 0.0f;
        LynxBaseUI parentBaseUI = getParentBaseUI();
        if (parentBaseUI instanceof C4480Qnt) {
            ((C4480Qnt) parentBaseUI).LIZ();
        }
    }

    @7tl
    public void scrollIntoView(ReadableMap readableMap) {
        HashMap hashMap;
        String str;
        String str2;
        String str3;
        if (readableMap != null && (hashMap = (HashMap) readableMap.toHashMap().get("scrollIntoViewOptions")) != null) {
            if (hashMap.containsKey("behavior")) {
                str = (String) hashMap.get("behavior");
            } else {
                str = "auto";
            }
            if (hashMap.containsKey("block")) {
                str2 = (String) hashMap.get("block");
            } else {
                str2 = "start";
            }
            if (hashMap.containsKey("inline")) {
                str3 = (String) hashMap.get("inline");
            } else {
                str3 = "nearest";
            }
            LynxBaseUI lynxBaseUI = this;
            while (true) {
                C4471Qnk qnk = lynxBaseUI.mParent;
                if (qnk != null && (qnk instanceof LynxBaseUI)) {
                    if (lynxBaseUI instanceof AbsLynxUIScroll) {
                        ((AbsLynxUIScroll) lynxBaseUI).LIZ(this, str.equals("smooth"), str2, str3);
                        return;
                    }
                    lynxBaseUI = (LynxBaseUI) qnk;
                } else {
                    return;
                }
            }
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:17:0x0042  */
    /* JADX WARNING: Removed duplicated region for block: B:7:0x0019  */
    @X.QNL(LIZ = "exposure-id")
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public void setExposureID(X.LC5 r4) {
        /*
            r3 = this;
            X.QmZ r0 = r3.mContext
            r0.LIZIZ((com.lynx.tasm.behavior.ui.LynxBaseUI) r3)
            if (r4 == 0) goto L_0x003f
            com.lynx.react.bridge.ReadableType r1 = r4.LJIIIIZZ()
            com.lynx.react.bridge.ReadableType r0 = com.lynx.react.bridge.ReadableType.String
            if (r1 != r0) goto L_0x002a
            java.lang.String r1 = r4.LJFF()
        L_0x0013:
            boolean r0 = r1.isEmpty()
            if (r0 == 0) goto L_0x0042
            r0 = 0
            r3.mExposureID = r0
            java.lang.String r2 = "setExposureID(Dynamic exposureID) failed, since it is not number/string, or it is empty string"
            r1 = 6
            java.lang.String r0 = "LynxBaseUI"
            com.lynx.tasm.base.LLog.LIZ(r1, r0, r2)
            java.lang.RuntimeException r0 = new java.lang.RuntimeException
            r0.<init>(r2)
            return
        L_0x002a:
            com.lynx.react.bridge.ReadableType r0 = com.lynx.react.bridge.ReadableType.Int
            if (r1 == r0) goto L_0x0036
            com.lynx.react.bridge.ReadableType r0 = com.lynx.react.bridge.ReadableType.Number
            if (r1 == r0) goto L_0x0036
            com.lynx.react.bridge.ReadableType r0 = com.lynx.react.bridge.ReadableType.Long
            if (r1 != r0) goto L_0x003f
        L_0x0036:
            int r0 = r4.LIZLLL()
            java.lang.String r1 = java.lang.String.valueOf(r0)
            goto L_0x0013
        L_0x003f:
            java.lang.String r1 = ""
            goto L_0x0013
        L_0x0042:
            r3.mExposureID = r1
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.lynx.tasm.behavior.ui.LynxBaseUI.setExposureID(X.LC5):void");
    }

    public void setParent(C4471Qnk qnk) {
        C4479Qns[] qnsArr;
        C4479Qns[] qnsArr2;
        if (this.mStateChangeListeners == null) {
            this.mParent = qnk;
            return;
        }
        int i = 0;
        if (qnk instanceof LynxBaseUI) {
            synchronized (this) {
                qnsArr2 = (C4479Qns[]) this.mStateChangeListeners.toArray(new C4479Qns[this.mStateChangeListeners.size()]);
            }
            int length = qnsArr2.length;
            while (i < length) {
                ((LynxBaseUI) qnk).registerScrollStateListener(qnsArr2[i]);
                i++;
            }
        } else if (this.mParent instanceof LynxBaseUI) {
            synchronized (this) {
                qnsArr = (C4479Qns[]) this.mStateChangeListeners.toArray(new C4479Qns[this.mStateChangeListeners.size()]);
            }
            int length2 = qnsArr.length;
            while (i < length2) {
                ((LynxBaseUI) this.mParent).unRegisterScrollStateListener(qnsArr[i]);
                i++;
            }
        }
        this.mParent = qnk;
    }

    public void updateLayoutInfo(LynxBaseUI lynxBaseUI) {
        LynxBaseUI lynxBaseUI2 = lynxBaseUI;
        int left = lynxBaseUI2.getLeft();
        int top = lynxBaseUI2.getTop();
        int width = lynxBaseUI2.getWidth();
        int height = lynxBaseUI2.getHeight();
        int i = lynxBaseUI2.mPaddingLeft;
        int i2 = lynxBaseUI2.mPaddingTop;
        int i3 = lynxBaseUI2.mPaddingRight;
        int i4 = lynxBaseUI2.mPaddingBottom;
        int i5 = lynxBaseUI2.mMarginLeft;
        int i6 = lynxBaseUI2.mMarginTop;
        int i7 = lynxBaseUI2.mMarginRight;
        int i8 = lynxBaseUI2.mMarginBottom;
        int i9 = lynxBaseUI2.mBorderLeftWidth;
        int i10 = lynxBaseUI2.mBorderTopWidth;
        LynxBaseUI lynxBaseUI3 = lynxBaseUI2;
        int i11 = lynxBaseUI3.mBorderRightWidth;
        int i12 = i9;
        int i13 = i10;
        int i14 = i7;
        int i15 = i8;
        int i16 = i5;
        int i17 = i6;
        int i18 = i3;
        int i19 = i4;
        int i20 = i;
        int i21 = i2;
        updateLayoutInfo(left, top, width, height, i20, i21, i18, i19, i16, i17, i14, i15, i12, i13, i11, lynxBaseUI3.mBorderBottomWidth, lynxBaseUI2.getBound());
        this.mOriginLeft = lynxBaseUI2.getOriginLeft();
        this.mOriginTop = lynxBaseUI2.getOriginTop();
    }

    @QNL(LIZ = "background-image")
    public void setBackgroundImage(ReadableArray readableArray) {
        BackgroundDrawable LIZJ = this.mLynxBackground.LIZJ();
        C4353Qlq qlq = LIZJ.LJFF;
        qlq.LIZ.clear();
        if (readableArray != null) {
            Rect bounds = qlq.LJII.getBounds();
            int size = readableArray.size();
            int i = 0;
            while (i < size) {
                int i2 = readableArray.getInt(i);
                if (i2 == 1) {
                    i++;
                    if (LynxEnv.LIZJ().LJIILLIIL != null) {
                        C4201QjO LIZ = LynxEnv.LIZJ().LJIILLIIL.LIZ(qlq.LJI, readableArray.getString(i));
                        LIZ.setCallback(qlq);
                        qlq.LIZ.add(LIZ);
                    } else {
                        i++;
                    }
                } else if (i2 == 2) {
                    i++;
                    qlq.LIZ.add(new C3283QNc(readableArray.getArray(i)));
                } else if (i2 == 3) {
                    i++;
                    qlq.LIZ.add(new C3281QNa(readableArray.getArray(i)));
                } else if (i2 == 0) {
                    i++;
                    qlq.LIZ.add(new QWH());
                }
                if (!bounds.isEmpty()) {
                    qlq.LIZ.get(qlq.LIZ.size() - 1).LIZ(bounds.width(), bounds.height());
                }
                i++;
            }
        }
        LIZJ.invalidateSelf();
        invalidate();
    }

    @QNL(LIZ = "image-config")
    public void setImageConfig(String str) {
        if (str == null || str.equalsIgnoreCase(Q39.LIZJ)) {
            this.mBitmapConfig = null;
            return;
        }
        if (str.equalsIgnoreCase("ALPHA_8")) {
            this.mBitmapConfig = Bitmap.Config.ALPHA_8;
        } else {
            if (str.equalsIgnoreCase("RGB_565")) {
                if (!isImageConfigBadCase()) {
                    this.mBitmapConfig = Bitmap.Config.RGB_565;
                } else {
                    LLog.LIZ(5, "LynxBaseUI setImageConfig warn: ", "RGB_565 can't be set on Meizu15");
                }
            } else if (str.equalsIgnoreCase("ARGB_8888")) {
                this.mBitmapConfig = Bitmap.Config.ARGB_8888;
            } else if (str.equalsIgnoreCase("RGBA_F16")) {
                if (Build.VERSION.SDK_INT >= 26) {
                    this.mBitmapConfig = Bitmap.Config.RGBA_F16;
                } else {
                    LLog.LIZ(5, "LynxBaseUI setImageConfig warn: ", "RGBA_F16 requires build version >= VERSION_CODES.O");
                }
            } else if (str.equalsIgnoreCase("HARDWARE")) {
                if (Build.VERSION.SDK_INT >= 26) {
                    this.mBitmapConfig = Bitmap.Config.HARDWARE;
                } else {
                    this.mBitmapConfig = null;
                    LLog.LIZ(5, "LynxBaseUI setImageConfig warn: ", "HARDWARE requires build version >= VERSION_CODES.O");
                }
            }
            this.mBitmapConfig = null;
        }
        C4369Qm6 qm6 = this.mLynxBackground;
        if (qm6 != null) {
            Bitmap.Config config = this.mBitmapConfig;
            BackgroundDrawable LIZJ = qm6.LIZJ();
            if (LIZJ.LJFF != null) {
                C4353Qlq qlq = LIZJ.LJFF;
                qlq.LJIIIIZZ = config;
                if (qlq.LIZ != null) {
                    for (C4201QjO next : qlq.LIZ) {
                        if (next != null) {
                            next.LIZ(qlq.LJIIIIZZ);
                        }
                    }
                }
                LIZJ.invalidateSelf();
            }
        }
    }

    public void updatePropertiesInterval(QNZ qnz) {
        this.mProps.merge(qnz.LIZ);
        Class<?> cls = getClass();
        LynxUISetter lynxUISetter = PropsUpdater.LIZ.get(cls);
        if (lynxUISetter == null) {
            lynxUISetter = (LynxUISetter) PropsUpdater.LIZ(cls);
            if (lynxUISetter == null) {
                String str = "PropsSetter not generated for class: " + cls.getName() + ". You should add module lynxProcessor";
                if (!LynxEnv.LIZJ().LJIJI || !LynxEnv.LIZJ().LJ()) {
                    LLog.LIZLLL("PropsUpdater", str);
                    lynxUISetter = new PropsUpdater.FallbackLynxUISetter(cls, (byte) 0);
                } else {
                    throw new IllegalStateException(str);
                }
            }
            PropsUpdater.LIZ.put(cls, lynxUISetter);
        }
        ReadableMapKeySetIterator keySetIterator = qnz.LIZ.keySetIterator();
        while (keySetIterator.hasNextKey()) {
            String nextKey = keySetIterator.nextKey();
            try {
                lynxUISetter.setProperty(this, nextKey, qnz);
            } catch (Throwable th) {
                RuntimeException runtimeException = new RuntimeException("Error while updating property '" + nextKey + "' in ui " + getTagName() + ": " + th.getMessage(), th);
                runtimeException.setStackTrace(th.getStackTrace());
                this.mContext.LIZ((Exception) runtimeException, 1301, getPlatformCustomInfo());
            }
        }
    }

    public void setBorderRadius(int i, String str) {
        new RuntimeException("setBorderWidth(int, String) is deprecated.This has no effect.");
    }

    public void setBorderWidth(int i, String str) {
        new RuntimeException("setBorderWidth(int, String) is deprecated.This has no effect.");
    }

    public void setSign(int i, String str) {
        this.mSign = i;
        this.mTagName = str;
    }

    public void insertChild(LynxBaseUI lynxBaseUI, int i) {
        this.mChildren.add(i, lynxBaseUI);
        lynxBaseUI.setParent(this);
    }

    @QNK(LIZ = {"border-left-color", "border-right-color", "border-top-color", "border-bottom-color"}, LIZIZ = "Color")
    public void setBorderColor(int i, Integer num) {
        setBorderColorForSpacingIndex(SPACING_TYPES[i + 1], num);
    }

    public final void updateLayoutSize(int i, int i2) {
        this.mLatestSize.x = i;
        this.mLatestSize.y = i2;
    }

    private void setBorderColorForSpacingIndex(int i, Integer num) {
        float intValue;
        float f = 1.0E21f;
        if (num == null) {
            intValue = 1.0E21f;
        } else {
            intValue = (float) (num.intValue() & 16777215);
            f = (float) (num.intValue() >>> 24);
        }
        this.mLynxBackground.LIZ(i, intValue, f);
    }

    @7tl
    public void boundingClientRect(ReadableMap readableMap, Callback callback) {
        callback.invoke(new Object[]{0, getPositionInfo()});
    }

    public void setOverflowWithMask(short s, int i) {
        short s2;
        int i2 = this.mOverflow;
        if (i == 0) {
            s2 = i2 | s;
        } else {
            s2 = i2 & (~s);
        }
        this.mOverflow = s2;
        C4471Qnk qnk = this.mParent;
        if (qnk instanceof UIShadowProxy) {
            ((LynxBaseUI) qnk).setOverflowWithMask(s, i);
        }
        requestLayout();
    }

    public void setBorderRadius(int i, float f) {
        if (!C3948QfJ.LIZ(f) && f < 0.0f) {
            f = 1.0E21f;
        }
        C4378QmF qmF = new C4378QmF();
        qmF.LIZ = f;
        qmF.LIZIZ = f;
        qmF.LIZJ = MNo.NUMBER;
        qmF.LIZLLL = MNo.NUMBER;
        if (i == 0) {
            int i2 = 1;
            do {
                this.mLynxBackground.LIZ(i2, qmF);
                i2++;
            } while (i2 < 5);
        } else {
            this.mLynxBackground.LIZ(i, qmF);
        }
        onBorderRadiusUpdated(i);
    }

    @QNK(LIZ = {"border-style", "border-left-style", "border-right-style", "border-top-style", "border-bottom-style"}, LJ = -1)
    public void setBorderStyle(int i, int i2) {
        C4369Qm6 qm6 = this.mLynxBackground;
        int i3 = SPACING_TYPES[i];
        BackgroundDrawable LIZJ = qm6.LIZJ();
        if (i3 <= 8 && i3 >= 0) {
            if (LIZJ.LIZIZ == null) {
                LIZJ.LIZIZ = new C4367Qm4[9];
            }
            try {
                C4367Qm4 parse = C4367Qm4.parse(i2);
                if (LIZJ.LIZIZ[i3] != parse) {
                    LIZJ.LIZIZ[i3] = parse;
                    LIZJ.invalidateSelf();
                }
            } catch (Throwable unused) {
            }
        }
    }

    @QNK(LIZ = {"border-width", "border-left-width", "border-right-width", "border-top-width", "border-bottom-width"})
    public void setBorderWidth(int i, int i2) {
        C4369Qm6 qm6 = this.mLynxBackground;
        int i3 = SPACING_TYPES[i];
        float f = (float) i2;
        BackgroundDrawable LIZJ = qm6.LIZJ();
        if (!QNY.LIZ(LIZJ.LIZ.LIZ[i3], f)) {
            LIZJ.LIZ.LIZ(i3, f);
            LIZJ.LIZLLL = true;
            LIZJ.LIZ();
            LIZJ.invalidateSelf();
        }
    }

    public boolean childrenContainPoint(float f, float f2) {
        float scrollX = ((f + ((float) getScrollX())) - ((float) getOriginLeft())) - getTranslationX();
        float scrollY = ((f2 + ((float) getScrollY())) - ((float) getOriginTop())) - getTranslationY();
        for (LynxBaseUI next : this.mChildren) {
            if (next.isUserInteractionEnabled() && next.containsPoint(scrollX, scrollY)) {
                return true;
            }
        }
        return false;
    }

    public boolean containsPoint(float f, float f2) {
        float touchSlop = getTouchSlop();
        Rect rect = getRect();
        if (((float) rect.left) - touchSlop < f && ((float) rect.right) + touchSlop > f && ((float) rect.top) - touchSlop < f2 && ((float) rect.bottom) + touchSlop > f2) {
            return true;
        }
        if (getOverflow() == 0) {
            return false;
        }
        if (getOverflow() == 1) {
            if (((float) rect.top) - touchSlop >= f2 || ((float) rect.bottom) + touchSlop <= f2) {
                return false;
            }
        } else if (getOverflow() == 2 && (((float) rect.left) - touchSlop >= f || ((float) rect.right) + touchSlop <= f)) {
            return false;
        }
        return childrenContainPoint(f, f2);
    }

    public LynxBaseUI(C4398QmZ qmZ, Object obj) {
        this.mChildren = new ArrayList();
        this.mProps = new JavaOnlyMap();
        this.mDataset = new JavaOnlyMap();
        this.mHasRadius = false;
        this.mOverflow = 0;
        this.mClipToRadius = false;
        this.mFocusable = false;
        this.mIgnoreFocus = false;
        this.mPerspective = null;
        this.hasTransformChanged = false;
        this.userInteractionEnabled = true;
        this.mSticky = null;
        this.mMaxHeight = -1.0f;
        this.mBackgroundColor = 0;
        this.mShouldAttachChildrenView = false;
        this.mExtraOffsetX = 0.0f;
        this.mExtraOffsetY = 0.0f;
        this.mAccessibilityLabel = Q39.LIZJ;
        this.mAccessibilityElementStatus = -1;
        this.mDrawableCallback = new QWR(this, (byte) 0);
        this.mBitmapConfig = null;
        this.mCSSPosition = 1;
        this.mTouchSlop = 8.0f;
        this.mOnResponceChain = false;
        this.mBlockNativeEvent = false;
        this.mFlattenChildrenCount = 0;
        this.mNeedSortChildren = false;
        this.mLastTranslateZ = 0.0f;
        this.mOffsetDescendantRectToLynxView = new WeakReference<>((Object) null);
        this.mIsFirstAnimatedReady = true;
        this.mLynxDirection = 3;
        this.mContext = qmZ;
        this.mParam = obj;
        C4369Qm6 qm6 = new C4369Qm6(qmZ);
        this.mLynxBackground = qm6;
        qm6.LJFF = this.mDrawableCallback;
        float LIZ = C3890QeN.LIZ(14.0f);
        this.mFontSize = LIZ;
        this.mLynxBackground.LJI = LIZ;
        this.mLatestSize = new Point();
        this.mLastSize = new Point();
        initialize();
    }

    public boolean checkStickyOnParentScroll(int i, int i2) {
        if (this.mSticky == null) {
            return false;
        }
        float left = (float) (getLeft() - i);
        float top = (float) (getTop() - i2);
        if (left < this.mSticky.left) {
            Sticky sticky = this.mSticky;
            sticky.LIZ = sticky.left - left;
        } else {
            int width = getParentBaseUI().getWidth();
            float width2 = ((float) getWidth()) + left;
            float f = (float) width;
            if (this.mSticky.right + width2 > f) {
                Sticky sticky2 = this.mSticky;
                sticky2.LIZ = Math.max((f - width2) - sticky2.right, this.mSticky.left - left);
            } else {
                this.mSticky.LIZ = 0.0f;
            }
        }
        if (top < this.mSticky.top) {
            Sticky sticky3 = this.mSticky;
            sticky3.LIZIZ = sticky3.top - top;
            return true;
        }
        int height = getParentBaseUI().getHeight();
        float height2 = ((float) getHeight()) + top;
        float f2 = (float) height;
        if (this.mSticky.bottom + height2 > f2) {
            Sticky sticky4 = this.mSticky;
            sticky4.LIZIZ = Math.max((f2 - height2) - sticky4.bottom, this.mSticky.top - top);
            return true;
        }
        this.mSticky.LIZIZ = 0.0f;
        return true;
    }

    public C4511QoO hitTest(float f, float f2) {
        int size = this.mChildren.size() - 1;
        UIGroup uIGroup = null;
        while (true) {
            if (size >= 0) {
                LynxBaseUI lynxBaseUI = this.mChildren.get(size);
                if (lynxBaseUI instanceof UIShadowProxy) {
                    lynxBaseUI = ((UIShadowProxy) lynxBaseUI).LIZ;
                }
                if (lynxBaseUI.isUserInteractionEnabled() && lynxBaseUI.getVisibility() && lynxBaseUI.containsPoint(f, f2)) {
                    if (lynxBaseUI.isOnResponseChain()) {
                        uIGroup = lynxBaseUI;
                        break;
                    } else if (uIGroup == null || uIGroup.getZIndex() < lynxBaseUI.getZIndex() || (uIGroup.getZIndex() == lynxBaseUI.getZIndex() && uIGroup.getTranslationZ() < lynxBaseUI.getTranslationZ())) {
                        uIGroup = lynxBaseUI;
                    }
                }
                size--;
            } else if (uIGroup == null) {
                return this;
            }
        }
        if (!uIGroup.needCustomLayout() || !(uIGroup instanceof UIGroup)) {
            return uIGroup.hitTest(((f + ((float) uIGroup.getScrollX())) - ((float) uIGroup.getOriginLeft())) - uIGroup.getTranslationX(), ((f2 + ((float) uIGroup.getScrollY())) - ((float) uIGroup.getOriginTop())) - uIGroup.getTranslationY());
        }
        UIGroup uIGroup2 = uIGroup;
        return uIGroup2.findUIWithCustomLayout(f - ((float) uIGroup.getOriginLeft()), f2 - ((float) uIGroup.getOriginTop()), uIGroup2);
    }

    @7tl
    public void requestUIInfo(ReadableMap readableMap, Callback callback) {
        ArrayList arrayList = new ArrayList();
        if (readableMap != null) {
            ReadableMapKeySetIterator keySetIterator = readableMap.keySetIterator();
            while (keySetIterator.hasNextKey()) {
                String nextKey = keySetIterator.nextKey();
                if (readableMap.getBoolean(nextKey, false)) {
                    arrayList.add(nextKey);
                }
            }
        }
        JavaOnlyMap positionInfo = getPositionInfo();
        JavaOnlyMap javaOnlyMap = new JavaOnlyMap();
        if (arrayList.contains("id")) {
            javaOnlyMap.put("id", getIdSelector());
        }
        if (arrayList.contains("dataset")) {
            javaOnlyMap.put("dataset", this.mDataset);
        }
        if (arrayList.contains("rect")) {
            javaOnlyMap.put("left", positionInfo.get("left"));
            javaOnlyMap.put("top", positionInfo.get("top"));
            javaOnlyMap.put("right", positionInfo.get("right"));
            javaOnlyMap.put("bottom", positionInfo.get("bottom"));
        }
        if (arrayList.contains("size")) {
            javaOnlyMap.put("width", positionInfo.get("width"));
            javaOnlyMap.put(C4065QhC.LJFF, positionInfo.get(C4065QhC.LJFF));
        }
        if (arrayList.contains("scrollOffset")) {
            float f = this.mContext.LJIILIIL.density;
            javaOnlyMap.put("scrollLeft", Float.valueOf(((float) getScrollX()) / f));
            javaOnlyMap.put("scrollTop", Float.valueOf(((float) getScrollY()) / f));
        }
        if (arrayList.contains("node")) {
            javaOnlyMap.put("node", new JavaOnlyMap());
        }
        callback.invoke(new Object[]{0, javaOnlyMap});
    }

    @QNK(LIZ = {"border-radius", "border-top-left-radius", "border-top-right-radius", "border-bottom-right-radius", "border-bottom-left-radius"})
    public void setBorderRadius(int i, ReadableArray readableArray) {
        int i2 = 0;
        this.mHasRadius = false;
        if (readableArray == null || readableArray.size() <= 0) {
            if (i == 0) {
                do {
                    i2++;
                    this.mLynxBackground.LIZ(i2, new C4378QmF());
                } while (i2 < 4);
            } else {
                this.mLynxBackground.LIZ(i, new C4378QmF());
            }
            onBorderRadiusUpdated(i);
            return;
        }
        this.mHasRadius = true;
        if (i == 0) {
            readableArray.size();
            do {
                int i3 = i2 + 1;
                this.mLynxBackground.LIZ(i3, C4378QmF.LIZ(readableArray, i2 * 4));
                i2 = i3;
            } while (i2 < 4);
        } else {
            readableArray.size();
            this.mLynxBackground.LIZ(i, C4378QmF.LIZ(readableArray, 0));
        }
        onBorderRadiusUpdated(i);
    }

    public void setOutlineData(float f, int i, int i2) {
        setOutlineWidth(f);
        setOutlineStyle(i);
        setOutlineColor(i2);
        invalidate();
    }

    public void updateDrawingLayoutInfo(int i, int i2, Rect rect) {
        boolean z;
        boolean z2 = true;
        if (this.mLeft != i) {
            this.mLeft = i;
            z = true;
        } else {
            z = false;
        }
        if (this.mTop != i2) {
            this.mTop = i2;
        } else {
            z2 = z;
        }
        this.mBound = rect;
        if (z2) {
            onDrawingPositionChanged();
        }
    }

    public void setBorderRadius(int i, float f, float f2) {
        if (!C3948QfJ.LIZ(f) && f < 0.0f) {
            f = 1.0E21f;
        }
        if (!C3948QfJ.LIZ(f2) && f2 < 0.0f) {
            f2 = 1.0E21f;
        }
        C4378QmF qmF = new C4378QmF();
        qmF.LIZ = f;
        qmF.LIZIZ = f2;
        qmF.LIZJ = MNo.NUMBER;
        qmF.LIZLLL = MNo.NUMBER;
        if (i == 0) {
            int i2 = 1;
            do {
                this.mLynxBackground.LIZ(i2, qmF);
                i2++;
            } while (i2 < 5);
        } else {
            this.mLynxBackground.LIZ(i, qmF);
        }
        onBorderRadiusUpdated(i);
    }

    public void setTransformData(float f, float f2, int[] iArr, float[] fArr) {
        this.hasTransformChanged = true;
        ArrayList arrayList = null;
        int[] iArr2 = iArr;
        if (!(iArr2 == null || iArr2.length == 0)) {
            float[] fArr2 = fArr;
            if (iArr2.length * 3 == fArr2.length) {
                arrayList = new ArrayList();
                int i = 0;
                int i2 = 0;
                while (i < iArr2.length) {
                    arrayList.add(new C4368Qm5(iArr2[i], fArr2[i2], 0, fArr2[i2 + 1], 0, fArr2[i2 + 2], 0));
                    i++;
                    i2 += 3;
                }
            }
        }
        this.mTransformRaw = arrayList;
        this.mTransformOrigin = new C4387QmO(f, f2);
        C4471Qnk qnk = this.mParent;
        if (qnk instanceof UIShadowProxy) {
            ((UIShadowProxy) qnk).LIZIZ();
        }
    }

    public void setShadowData(float[] fArr, float[] fArr2, float[] fArr3, float[] fArr4, int[] iArr, int[] iArr2) {
        int length = fArr.length;
        ArrayList arrayList = new ArrayList();
        for (int i = 0; i < length; i++) {
            C3482QUt qUt = new C3482QUt();
            qUt.LIZIZ = fArr[i];
            qUt.LIZJ = fArr2[i];
            qUt.LIZLLL = fArr3[i];
            qUt.LJFF = qUt.LIZLLL * 1.25f;
            qUt.LJ = fArr4[i];
            qUt.LJI = iArr2[i];
            qUt.LIZ = iArr[i];
            arrayList.add(qUt);
        }
        if (this instanceof UIShadowProxy) {
            ((UIShadowProxy) this).LIZ(arrayList);
            return;
        }
        C4471Qnk qnk = this.mParent;
        if (qnk instanceof UIShadowProxy) {
            ((UIShadowProxy) qnk).LIZ(arrayList);
        }
    }

    public void setBackgroundData(int i, ReadableArray readableArray, float[] fArr, float[] fArr2, int[] iArr, int[] iArr2, int[] iArr3) {
        setBackgroundColor(i);
        C4369Qm6 qm6 = this.mLynxBackground;
        if (!((readableArray == null || readableArray.size() == 0) && qm6.LJ == null)) {
            qm6.LIZJ().invalidateSelf();
        }
        invalidate();
    }

    public void updateLayout(int i, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9, int i10, int i11, int i12, Rect rect) {
        int i13 = i4;
        int i14 = i3;
        int i15 = i;
        int i16 = i2;
        int i17 = i10;
        int i18 = i9;
        int i19 = i8;
        updateLayoutInfo(i15, i16, i14, i13, i5, i6, i7, i19, 0, 0, 0, 0, i18, i17, i11, i12, rect);
        onLayoutUpdated();
    }

    public void updateLayout(int i, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9, int i10, int i11, int i12, int i13, int i14, int i15, int i16, Rect rect) {
        updateLayoutInfo(i, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, rect);
        onLayoutUpdated();
        sendLayoutChangeEvent();
    }

    public void updateLayoutInfo(int i, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9, int i10, int i11, int i12, int i13, int i14, int i15, int i16, Rect rect) {
        this.mLeft = i;
        this.mTop = i2;
        this.mWidth = i3;
        this.mHeight = i4;
        this.mOriginTop = i2;
        this.mOriginLeft = i;
        this.mPaddingLeft = i5;
        this.mPaddingRight = i7;
        this.mPaddingBottom = i8;
        this.mPaddingTop = i6;
        this.mMarginLeft = i9;
        this.mMarginTop = i10;
        this.mMarginRight = i11;
        this.mMarginBottom = i12;
        this.mBorderTopWidth = i14;
        this.mBorderBottomWidth = i16;
        this.mBorderLeftWidth = i13;
        this.mBorderRightWidth = i15;
        this.mBound = rect;
    }

    public void setBorderData(float f, float f2, float f3, float f4, int i, int i2, int i3, int i4, float f5, float f6, float f7, float f8, float f9, float f10, float f11, float f12, int i5, int i6, int i7, int i8) {
        int i9 = (int) f4;
        this.mBorderLeftWidth = i9;
        int i10 = (int) f2;
        this.mBorderRightWidth = i10;
        int i11 = (int) f;
        this.mBorderTopWidth = i11;
        int i12 = (int) f3;
        this.mBorderBottomWidth = i12;
        setBorderWidth(1, i9);
        setBorderWidth(2, i10);
        setBorderWidth(3, i11);
        setBorderWidth(4, i12);
        setBorderStyle(1, i4);
        setBorderStyle(2, i2);
        setBorderStyle(3, i);
        setBorderStyle(4, i3);
        setBorderRadius(1, f5, f6);
        setBorderRadius(2, f7, f8);
        setBorderRadius(3, f9, f10);
        setBorderRadius(4, f11, f12);
        setBorderColor(0, Integer.valueOf(i8));
        setBorderColor(1, Integer.valueOf(i6));
        setBorderColor(2, Integer.valueOf(i5));
        setBorderColor(3, Integer.valueOf(i7));
    }
}
