mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-12-06 04:19:23 +01:00
693 lines
24 KiB
Java
693 lines
24 KiB
Java
package com.facebook.react.uimanager;
|
|
|
|
import androidx.annotation.Nullable;
|
|
import com.facebook.common.logging.FLog;
|
|
import com.facebook.react.bridge.Dynamic;
|
|
import com.facebook.react.bridge.ReadableType;
|
|
import com.facebook.react.common.ReactConstants;
|
|
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogLevel;
|
|
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger;
|
|
import com.facebook.react.modules.i18nmanager.I18nUtil;
|
|
import com.facebook.react.uimanager.annotations.ReactProp;
|
|
import com.facebook.react.uimanager.annotations.ReactPropGroup;
|
|
import com.facebook.yoga.YogaAlign;
|
|
import com.facebook.yoga.YogaDisplay;
|
|
import com.facebook.yoga.YogaFlexDirection;
|
|
import com.facebook.yoga.YogaJustify;
|
|
import com.facebook.yoga.YogaOverflow;
|
|
import com.facebook.yoga.YogaPositionType;
|
|
import com.facebook.yoga.YogaUnit;
|
|
import com.facebook.yoga.YogaWrap;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* loaded from: classes6.dex */
|
|
public class LayoutShadowNode extends ReactShadowNodeImpl {
|
|
boolean mCollapsable;
|
|
private final MutableYogaValue mTempYogaValue = new MutableYogaValue(0);
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* renamed from: com.facebook.react.uimanager.LayoutShadowNode$1, reason: invalid class name */
|
|
public static /* synthetic */ class AnonymousClass1 {
|
|
static final /* synthetic */ int[] $SwitchMap$com$facebook$yoga$YogaUnit;
|
|
|
|
static {
|
|
int[] iArr = new int[YogaUnit.values().length];
|
|
$SwitchMap$com$facebook$yoga$YogaUnit = iArr;
|
|
try {
|
|
iArr[YogaUnit.POINT.ordinal()] = 1;
|
|
} catch (NoSuchFieldError unused) {
|
|
}
|
|
try {
|
|
$SwitchMap$com$facebook$yoga$YogaUnit[YogaUnit.UNDEFINED.ordinal()] = 2;
|
|
} catch (NoSuchFieldError unused2) {
|
|
}
|
|
try {
|
|
$SwitchMap$com$facebook$yoga$YogaUnit[YogaUnit.AUTO.ordinal()] = 3;
|
|
} catch (NoSuchFieldError unused3) {
|
|
}
|
|
try {
|
|
$SwitchMap$com$facebook$yoga$YogaUnit[YogaUnit.PERCENT.ordinal()] = 4;
|
|
} catch (NoSuchFieldError unused4) {
|
|
}
|
|
}
|
|
}
|
|
|
|
static {
|
|
LegacyArchitectureLogger.assertLegacyArchitecture("LayoutShadowNode", LegacyArchitectureLogLevel.ERROR);
|
|
}
|
|
|
|
private int maybeTransformLeftRightToStartEnd(int i) {
|
|
if (I18nUtil.getInstance().doLeftAndRightSwapInRTL(getThemedContext())) {
|
|
if (i == 0) {
|
|
return 4;
|
|
}
|
|
if (i == 2) {
|
|
return 5;
|
|
}
|
|
}
|
|
return i;
|
|
}
|
|
|
|
@ReactProp(name = ViewProps.ALIGN_CONTENT)
|
|
public void setAlignContent(@Nullable String str) {
|
|
if (isVirtual()) {
|
|
}
|
|
if (str == null) {
|
|
setAlignContent(YogaAlign.FLEX_START);
|
|
return;
|
|
}
|
|
switch (str) {
|
|
case "stretch":
|
|
setAlignContent(YogaAlign.STRETCH);
|
|
break;
|
|
case "baseline":
|
|
setAlignContent(YogaAlign.BASELINE);
|
|
break;
|
|
case "center":
|
|
setAlignContent(YogaAlign.CENTER);
|
|
break;
|
|
case "flex-start":
|
|
setAlignContent(YogaAlign.FLEX_START);
|
|
break;
|
|
case "auto":
|
|
setAlignContent(YogaAlign.AUTO);
|
|
break;
|
|
case "space-between":
|
|
setAlignContent(YogaAlign.SPACE_BETWEEN);
|
|
break;
|
|
case "flex-end":
|
|
setAlignContent(YogaAlign.FLEX_END);
|
|
break;
|
|
case "space-around":
|
|
setAlignContent(YogaAlign.SPACE_AROUND);
|
|
break;
|
|
case "space-evenly":
|
|
setAlignContent(YogaAlign.SPACE_EVENLY);
|
|
break;
|
|
default:
|
|
FLog.w(ReactConstants.TAG, "invalid value for alignContent: ".concat(str));
|
|
setAlignContent(YogaAlign.FLEX_START);
|
|
break;
|
|
}
|
|
}
|
|
|
|
@ReactProp(name = ViewProps.ALIGN_ITEMS)
|
|
public void setAlignItems(@Nullable String str) {
|
|
if (isVirtual()) {
|
|
}
|
|
if (str == null) {
|
|
setAlignItems(YogaAlign.STRETCH);
|
|
return;
|
|
}
|
|
switch (str) {
|
|
case "stretch":
|
|
setAlignItems(YogaAlign.STRETCH);
|
|
break;
|
|
case "baseline":
|
|
setAlignItems(YogaAlign.BASELINE);
|
|
break;
|
|
case "center":
|
|
setAlignItems(YogaAlign.CENTER);
|
|
break;
|
|
case "flex-start":
|
|
setAlignItems(YogaAlign.FLEX_START);
|
|
break;
|
|
case "auto":
|
|
setAlignItems(YogaAlign.AUTO);
|
|
break;
|
|
case "space-between":
|
|
setAlignItems(YogaAlign.SPACE_BETWEEN);
|
|
break;
|
|
case "flex-end":
|
|
setAlignItems(YogaAlign.FLEX_END);
|
|
break;
|
|
case "space-around":
|
|
setAlignItems(YogaAlign.SPACE_AROUND);
|
|
break;
|
|
default:
|
|
FLog.w(ReactConstants.TAG, "invalid value for alignItems: ".concat(str));
|
|
setAlignItems(YogaAlign.STRETCH);
|
|
break;
|
|
}
|
|
}
|
|
|
|
@ReactProp(name = ViewProps.ALIGN_SELF)
|
|
public void setAlignSelf(@Nullable String str) {
|
|
if (isVirtual()) {
|
|
}
|
|
if (str == null) {
|
|
setAlignSelf(YogaAlign.AUTO);
|
|
return;
|
|
}
|
|
switch (str) {
|
|
case "stretch":
|
|
setAlignSelf(YogaAlign.STRETCH);
|
|
break;
|
|
case "baseline":
|
|
setAlignSelf(YogaAlign.BASELINE);
|
|
break;
|
|
case "center":
|
|
setAlignSelf(YogaAlign.CENTER);
|
|
break;
|
|
case "flex-start":
|
|
setAlignSelf(YogaAlign.FLEX_START);
|
|
break;
|
|
case "auto":
|
|
setAlignSelf(YogaAlign.AUTO);
|
|
break;
|
|
case "space-between":
|
|
setAlignSelf(YogaAlign.SPACE_BETWEEN);
|
|
break;
|
|
case "flex-end":
|
|
setAlignSelf(YogaAlign.FLEX_END);
|
|
break;
|
|
case "space-around":
|
|
setAlignSelf(YogaAlign.SPACE_AROUND);
|
|
break;
|
|
default:
|
|
FLog.w(ReactConstants.TAG, "invalid value for alignSelf: ".concat(str));
|
|
setAlignSelf(YogaAlign.AUTO);
|
|
break;
|
|
}
|
|
}
|
|
|
|
@ReactProp(defaultFloat = Float.NaN, name = ViewProps.ASPECT_RATIO)
|
|
public void setAspectRatio(float f) {
|
|
setStyleAspectRatio(f);
|
|
}
|
|
|
|
@ReactPropGroup(defaultFloat = Float.NaN, names = {ViewProps.BORDER_WIDTH, ViewProps.BORDER_START_WIDTH, ViewProps.BORDER_END_WIDTH, ViewProps.BORDER_TOP_WIDTH, ViewProps.BORDER_BOTTOM_WIDTH, ViewProps.BORDER_LEFT_WIDTH, ViewProps.BORDER_RIGHT_WIDTH})
|
|
public void setBorderWidths(int i, float f) {
|
|
if (isVirtual()) {
|
|
return;
|
|
}
|
|
setBorder(maybeTransformLeftRightToStartEnd(ViewProps.BORDER_SPACING_TYPES[i]), PixelUtil.toPixelFromDIP(f));
|
|
}
|
|
|
|
@ReactProp(name = ViewProps.COLLAPSABLE)
|
|
public void setCollapsable(boolean z) {
|
|
this.mCollapsable = z;
|
|
}
|
|
|
|
@ReactProp(name = ViewProps.COLUMN_GAP)
|
|
public void setColumnGap(Dynamic dynamic) {
|
|
if (isVirtual()) {
|
|
return;
|
|
}
|
|
this.mTempYogaValue.setFromDynamic(dynamic);
|
|
int i = AnonymousClass1.$SwitchMap$com$facebook$yoga$YogaUnit[this.mTempYogaValue.unit.ordinal()];
|
|
if (i == 1 || i == 2 || i == 3) {
|
|
setColumnGap(this.mTempYogaValue.value);
|
|
} else if (i == 4) {
|
|
setColumnGapPercent(this.mTempYogaValue.value);
|
|
}
|
|
dynamic.recycle();
|
|
}
|
|
|
|
@ReactProp(name = "display")
|
|
public void setDisplay(@Nullable String str) {
|
|
if (isVirtual()) {
|
|
return;
|
|
}
|
|
if (str == null) {
|
|
setDisplay(YogaDisplay.FLEX);
|
|
return;
|
|
}
|
|
if (str.equals(ViewProps.FLEX)) {
|
|
setDisplay(YogaDisplay.FLEX);
|
|
} else if (str.equals("none")) {
|
|
setDisplay(YogaDisplay.NONE);
|
|
} else {
|
|
FLog.w(ReactConstants.TAG, "invalid value for display: ".concat(str));
|
|
setDisplay(YogaDisplay.FLEX);
|
|
}
|
|
}
|
|
|
|
@Override // com.facebook.react.uimanager.ReactShadowNodeImpl, com.facebook.react.uimanager.ReactShadowNode
|
|
@ReactProp(defaultFloat = 0.0f, name = ViewProps.FLEX)
|
|
public void setFlex(float f) {
|
|
if (isVirtual()) {
|
|
return;
|
|
}
|
|
super.setFlex(f);
|
|
}
|
|
|
|
@ReactProp(name = ViewProps.FLEX_BASIS)
|
|
public void setFlexBasis(Dynamic dynamic) {
|
|
if (isVirtual()) {
|
|
return;
|
|
}
|
|
this.mTempYogaValue.setFromDynamic(dynamic);
|
|
int i = AnonymousClass1.$SwitchMap$com$facebook$yoga$YogaUnit[this.mTempYogaValue.unit.ordinal()];
|
|
if (i == 1 || i == 2) {
|
|
setFlexBasis(this.mTempYogaValue.value);
|
|
} else if (i == 3) {
|
|
setFlexBasisAuto();
|
|
} else if (i == 4) {
|
|
setFlexBasisPercent(this.mTempYogaValue.value);
|
|
}
|
|
dynamic.recycle();
|
|
}
|
|
|
|
@ReactProp(name = ViewProps.FLEX_DIRECTION)
|
|
public void setFlexDirection(@Nullable String str) {
|
|
if (isVirtual()) {
|
|
}
|
|
if (str == null) {
|
|
setFlexDirection(YogaFlexDirection.COLUMN);
|
|
return;
|
|
}
|
|
switch (str) {
|
|
case "row-reverse":
|
|
setFlexDirection(YogaFlexDirection.ROW_REVERSE);
|
|
break;
|
|
case "column":
|
|
setFlexDirection(YogaFlexDirection.COLUMN);
|
|
break;
|
|
case "row":
|
|
setFlexDirection(YogaFlexDirection.ROW);
|
|
break;
|
|
case "column-reverse":
|
|
setFlexDirection(YogaFlexDirection.COLUMN_REVERSE);
|
|
break;
|
|
default:
|
|
FLog.w(ReactConstants.TAG, "invalid value for flexDirection: ".concat(str));
|
|
setFlexDirection(YogaFlexDirection.COLUMN);
|
|
break;
|
|
}
|
|
}
|
|
|
|
@Override // com.facebook.react.uimanager.ReactShadowNodeImpl, com.facebook.react.uimanager.ReactShadowNode
|
|
@ReactProp(defaultFloat = 0.0f, name = ViewProps.FLEX_GROW)
|
|
public void setFlexGrow(float f) {
|
|
if (isVirtual()) {
|
|
return;
|
|
}
|
|
super.setFlexGrow(f);
|
|
}
|
|
|
|
@Override // com.facebook.react.uimanager.ReactShadowNodeImpl, com.facebook.react.uimanager.ReactShadowNode
|
|
@ReactProp(defaultFloat = 0.0f, name = ViewProps.FLEX_SHRINK)
|
|
public void setFlexShrink(float f) {
|
|
if (isVirtual()) {
|
|
return;
|
|
}
|
|
super.setFlexShrink(f);
|
|
}
|
|
|
|
@ReactProp(name = ViewProps.FLEX_WRAP)
|
|
public void setFlexWrap(@Nullable String str) {
|
|
if (isVirtual()) {
|
|
}
|
|
if (str == null) {
|
|
setFlexWrap(YogaWrap.NO_WRAP);
|
|
return;
|
|
}
|
|
switch (str) {
|
|
case "nowrap":
|
|
setFlexWrap(YogaWrap.NO_WRAP);
|
|
break;
|
|
case "wrap-reverse":
|
|
setFlexWrap(YogaWrap.WRAP_REVERSE);
|
|
break;
|
|
case "wrap":
|
|
setFlexWrap(YogaWrap.WRAP);
|
|
break;
|
|
default:
|
|
FLog.w(ReactConstants.TAG, "invalid value for flexWrap: ".concat(str));
|
|
setFlexWrap(YogaWrap.NO_WRAP);
|
|
break;
|
|
}
|
|
}
|
|
|
|
@ReactProp(name = ViewProps.GAP)
|
|
public void setGap(Dynamic dynamic) {
|
|
if (isVirtual()) {
|
|
return;
|
|
}
|
|
this.mTempYogaValue.setFromDynamic(dynamic);
|
|
int i = AnonymousClass1.$SwitchMap$com$facebook$yoga$YogaUnit[this.mTempYogaValue.unit.ordinal()];
|
|
if (i == 1 || i == 2 || i == 3) {
|
|
setGap(this.mTempYogaValue.value);
|
|
} else if (i == 4) {
|
|
setGapPercent(this.mTempYogaValue.value);
|
|
}
|
|
dynamic.recycle();
|
|
}
|
|
|
|
@ReactProp(name = "height")
|
|
public void setHeight(Dynamic dynamic) {
|
|
if (isVirtual()) {
|
|
return;
|
|
}
|
|
this.mTempYogaValue.setFromDynamic(dynamic);
|
|
int i = AnonymousClass1.$SwitchMap$com$facebook$yoga$YogaUnit[this.mTempYogaValue.unit.ordinal()];
|
|
if (i == 1 || i == 2) {
|
|
setStyleHeight(this.mTempYogaValue.value);
|
|
} else if (i == 3) {
|
|
setStyleHeightAuto();
|
|
} else if (i == 4) {
|
|
setStyleHeightPercent(this.mTempYogaValue.value);
|
|
}
|
|
dynamic.recycle();
|
|
}
|
|
|
|
@ReactProp(name = ViewProps.JUSTIFY_CONTENT)
|
|
public void setJustifyContent(@Nullable String str) {
|
|
if (isVirtual()) {
|
|
}
|
|
if (str == null) {
|
|
setJustifyContent(YogaJustify.FLEX_START);
|
|
return;
|
|
}
|
|
switch (str) {
|
|
case "center":
|
|
setJustifyContent(YogaJustify.CENTER);
|
|
break;
|
|
case "flex-start":
|
|
setJustifyContent(YogaJustify.FLEX_START);
|
|
break;
|
|
case "space-between":
|
|
setJustifyContent(YogaJustify.SPACE_BETWEEN);
|
|
break;
|
|
case "flex-end":
|
|
setJustifyContent(YogaJustify.FLEX_END);
|
|
break;
|
|
case "space-around":
|
|
setJustifyContent(YogaJustify.SPACE_AROUND);
|
|
break;
|
|
case "space-evenly":
|
|
setJustifyContent(YogaJustify.SPACE_EVENLY);
|
|
break;
|
|
default:
|
|
FLog.w(ReactConstants.TAG, "invalid value for justifyContent: ".concat(str));
|
|
setJustifyContent(YogaJustify.FLEX_START);
|
|
break;
|
|
}
|
|
}
|
|
|
|
@ReactPropGroup(names = {ViewProps.MARGIN, ViewProps.MARGIN_VERTICAL, ViewProps.MARGIN_HORIZONTAL, ViewProps.MARGIN_START, ViewProps.MARGIN_END, ViewProps.MARGIN_TOP, ViewProps.MARGIN_BOTTOM, ViewProps.MARGIN_LEFT, ViewProps.MARGIN_RIGHT})
|
|
public void setMargins(int i, Dynamic dynamic) {
|
|
if (isVirtual()) {
|
|
return;
|
|
}
|
|
int maybeTransformLeftRightToStartEnd = maybeTransformLeftRightToStartEnd(ViewProps.PADDING_MARGIN_SPACING_TYPES[i]);
|
|
this.mTempYogaValue.setFromDynamic(dynamic);
|
|
int i2 = AnonymousClass1.$SwitchMap$com$facebook$yoga$YogaUnit[this.mTempYogaValue.unit.ordinal()];
|
|
if (i2 == 1 || i2 == 2) {
|
|
setMargin(maybeTransformLeftRightToStartEnd, this.mTempYogaValue.value);
|
|
} else if (i2 == 3) {
|
|
setMarginAuto(maybeTransformLeftRightToStartEnd);
|
|
} else if (i2 == 4) {
|
|
setMarginPercent(maybeTransformLeftRightToStartEnd, this.mTempYogaValue.value);
|
|
}
|
|
dynamic.recycle();
|
|
}
|
|
|
|
@ReactProp(name = "maxHeight")
|
|
public void setMaxHeight(Dynamic dynamic) {
|
|
if (isVirtual()) {
|
|
return;
|
|
}
|
|
this.mTempYogaValue.setFromDynamic(dynamic);
|
|
int i = AnonymousClass1.$SwitchMap$com$facebook$yoga$YogaUnit[this.mTempYogaValue.unit.ordinal()];
|
|
if (i == 1 || i == 2) {
|
|
setStyleMaxHeight(this.mTempYogaValue.value);
|
|
} else if (i == 4) {
|
|
setStyleMaxHeightPercent(this.mTempYogaValue.value);
|
|
}
|
|
dynamic.recycle();
|
|
}
|
|
|
|
@ReactProp(name = "maxWidth")
|
|
public void setMaxWidth(Dynamic dynamic) {
|
|
if (isVirtual()) {
|
|
return;
|
|
}
|
|
this.mTempYogaValue.setFromDynamic(dynamic);
|
|
int i = AnonymousClass1.$SwitchMap$com$facebook$yoga$YogaUnit[this.mTempYogaValue.unit.ordinal()];
|
|
if (i == 1 || i == 2) {
|
|
setStyleMaxWidth(this.mTempYogaValue.value);
|
|
} else if (i == 4) {
|
|
setStyleMaxWidthPercent(this.mTempYogaValue.value);
|
|
}
|
|
dynamic.recycle();
|
|
}
|
|
|
|
@ReactProp(name = ViewProps.MIN_HEIGHT)
|
|
public void setMinHeight(Dynamic dynamic) {
|
|
if (isVirtual()) {
|
|
return;
|
|
}
|
|
this.mTempYogaValue.setFromDynamic(dynamic);
|
|
int i = AnonymousClass1.$SwitchMap$com$facebook$yoga$YogaUnit[this.mTempYogaValue.unit.ordinal()];
|
|
if (i == 1 || i == 2) {
|
|
setStyleMinHeight(this.mTempYogaValue.value);
|
|
} else if (i == 4) {
|
|
setStyleMinHeightPercent(this.mTempYogaValue.value);
|
|
}
|
|
dynamic.recycle();
|
|
}
|
|
|
|
@ReactProp(name = ViewProps.MIN_WIDTH)
|
|
public void setMinWidth(Dynamic dynamic) {
|
|
if (isVirtual()) {
|
|
return;
|
|
}
|
|
this.mTempYogaValue.setFromDynamic(dynamic);
|
|
int i = AnonymousClass1.$SwitchMap$com$facebook$yoga$YogaUnit[this.mTempYogaValue.unit.ordinal()];
|
|
if (i == 1 || i == 2) {
|
|
setStyleMinWidth(this.mTempYogaValue.value);
|
|
} else if (i == 4) {
|
|
setStyleMinWidthPercent(this.mTempYogaValue.value);
|
|
}
|
|
dynamic.recycle();
|
|
}
|
|
|
|
@ReactProp(name = "overflow")
|
|
public void setOverflow(@Nullable String str) {
|
|
if (isVirtual()) {
|
|
}
|
|
if (str == null) {
|
|
setOverflow(YogaOverflow.VISIBLE);
|
|
return;
|
|
}
|
|
switch (str) {
|
|
case "hidden":
|
|
setOverflow(YogaOverflow.HIDDEN);
|
|
break;
|
|
case "scroll":
|
|
setOverflow(YogaOverflow.SCROLL);
|
|
break;
|
|
case "visible":
|
|
setOverflow(YogaOverflow.VISIBLE);
|
|
break;
|
|
default:
|
|
FLog.w(ReactConstants.TAG, "invalid value for overflow: ".concat(str));
|
|
setOverflow(YogaOverflow.VISIBLE);
|
|
break;
|
|
}
|
|
}
|
|
|
|
@ReactPropGroup(names = {ViewProps.PADDING, ViewProps.PADDING_VERTICAL, ViewProps.PADDING_HORIZONTAL, ViewProps.PADDING_START, ViewProps.PADDING_END, ViewProps.PADDING_TOP, ViewProps.PADDING_BOTTOM, ViewProps.PADDING_LEFT, ViewProps.PADDING_RIGHT})
|
|
public void setPaddings(int i, Dynamic dynamic) {
|
|
if (isVirtual()) {
|
|
return;
|
|
}
|
|
int maybeTransformLeftRightToStartEnd = maybeTransformLeftRightToStartEnd(ViewProps.PADDING_MARGIN_SPACING_TYPES[i]);
|
|
this.mTempYogaValue.setFromDynamic(dynamic);
|
|
int i2 = AnonymousClass1.$SwitchMap$com$facebook$yoga$YogaUnit[this.mTempYogaValue.unit.ordinal()];
|
|
if (i2 == 1 || i2 == 2) {
|
|
setPadding(maybeTransformLeftRightToStartEnd, this.mTempYogaValue.value);
|
|
} else if (i2 == 4) {
|
|
setPaddingPercent(maybeTransformLeftRightToStartEnd, this.mTempYogaValue.value);
|
|
}
|
|
dynamic.recycle();
|
|
}
|
|
|
|
@ReactProp(name = "position")
|
|
public void setPosition(@Nullable String str) {
|
|
if (isVirtual()) {
|
|
return;
|
|
}
|
|
if (str == null) {
|
|
setPositionType(YogaPositionType.RELATIVE);
|
|
return;
|
|
}
|
|
if (str.equals("relative")) {
|
|
setPositionType(YogaPositionType.RELATIVE);
|
|
} else if (str.equals("absolute")) {
|
|
setPositionType(YogaPositionType.ABSOLUTE);
|
|
} else {
|
|
FLog.w(ReactConstants.TAG, "invalid value for position: ".concat(str));
|
|
setPositionType(YogaPositionType.RELATIVE);
|
|
}
|
|
}
|
|
|
|
@ReactPropGroup(names = {"start", "end", "left", "right", "top", "bottom"})
|
|
public void setPositionValues(int i, Dynamic dynamic) {
|
|
if (isVirtual()) {
|
|
return;
|
|
}
|
|
int maybeTransformLeftRightToStartEnd = maybeTransformLeftRightToStartEnd(new int[]{4, 5, 0, 2, 1, 3}[i]);
|
|
this.mTempYogaValue.setFromDynamic(dynamic);
|
|
int i2 = AnonymousClass1.$SwitchMap$com$facebook$yoga$YogaUnit[this.mTempYogaValue.unit.ordinal()];
|
|
if (i2 == 1 || i2 == 2) {
|
|
setPosition(maybeTransformLeftRightToStartEnd, this.mTempYogaValue.value);
|
|
} else if (i2 == 4) {
|
|
setPositionPercent(maybeTransformLeftRightToStartEnd, this.mTempYogaValue.value);
|
|
}
|
|
dynamic.recycle();
|
|
}
|
|
|
|
@ReactProp(name = ViewProps.ROW_GAP)
|
|
public void setRowGap(Dynamic dynamic) {
|
|
if (isVirtual()) {
|
|
return;
|
|
}
|
|
this.mTempYogaValue.setFromDynamic(dynamic);
|
|
int i = AnonymousClass1.$SwitchMap$com$facebook$yoga$YogaUnit[this.mTempYogaValue.unit.ordinal()];
|
|
if (i == 1 || i == 2 || i == 3) {
|
|
setRowGap(this.mTempYogaValue.value);
|
|
} else if (i == 4) {
|
|
setRowGapPercent(this.mTempYogaValue.value);
|
|
}
|
|
dynamic.recycle();
|
|
}
|
|
|
|
@Override // com.facebook.react.uimanager.ReactShadowNodeImpl, com.facebook.react.uimanager.ReactShadowNode
|
|
@ReactProp(name = "onLayout")
|
|
public void setShouldNotifyOnLayout(boolean z) {
|
|
super.setShouldNotifyOnLayout(z);
|
|
}
|
|
|
|
@ReactProp(name = "width")
|
|
public void setWidth(Dynamic dynamic) {
|
|
if (isVirtual()) {
|
|
return;
|
|
}
|
|
this.mTempYogaValue.setFromDynamic(dynamic);
|
|
int i = AnonymousClass1.$SwitchMap$com$facebook$yoga$YogaUnit[this.mTempYogaValue.unit.ordinal()];
|
|
if (i == 1 || i == 2) {
|
|
setStyleWidth(this.mTempYogaValue.value);
|
|
} else if (i == 3) {
|
|
setStyleWidthAuto();
|
|
} else if (i == 4) {
|
|
setStyleWidthPercent(this.mTempYogaValue.value);
|
|
}
|
|
dynamic.recycle();
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class MutableYogaValue {
|
|
YogaUnit unit;
|
|
float value;
|
|
|
|
private MutableYogaValue(MutableYogaValue mutableYogaValue) {
|
|
this.value = mutableYogaValue.value;
|
|
this.unit = mutableYogaValue.unit;
|
|
}
|
|
|
|
public void setFromDynamic(Dynamic dynamic) {
|
|
if (dynamic.isNull()) {
|
|
this.unit = YogaUnit.UNDEFINED;
|
|
this.value = Float.NaN;
|
|
return;
|
|
}
|
|
if (dynamic.getType() != ReadableType.String) {
|
|
if (dynamic.getType() == ReadableType.Number) {
|
|
this.unit = YogaUnit.POINT;
|
|
this.value = PixelUtil.toPixelFromDIP(dynamic.asDouble());
|
|
return;
|
|
} else {
|
|
this.unit = YogaUnit.UNDEFINED;
|
|
this.value = Float.NaN;
|
|
return;
|
|
}
|
|
}
|
|
String asString = dynamic.asString();
|
|
if (asString.equals("auto")) {
|
|
this.unit = YogaUnit.AUTO;
|
|
this.value = Float.NaN;
|
|
} else if (asString.endsWith("%")) {
|
|
this.unit = YogaUnit.PERCENT;
|
|
this.value = Float.parseFloat(asString.substring(0, asString.length() - 1));
|
|
} else {
|
|
FLog.w(ReactConstants.TAG, "Unknown value: ".concat(asString));
|
|
this.unit = YogaUnit.UNDEFINED;
|
|
this.value = Float.NaN;
|
|
}
|
|
}
|
|
|
|
private MutableYogaValue() {
|
|
}
|
|
|
|
public /* synthetic */ MutableYogaValue(int i) {
|
|
this();
|
|
}
|
|
}
|
|
|
|
@ReactProp(name = ViewProps.COLLAPSABLE_CHILDREN)
|
|
public void setCollapsableChildren(boolean z) {
|
|
}
|
|
|
|
@ReactProp(name = "inset")
|
|
public void setInset(Dynamic dynamic) {
|
|
}
|
|
|
|
@ReactProp(name = ViewProps.ON_POINTER_ENTER)
|
|
public void setShouldNotifyPointerEnter(boolean z) {
|
|
}
|
|
|
|
@ReactProp(name = ViewProps.ON_POINTER_LEAVE)
|
|
public void setShouldNotifyPointerLeave(boolean z) {
|
|
}
|
|
|
|
@ReactProp(name = ViewProps.ON_POINTER_MOVE)
|
|
public void setShouldNotifyPointerMove(boolean z) {
|
|
}
|
|
|
|
@ReactPropGroup(names = {"insetBlock", "insetBlockEnd", "insetBlockStart"})
|
|
public void setInsetBlock(int i, Dynamic dynamic) {
|
|
}
|
|
|
|
@ReactPropGroup(names = {"insetInline", "insetInlineEnd", "insetInlineStart"})
|
|
public void setInsetInline(int i, Dynamic dynamic) {
|
|
}
|
|
|
|
@ReactPropGroup(names = {"marginBlock", "marginBlockEnd", "marginBlockStart"})
|
|
public void setMarginBlock(int i, Dynamic dynamic) {
|
|
}
|
|
|
|
@ReactPropGroup(names = {"marginInline", "marginInlineEnd", "marginInlineStart"})
|
|
public void setMarginInline(int i, Dynamic dynamic) {
|
|
}
|
|
|
|
@ReactPropGroup(names = {"paddingBlock", "paddingBlockEnd", "paddingBlockStart"})
|
|
public void setPaddingBlock(int i, Dynamic dynamic) {
|
|
}
|
|
|
|
@ReactPropGroup(names = {"paddingInline", "paddingInlineEnd", "paddingInlineStart"})
|
|
public void setPaddingInline(int i, Dynamic dynamic) {
|
|
}
|
|
}
|