Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,51 @@ HostPlatformViewProps::HostPlatformViewProps(
rawProps,
"screenReaderFocusable",
sourceProps.screenReaderFocusable,
{})),
nextFocusDown(
ReactNativeFeatureFlags::enableCppPropsIteratorSetter()
? sourceProps.nextFocusDown
: convertRawProp(
context,
rawProps,
"nextFocusDown",
sourceProps.nextFocusDown,
{})),
nextFocusForward(
ReactNativeFeatureFlags::enableCppPropsIteratorSetter()
? sourceProps.nextFocusForward
: convertRawProp(
context,
rawProps,
"nextFocusForward",
sourceProps.nextFocusForward,
{})),
nextFocusLeft(
ReactNativeFeatureFlags::enableCppPropsIteratorSetter()
? sourceProps.nextFocusLeft
: convertRawProp(
context,
rawProps,
"nextFocusLeft",
sourceProps.nextFocusLeft,
{})),
nextFocusRight(
ReactNativeFeatureFlags::enableCppPropsIteratorSetter()
? sourceProps.nextFocusRight
: convertRawProp(
context,
rawProps,
"nextFocusRight",
sourceProps.nextFocusRight,
{})),
nextFocusUp(
ReactNativeFeatureFlags::enableCppPropsIteratorSetter()
? sourceProps.nextFocusUp
: convertRawProp(
context,
rawProps,
"nextFocusUp",
sourceProps.nextFocusUp,
{})) {}

#define VIEW_EVENT_CASE(eventType) \
Expand Down Expand Up @@ -130,6 +175,11 @@ void HostPlatformViewProps::setProp(
RAW_SET_PROP_SWITCH_CASE_BASIC(needsOffscreenAlphaCompositing);
RAW_SET_PROP_SWITCH_CASE_BASIC(renderToHardwareTextureAndroid);
RAW_SET_PROP_SWITCH_CASE_BASIC(screenReaderFocusable);
RAW_SET_PROP_SWITCH_CASE_BASIC(nextFocusDown);
RAW_SET_PROP_SWITCH_CASE_BASIC(nextFocusForward);
RAW_SET_PROP_SWITCH_CASE_BASIC(nextFocusLeft);
RAW_SET_PROP_SWITCH_CASE_BASIC(nextFocusRight);
RAW_SET_PROP_SWITCH_CASE_BASIC(nextFocusUp);
}
}

Expand Down Expand Up @@ -982,6 +1032,46 @@ folly::dynamic HostPlatformViewProps::getDiffProps(
result["importantForAccessibility"] = toString(importantForAccessibility);
}

if (nextFocusDown != oldProps->nextFocusDown) {
if (nextFocusDown.has_value()) {
result["nextFocusDown"] = nextFocusDown.value();
} else {
result["nextFocusDown"] = folly::dynamic(nullptr);
}
}

if (nextFocusForward != oldProps->nextFocusForward) {
if (nextFocusForward.has_value()) {
result["nextFocusForward"] = nextFocusForward.value();
} else {
result["nextFocusForward"] = folly::dynamic(nullptr);
}
}

if (nextFocusLeft != oldProps->nextFocusLeft) {
if (nextFocusLeft.has_value()) {
result["nextFocusLeft"] = nextFocusLeft.value();
} else {
result["nextFocusLeft"] = folly::dynamic(nullptr);
}
}

if (nextFocusRight != oldProps->nextFocusRight) {
if (nextFocusRight.has_value()) {
result["nextFocusRight"] = nextFocusRight.value();
} else {
result["nextFocusRight"] = folly::dynamic(nullptr);
}
}

if (nextFocusUp != oldProps->nextFocusUp) {
if (nextFocusUp.has_value()) {
result["nextFocusUp"] = nextFocusUp.value();
} else {
result["nextFocusUp"] = folly::dynamic(nullptr);
}
}

return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ class HostPlatformViewProps : public BaseViewProps {
bool renderToHardwareTextureAndroid{false};
bool screenReaderFocusable{false};

std::optional<int> nextFocusDown{};
std::optional<int> nextFocusForward{};
std::optional<int> nextFocusLeft{};
std::optional<int> nextFocusRight{};
std::optional<int> nextFocusUp{};

#pragma mark - Convenience Methods

bool getProbablyMoreHorizontalThanVertical_DEPRECATED() const;
Expand Down
Loading