From c5496fd93f3c09d72b249b8154f17af8a6df38fb Mon Sep 17 00:00:00 2001 From: David Vacca Date: Thu, 15 Jun 2023 22:34:36 -0700 Subject: [PATCH] Introduce ReactSurfaceInterface Summary: This diff introduces ReactSurfaceInterface (as an empty interface). The goal is to demonstrate that we will be extending interfaces iteratively, meaning we will complete this API as we advance on the Stable API of surface in H2 bypass-github-export-checks changelog: [internal] internal Reviewed By: cortinico Differential Revision: D46770420 fbshipit-source-id: 48b1ee302c157ae3431d61c84322d788d149f881 --- .../facebook/react/bridgeless/ReactSurface.java | 3 ++- .../react/interfaces/ReactSurfaceInterface.kt | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/react/interfaces/ReactSurfaceInterface.kt diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactSurface.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactSurface.java index c7898a1c576..8568296d4d2 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactSurface.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactSurface.java @@ -23,6 +23,7 @@ import com.facebook.react.bridgeless.internal.bolts.Task; import com.facebook.react.common.annotations.VisibleForTesting; import com.facebook.react.fabric.SurfaceHandler; import com.facebook.react.fabric.SurfaceHandlerBinding; +import com.facebook.react.interfaces.ReactSurfaceInterface; import com.facebook.react.modules.i18nmanager.I18nUtil; import com.facebook.react.uimanager.events.EventDispatcher; import java.util.concurrent.atomic.AtomicReference; @@ -31,7 +32,7 @@ import javax.annotation.Nullable; /** A class responsible for creating and rendering a full-screen React surface. */ @Nullsafe(Nullsafe.Mode.LOCAL) @ThreadSafe -public class ReactSurface { +public class ReactSurface implements ReactSurfaceInterface { private final AtomicReference mSurfaceView = new AtomicReference<>(null); diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/interfaces/ReactSurfaceInterface.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/interfaces/ReactSurfaceInterface.kt new file mode 100644 index 00000000000..5dd268bdf09 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/interfaces/ReactSurfaceInterface.kt @@ -0,0 +1,14 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +package com.facebook.react.interfaces + +/** Represents a Surface in React Native. */ +interface ReactSurfaceInterface { + // the API of this interface will be completed as we analyze and refactor API of ReactSurface, + // ReactRootView, etc. +}