mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
6c0f73b322
Summary: This diff formats the Java class files inside xplat/js/react-native-github. Since google-java-format was enabled in D16071401 we want to codemode the existing code so that users don't have to deal with formatter lint noise at diff-time. ```arc f --paths-cmd 'hg files -I "**/*.java"'``` drop-conflicts Reviewed By: cpojer Differential Revision: D16071725 fbshipit-source-id: fc6e3852e45742c109f0c5ac4065d64201c74204
86 lines
2.5 KiB
Java
86 lines
2.5 KiB
Java
/**
|
|
* Copyright (c) 2014-present, Facebook, Inc.
|
|
*
|
|
* <p>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 android.annotation.SuppressLint;
|
|
import com.facebook.jni.HybridData;
|
|
import com.facebook.proguard.annotations.DoNotStrip;
|
|
import com.facebook.react.bridge.JavaScriptContextHolder;
|
|
import com.facebook.react.bridge.NativeMap;
|
|
import com.facebook.react.bridge.queue.MessageQueueThread;
|
|
import com.facebook.react.fabric.events.EventBeatManager;
|
|
import com.facebook.react.uimanager.PixelUtil;
|
|
|
|
@DoNotStrip
|
|
@SuppressLint("MissingNativeLoadLibrary")
|
|
public class Binding {
|
|
|
|
static {
|
|
FabricSoLoader.staticInit();
|
|
}
|
|
|
|
@DoNotStrip private final HybridData mHybridData;
|
|
|
|
private static native HybridData initHybrid();
|
|
|
|
public Binding() {
|
|
mHybridData = initHybrid();
|
|
}
|
|
|
|
private native void installFabricUIManager(
|
|
long jsContextNativePointer,
|
|
Object uiManager,
|
|
EventBeatManager eventBeatManager,
|
|
MessageQueueThread jsMessageQueueThread,
|
|
ComponentFactoryDelegate componentsRegistry,
|
|
Object reactNativeConfig);
|
|
|
|
public native void startSurface(int surfaceId, String moduleName, NativeMap initialProps);
|
|
|
|
public native void startSurfaceWithConstraints(
|
|
int surfaceId,
|
|
String moduleName,
|
|
NativeMap initialProps,
|
|
float minWidth,
|
|
float maxWidth,
|
|
float minHeight,
|
|
float maxHeight);
|
|
|
|
public native void renderTemplateToSurface(int surfaceId, String uiTemplate);
|
|
|
|
public native void stopSurface(int surfaceId);
|
|
|
|
public native void setPixelDensity(float pointScaleFactor);
|
|
|
|
public native void setConstraints(
|
|
int surfaceId, float minWidth, float maxWidth, float minHeight, float maxHeight);
|
|
|
|
public void register(
|
|
JavaScriptContextHolder jsContext,
|
|
FabricUIManager fabricUIManager,
|
|
EventBeatManager eventBeatManager,
|
|
MessageQueueThread jsMessageQueueThread,
|
|
ComponentFactoryDelegate componentFactoryDelegate,
|
|
ReactNativeConfig reactNativeConfig) {
|
|
fabricUIManager.setBinding(this);
|
|
installFabricUIManager(
|
|
jsContext.get(),
|
|
fabricUIManager,
|
|
eventBeatManager,
|
|
jsMessageQueueThread,
|
|
componentFactoryDelegate,
|
|
reactNativeConfig);
|
|
setPixelDensity(PixelUtil.getDisplayMetricDensity());
|
|
}
|
|
|
|
private native void uninstallFabricUIManager();
|
|
|
|
public void unregister() {
|
|
uninstallFabricUIManager();
|
|
}
|
|
}
|