Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add native view config for inset props #44371

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ const validAttributesForEventProps = {

// Pointer events
onClick: true,
onClickCapture: true,
onPointerEnter: true,
onPointerEnterCapture: true,
onPointerLeave: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ const validAttributesForEventProps = ConditionallyIgnoredEventHandlers({

// Pointer events
onClick: true,
onClickCapture: true,
onPointerUp: true,
onPointerDown: true,
onPointerCancel: true,
Expand Down
49 changes: 49 additions & 0 deletions packages/react-native/React/Views/RCTViewManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,55 @@ - (void)updateAccessibilityTraitsForRole:(RCTView *)view withDefaultView:(RCTVie
RCT_EXPORT_SHADOW_PROPERTY(borderEndWidth, float)
RCT_EXPORT_SHADOW_PROPERTY(borderWidth, float)

RCT_CUSTOM_SHADOW_PROPERTY(inset, YGValue, RCTView)
{
// Property is only to be used in the new renderer.
// It is necessary to add it here, otherwise it gets
// filtered by view configs.
}

RCT_CUSTOM_SHADOW_PROPERTY(insetBlock, YGValue, RCTView)
{
// Property is only to be used in the new renderer.
// It is necessary to add it here, otherwise it gets
// filtered by view configs.
}

RCT_CUSTOM_SHADOW_PROPERTY(insetBlockStart, YGValue, RCTView)
{
// Property is only to be used in the new renderer.
// It is necessary to add it here, otherwise it gets
// filtered by view configs.
}

RCT_CUSTOM_SHADOW_PROPERTY(insetBlockEnd, YGValue, RCTView)
{
// Property is only to be used in the new renderer.
// It is necessary to add it here, otherwise it gets
// filtered by view configs.
}

RCT_CUSTOM_SHADOW_PROPERTY(insetInline, YGValue, RCTView)
{
// Property is only to be used in the new renderer.
// It is necessary to add it here, otherwise it gets
// filtered by view configs.
}

RCT_CUSTOM_SHADOW_PROPERTY(insetInlineStart, YGValue, RCTView)
{
// Property is only to be used in the new renderer.
// It is necessary to add it here, otherwise it gets
// filtered by view configs.
}

RCT_CUSTOM_SHADOW_PROPERTY(insetInlineEnd, YGValue, RCTView)
{
// Property is only to be used in the new renderer.
// It is necessary to add it here, otherwise it gets
// filtered by view configs.
}

RCT_EXPORT_SHADOW_PROPERTY(marginTop, YGValue)
RCT_EXPORT_SHADOW_PROPERTY(marginRight, YGValue)
RCT_EXPORT_SHADOW_PROPERTY(marginBottom, YGValue)
Expand Down
6 changes: 5 additions & 1 deletion packages/react-native/ReactAndroid/api/ReactAndroid.api
Original file line number Diff line number Diff line change
Expand Up @@ -4134,6 +4134,7 @@ public class com/facebook/react/uimanager/LayoutShadowNode : com/facebook/react/
public fun setAspectRatio (F)V
public fun setBorderWidths (IF)V
public fun setCollapsable (Z)V
public fun setCollapsableChildren (Z)V
public fun setColumnGap (Lcom/facebook/react/bridge/Dynamic;)V
public fun setDisplay (Ljava/lang/String;)V
public fun setFlex (F)V
Expand All @@ -4144,7 +4145,11 @@ public class com/facebook/react/uimanager/LayoutShadowNode : com/facebook/react/
public fun setFlexWrap (Ljava/lang/String;)V
public fun setGap (Lcom/facebook/react/bridge/Dynamic;)V
public fun setHeight (Lcom/facebook/react/bridge/Dynamic;)V
public fun setInset (Lcom/facebook/react/bridge/Dynamic;)V
public fun setInsetBlock (ILcom/facebook/react/bridge/Dynamic;)V
public fun setInsetInline (ILcom/facebook/react/bridge/Dynamic;)V
public fun setJustifyContent (Ljava/lang/String;)V
public fun setLayoutConformance (Ljava/lang/String;)V
public fun setMargins (ILcom/facebook/react/bridge/Dynamic;)V
public fun setMaxHeight (Lcom/facebook/react/bridge/Dynamic;)V
public fun setMaxWidth (Lcom/facebook/react/bridge/Dynamic;)V
Expand Down Expand Up @@ -7935,7 +7940,6 @@ public class com/facebook/react/views/view/ReactViewManager : com/facebook/react
public fun setTVPreferredFocus (Lcom/facebook/react/views/view/ReactViewGroup;Z)V
protected synthetic fun setTransformProperty (Landroid/view/View;Lcom/facebook/react/bridge/ReadableArray;Lcom/facebook/react/bridge/ReadableArray;)V
protected fun setTransformProperty (Lcom/facebook/react/views/view/ReactViewGroup;Lcom/facebook/react/bridge/ReadableArray;Lcom/facebook/react/bridge/ReadableArray;)V
public fun setexperimental_layoutConformance (Lcom/facebook/react/views/view/ReactViewGroup;Ljava/lang/String;)V
}

public class com/facebook/react/views/view/ReactViewManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ public void setMinWidth(Dynamic minWidth) {

boolean mCollapsable;

@ReactProp(name = "collapsableChildren")
public void setCollapsableChildren(boolean collapsableChildren) {
// Do Nothing: Align with static ViewConfigs

}

@ReactProp(name = "collapsable")
public void setCollapsable(boolean collapsable) {
mCollapsable = collapsable;
Expand Down Expand Up @@ -711,6 +717,31 @@ public void setDisplay(@Nullable String display) {
}
}

@ReactPropGroup(
names = {
"insetBlock",
"insetBlockEnd",
"insetBlockStart",
})
public void setInsetBlock(int index, Dynamic inset) {
// Do Nothing: Align with static ViewConfigs
}

@ReactPropGroup(
names = {
"insetInline",
"insetInlineEnd",
"insetInlineStart",
})
public void setInsetInline(int index, Dynamic inset) {
// Do Nothing: Align with static ViewConfigs
}

@ReactProp(name = "inset")
public void setInset(Dynamic inset) {
// Do Nothing: Align with static ViewConfigs
}

@ReactPropGroup(
names = {
ViewProps.MARGIN,
Expand Down Expand Up @@ -889,19 +920,21 @@ public void setShouldNotifyOnLayout(boolean shouldNotifyOnLayout) {

@ReactProp(name = "onPointerEnter")
public void setShouldNotifyPointerEnter(boolean value) {
// This method exists to inject Native View configs in RN Android VR
// DO NOTHING
// Do Nothing: Align with static ViewConfigs
}

@ReactProp(name = "onPointerLeave")
public void setShouldNotifyPointerLeave(boolean value) {
// This method exists to inject Native View configs in RN Android VR
// DO NOTHING
// Do Nothing: Align with static ViewConfigs
}

@ReactProp(name = "onPointerMove")
public void setShouldNotifyPointerMove(boolean value) {
// This method exists to inject Native View configs in RN Android VR
// DO NOTHING
// Do Nothing: Align with static ViewConfigs
}

@ReactProp(name = "experimental_layoutConformance")
public void setLayoutConformance(String value) {
// Do Nothing: Align with static ViewConfigs
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,6 @@ public void setBorderStyle(ReactViewGroup view, @Nullable String borderStyle) {
view.setBorderStyle(borderStyle);
}

// This is unused by the view manager, and not wired to be sent to Java, but
// must be present for the prop to show up in the view config.
@ReactProp(name = "experimental_layoutConformance")
public void setexperimental_layoutConformance(
ReactViewGroup view, @Nullable String layoutConformance) {}

@ReactProp(name = "hitSlop")
public void setHitSlop(final ReactViewGroup view, Dynamic hitSlop) {
switch (hitSlop.getType()) {
Expand Down