mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Use SurfaceHandler in ReactSurface
Summary: Changelog: [Internal] Updates `ReactSurface` to use `SurfaceHandler` internally. This removes most of the internal state in `ReactSurface` and propagates all the calls to the `SurfaceHandler`. `FabricUIManager` now uses `SurfaceHandler` to start/stop the surface. SurfaceId is still used for view operations. SurfaceId is also now mutable to play better with existing Android infra. Reviewed By: shergin, mdvacca Differential Revision: D26112992 fbshipit-source-id: 52e6860084d739381317035dc3011956d452063c
This commit is contained in:
committed by
Facebook GitHub Bot
parent
8b821f8f12
commit
8dc5ca6a6a
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (c) Facebook, Inc. and its 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.fabric;
|
||||
|
||||
import com.facebook.react.bridge.NativeMap;
|
||||
import javax.annotation.concurrent.ThreadSafe;
|
||||
|
||||
/** Represents a Java variant of the surface, its status and inner data required to display it. */
|
||||
@ThreadSafe
|
||||
public interface SurfaceHandler {
|
||||
|
||||
/** Starts the surface if the surface is not running */
|
||||
void start();
|
||||
|
||||
/** Stops the surface if it is currently running */
|
||||
void stop();
|
||||
|
||||
void setProps(NativeMap props);
|
||||
|
||||
/**
|
||||
* Provides current surface id. Id should be updated after each call to {@link
|
||||
* SurfaceHandler#stop}
|
||||
*/
|
||||
int getSurfaceId();
|
||||
|
||||
/**
|
||||
* Updates current surface id. Id should be updated after each call to {@link SurfaceHandler#stop}
|
||||
*/
|
||||
void setSurfaceId(int surfaceId);
|
||||
|
||||
boolean isRunning();
|
||||
|
||||
String getModuleName();
|
||||
|
||||
void setLayoutConstraints(
|
||||
int widthMeasureSpec,
|
||||
int heightMeasureSpec,
|
||||
int offsetX,
|
||||
int offsetY,
|
||||
boolean doLeftAndRightSwapInRTL,
|
||||
boolean isRTL);
|
||||
}
|
||||
Reference in New Issue
Block a user