mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Kotlinfy SurfaceHandler interface (#38507)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/38507 Converting SurfaceHandler.java to Kotlin Reviewed By: rshest Differential Revision: D47568614 fbshipit-source-id: 5dda9d970e232fe2ff9e61a87d348961d212d6ea
This commit is contained in:
committed by
Facebook GitHub Bot
parent
c0b04d6647
commit
442ccee313
+28
-27
@@ -5,46 +5,47 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.react.fabric;
|
||||
package com.facebook.react.fabric
|
||||
|
||||
import com.facebook.react.bridge.NativeMap;
|
||||
import javax.annotation.concurrent.ThreadSafe;
|
||||
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);
|
||||
interface SurfaceHandler {
|
||||
|
||||
/**
|
||||
* Provides current surface id. Id should be updated after each call to {@link
|
||||
* SurfaceHandler#stop}
|
||||
*/
|
||||
int getSurfaceId();
|
||||
val surfaceId: Int
|
||||
|
||||
val isRunning: Boolean
|
||||
|
||||
val moduleName: String
|
||||
|
||||
/** Starts the surface if the surface is not running */
|
||||
fun start()
|
||||
|
||||
/** Stops the surface if it is currently running */
|
||||
fun stop()
|
||||
|
||||
fun setProps(props: NativeMap)
|
||||
|
||||
/**
|
||||
* Updates current surface id. Id should be updated after each call to {@link SurfaceHandler#stop}
|
||||
*/
|
||||
void setSurfaceId(int surfaceId);
|
||||
fun setSurfaceId(surfaceId: Int)
|
||||
|
||||
boolean isRunning();
|
||||
fun setLayoutConstraints(
|
||||
widthMeasureSpec: Int,
|
||||
heightMeasureSpec: Int,
|
||||
offsetX: Int,
|
||||
offsetY: Int,
|
||||
doLeftAndRightSwapInRTL: Boolean,
|
||||
isRTL: Boolean,
|
||||
pixelDensity: Float
|
||||
)
|
||||
|
||||
String getModuleName();
|
||||
|
||||
void setLayoutConstraints(
|
||||
int widthMeasureSpec,
|
||||
int heightMeasureSpec,
|
||||
int offsetX,
|
||||
int offsetY,
|
||||
boolean doLeftAndRightSwapInRTL,
|
||||
boolean isRTL,
|
||||
float pixelDensity);
|
||||
|
||||
void setMountable(boolean mountable);
|
||||
fun setMountable(mountable: Boolean)
|
||||
}
|
||||
Reference in New Issue
Block a user