Update overflowInset flag to use public static field

Summary: There's no need to use private feature flag for overflowInset feature. This makes future refactor on feature flags easier.

Reviewed By: javache

Differential Revision: D35866302

fbshipit-source-id: a3fde212ff40cd6d4c68832bb39b34de5a17a8d4
This commit is contained in:
Xin Chen
2022-05-03 14:47:47 -07:00
committed by Facebook GitHub Bot
parent c8550bb5fa
commit 16f30fc0ec
3 changed files with 5 additions and 14 deletions
@@ -86,15 +86,7 @@ public class ReactFeatureFlags {
}
/** Feature Flag to use overflowInset values provided by Yoga */
private static boolean useOverflowInset = false;
public static void setUseOverflowInset(boolean enabled) {
useOverflowInset = enabled;
}
public static boolean doesUseOverflowInset() {
return useOverflowInset;
}
public static boolean useOverflowInset = false;
public static boolean enableLockFreeEventDispatcher = false;
@@ -31,10 +31,9 @@ namespace react {
static bool doesUseOverflowInset() {
static const auto reactFeatureFlagsJavaDescriptor = jni::findClassStatic(
FabricMountingManager::ReactFeatureFlagsJavaDescriptor);
static const auto doesUseOverflowInset =
reactFeatureFlagsJavaDescriptor->getStaticMethod<jboolean()>(
"doesUseOverflowInset");
return doesUseOverflowInset(reactFeatureFlagsJavaDescriptor);
const auto field = reactFeatureFlagsJavaDescriptor->getStaticField<jboolean>(
"useOverflowInset");
return reactFeatureFlagsJavaDescriptor->getStaticFieldValue(field);
}
FabricMountingManager::FabricMountingManager(
@@ -192,7 +192,7 @@ public class TouchTargetHelper {
// If the touch point is outside of the overflowinset for the view, we can safely ignore
// it.
if (ViewUtil.getUIManagerType(view.getId()) == FABRIC
&& ReactFeatureFlags.doesUseOverflowInset()
&& ReactFeatureFlags.useOverflowInset
&& !isTouchPointInViewWithOverflowInset(eventCoords[0], eventCoords[1], view)) {
return null;
}