forked from microsoft/react-native-macos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactoring ReactSurface & adding ReactSurfaceImpl (facebook#38167)
Summary: Pull Request resolved: facebook#38167 1. Moving out - `getSurfaceID()` - `getSurfaceHandler()` - `getModuleName()` - `getContext()` - `clear()` functions out of `ReactSurface` to interface `ReactSurface` as part of stable APIs. 2. Refactoring usages of `ReactSurface` to rely on interface `ReactSurface`. 3. `ReactSurfaceInterface` -> `ReactSurface` 4. `ReactSurface` -> `ReactSurfaceImpl` Reviewed By: mdvacca Differential Revision: D47109982 fbshipit-source-id: ce9fb12b33fcbb5f243f95f9e7dca8662bb64102
- Loading branch information
1 parent
f493adc
commit b47403e
Showing
10 changed files
with
79 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 0 additions & 28 deletions
28
...-native/ReactAndroid/src/main/java/com/facebook/react/interfaces/ReactSurfaceInterface.kt
This file was deleted.
Oops, something went wrong.
49 changes: 49 additions & 0 deletions
49
...ct-native/ReactAndroid/src/main/java/com/facebook/react/interfaces/fabric/ReactSurface.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* 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.fabric | ||
|
||
import android.content.Context | ||
import android.view.ViewGroup | ||
import com.facebook.react.interfaces.TaskInterface | ||
|
||
/** Represents a Surface in React Native. */ | ||
interface ReactSurface { | ||
|
||
// the API of this interface will be completed as we analyze and refactor API of ReactSurface, | ||
// ReactRootView, etc. | ||
|
||
// Returns surface ID of this surface | ||
val surfaceID: Int | ||
|
||
// Returns module name of this surface | ||
val moduleName: String | ||
|
||
// Returns whether the surface is running or not | ||
val isRunning: Boolean | ||
|
||
// Returns surface handler | ||
val surfaceHandler: SurfaceHandler | ||
|
||
// Returns React root view of this surface | ||
val view: ViewGroup? | ||
|
||
// Returns context associated with the surface | ||
val context: Context | ||
|
||
// Prerender this surface | ||
fun prerender(): TaskInterface<Void> | ||
|
||
// Start running this surface | ||
fun start(): TaskInterface<Void> | ||
|
||
// Stop running this surface | ||
fun stop(): TaskInterface<Void> | ||
|
||
// Clear surface | ||
fun clear() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters