react-native-macos 0.0.0-78b696cee → 0.0.0-7c6fa2fb1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Libraries/Animated/AnimatedEvent.js +23 -4
- package/Libraries/Animated/NativeAnimatedHelper.js +1 -1
- package/Libraries/Components/DatePicker/DatePickerIOS.ios.js +3 -6
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +4 -7
- package/Libraries/Components/ScrollView/ScrollView.js +8 -5
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +268 -252
- package/Libraries/Core/ExceptionsManager.js +3 -1
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/setUpBatchedBridge.js +1 -1
- package/Libraries/Core/setUpGlobals.js +2 -0
- package/Libraries/Core/setUpTimers.js +2 -2
- package/Libraries/Image/Image.ios.js +6 -0
- package/Libraries/LogBox/UI/LogBoxImages/alert-triangle.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/chevron-left.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/chevron-right.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/close.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/loader.png +0 -0
- package/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.m +0 -3
- package/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm +6 -3
- package/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.h +1 -2
- package/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm +2 -1
- package/Libraries/NewAppScreen/components/logo.png +0 -0
- package/Libraries/Pressability/Pressability.js +1 -0
- package/Libraries/Pressability/PressabilityPerformanceEventEmitter.js +1 -0
- package/Libraries/Renderer/REVISION +1 -1
- package/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +238 -47
- package/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +84 -18
- package/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +84 -18
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +238 -47
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +84 -18
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +84 -18
- package/Libraries/StyleSheet/normalizeColor.js +2 -2
- package/Libraries/Text/TextProps.js +1 -7
- package/Libraries/TurboModule/TurboModuleRegistry.js +1 -1
- package/Libraries/Utilities/HMRClient.js +1 -1
- package/Libraries/WebSocket/RCTSRWebSocket.m +23 -0
- package/React/Base/RCTBridge+Private.h +8 -0
- package/React/Base/RCTBridge.h +4 -0
- package/React/Base/RCTBridge.m +17 -0
- package/React/Base/RCTBridgeModule.h +1 -1
- package/React/Base/RCTBundleURLProvider.h +1 -1
- package/React/Base/RCTBundleURLProvider.mm +2 -2
- package/React/Base/RCTDefines.h +12 -3
- package/React/Base/RCTEventDispatcherProtocol.h +2 -0
- package/React/Base/RCTRootView.h +15 -0
- package/React/Base/RCTRootView.m +15 -0
- package/React/Base/RCTVersion.m +1 -1
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.h +11 -0
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +35 -1
- package/React/CoreModules/RCTDevMenu.mm +4 -4
- package/React/CoreModules/RCTDevSettings.mm +6 -6
- package/React/CoreModules/RCTDevSplitBundleLoader.mm +1 -1
- package/React/CoreModules/RCTDeviceInfo.mm +4 -4
- package/React/CoreModules/RCTEventDispatcher.mm +5 -0
- package/React/CoreModules/RCTPerfMonitor.mm +9 -4
- package/React/CxxBridge/RCTCxxBridge.mm +18 -1
- package/React/FBReactNativeSpec/FBReactNativeSpec.podspec +11 -3
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +9 -0
- package/React/Fabric/Mounting/RCTMountingManager.mm +15 -1
- package/React/Fabric/RCTScheduler.mm +10 -3
- package/React/Modules/RCTUIManager.m +19 -10
- package/React/Views/RCTFont.mm +58 -47
- package/React/Views/RCTViewManager.m +3 -2
- package/ReactAndroid/build.gradle +12 -6
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/androidTest/java/com/facebook/react/tests/BUCK +0 -1
- package/ReactAndroid/src/androidTest/js/TestBundle.js +0 -7
- package/ReactAndroid/src/main/java/com/facebook/react/BUCK +0 -1
- package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +24 -6
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactCxxErrorHandler.java +39 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/RuntimeScheduler.java +21 -0
- package/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +6 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/Binding.java +5 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricJSIModuleProvider.java +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Android.mk +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp +14 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.h +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.java +9 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java +19 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/{JavaScriptTimerManager.java → JavaScriptTimerExecutor.java} +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.java +7 -7
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/TimingModule.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/i18nmanager/I18nManagerModule.java +7 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/intent/IntentModule.java +23 -19
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/ForwardingCookieHandler.java +1 -4
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/shell/BUCK +0 -1
- package/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java +0 -5
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.java +0 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java +16 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +8 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java +20 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java +25 -6
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java +25 -5
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditTextInputConnectionWrapper.java +3 -0
- package/ReactAndroid/src/main/jni/react/jni/Android.mk +3 -2
- package/ReactAndroid/src/main/jni/react/jni/BUCK +2 -0
- package/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp +29 -0
- package/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h +4 -0
- package/ReactAndroid/src/main/jni/react/jni/JReactCxxErrorHandler.cpp +18 -0
- package/ReactAndroid/src/main/jni/react/jni/JReactCxxErrorHandler.h +25 -0
- package/ReactAndroid/src/main/jni/react/jni/JRuntimeScheduler.cpp +22 -0
- package/ReactAndroid/src/main/jni/react/jni/JRuntimeScheduler.h +30 -0
- package/ReactAndroid/src/main/third-party/android/androidx/BUCK +6 -6
- package/ReactCommon/React-Fabric.podspec +9 -0
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/hermes/inspector/tools/msggen/package.json +7 -4
- package/ReactCommon/hermes/inspector/tools/msggen/yarn.lock +13 -10
- package/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm +14 -31
- package/ReactCommon/react/renderer/animations/BUCK +1 -0
- package/ReactCommon/react/renderer/animations/LayoutAnimationCallbackWrapper.h +34 -0
- package/ReactCommon/react/renderer/animations/LayoutAnimationDriver.cpp +5 -26
- package/ReactCommon/react/renderer/animations/LayoutAnimationDriver.h +3 -13
- package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +1399 -1622
- package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.h +76 -244
- package/ReactCommon/react/renderer/animations/conversions.h +212 -0
- package/ReactCommon/react/renderer/animations/primitives.h +104 -0
- package/ReactCommon/react/renderer/animations/utils.cpp +71 -0
- package/ReactCommon/react/renderer/animations/utils.h +80 -0
- package/ReactCommon/react/renderer/attributedstring/AttributedString.h +0 -1
- package/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.cpp +7 -3
- package/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.h +12 -2
- package/ReactCommon/react/renderer/attributedstring/TextAttributes.h +1 -1
- package/ReactCommon/react/renderer/attributedstring/conversions.h +58 -3
- package/ReactCommon/react/renderer/attributedstring/primitives.h +18 -1
- package/ReactCommon/react/renderer/components/text/ParagraphComponentDescriptor.h +1 -17
- package/ReactCommon/react/renderer/components/view/Android.mk +1 -1
- package/ReactCommon/react/renderer/components/view/ViewComponentDescriptor.h +0 -23
- package/ReactCommon/react/renderer/components/view/ViewPropsInterpolation.h +2 -3
- package/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp +1 -0
- package/ReactCommon/react/renderer/components/view/ViewShadowNode.h +1 -1
- package/ReactCommon/react/renderer/components/view/accessibilityPropsConversions.h +4 -0
- package/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +14 -6
- package/ReactCommon/react/renderer/core/ConcreteShadowNode.h +1 -0
- package/ReactCommon/react/renderer/core/Props.h +1 -0
- package/ReactCommon/react/renderer/core/PropsParserContext.h +3 -2
- package/ReactCommon/react/renderer/core/RawPropsKey.cpp +10 -2
- package/ReactCommon/react/renderer/core/ReactPrimitives.h +0 -2
- package/ReactCommon/react/renderer/core/ShadowNodeFamily.h +1 -0
- package/ReactCommon/react/renderer/graphics/Android.mk +1 -1
- package/ReactCommon/react/renderer/graphics/Transform.cpp +1 -1
- package/ReactCommon/react/renderer/graphics/Transform.h +1 -1
- package/ReactCommon/react/renderer/mounting/Android.mk +2 -1
- package/ReactCommon/react/renderer/mounting/MountingOverrideDelegate.h +1 -1
- package/ReactCommon/react/renderer/mounting/ShadowViewMutation.cpp +12 -0
- package/ReactCommon/react/renderer/mounting/ShadowViewMutation.h +10 -1
- package/ReactCommon/react/renderer/runtimescheduler/BUCK +0 -1
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +4 -2
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h +4 -2
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.cpp +4 -3
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.h +4 -2
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerClock.h +4 -2
- package/ReactCommon/react/renderer/runtimescheduler/SchedulerPriority.h +4 -3
- package/ReactCommon/react/renderer/runtimescheduler/Task.cpp +4 -2
- package/ReactCommon/react/renderer/runtimescheduler/Task.h +4 -2
- package/ReactCommon/react/renderer/runtimescheduler/primitives.h +4 -2
- package/ReactCommon/react/renderer/scheduler/SurfaceHandler.h +4 -4
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.h +2 -0
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm +19 -0
- package/ReactCommon/react/renderer/timeline/BUCK +6 -6
- package/ReactCommon/react/renderer/uimanager/UIManagerAnimationDelegate.h +1 -1
- package/ReactCommon/react/test_utils/BUCK +3 -0
- package/ReactCommon/react/test_utils/MockSurfaceHandler.h +25 -0
- package/ReactCommon/react/utils/ContextContainer.h +0 -27
- package/flow/global.js +45 -0
- package/index.js +15 -10
- package/package.json +4 -4
- package/react.gradle +1 -1
- package/scripts/generate-specs-cli.js +18 -0
- package/scripts/ios-configure-glog.sh +4 -0
- package/scripts/react_native_pods.rb +156 -37
- package/template/_flowconfig +1 -1
- package/template/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/template/ios/HelloWorld.xcodeproj/project.pbxproj +0 -2
- package/template/package.json +1 -1
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.android.js +0 -87
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.ios.js +0 -30
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroidTypes.js +0 -30
- package/ReactAndroid/src/androidTest/java/com/facebook/react/tests/DatePickerDialogTestCase.java +0 -172
- package/ReactAndroid/src/androidTest/js/DatePickerDialogTestModule.js +0 -45
- package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/BUCK +0 -27
- package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerDialogFragment.java +0 -137
- package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerDialogModule.java +0 -153
- package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerMode.java +0 -15
- package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DismissableDatePickerDialog.java +0 -117
- package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/BUCK +0 -20
- package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/RuntimeSchedulerManager.java +0 -39
- package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/Android.mk +0 -34
- package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/BUCK +0 -35
- package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/OnLoad.cpp +0 -15
- package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/RuntimeSchedulerManager.cpp +0 -46
- package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/RuntimeSchedulerManager.h +0 -40
- package/scripts/generate-specs.sh +0 -99
- package/template/_editorconfig +0 -3
- package/template/_gitattributes +0 -3
package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java
CHANGED
|
@@ -963,6 +963,25 @@ public class SurfaceMountingManager {
|
|
|
963
963
|
return (ViewGroupManager<ViewGroup>) viewState.mViewManager;
|
|
964
964
|
}
|
|
965
965
|
|
|
966
|
+
public void printSurfaceState() {
|
|
967
|
+
FLog.e(TAG, "Views created for surface {%d}:", getSurfaceId());
|
|
968
|
+
for (ViewState viewState : mTagToViewState.values()) {
|
|
969
|
+
String viewManagerName =
|
|
970
|
+
viewState.mViewManager != null ? viewState.mViewManager.getName() : null;
|
|
971
|
+
@Nullable View view = viewState.mView;
|
|
972
|
+
@Nullable View parent = view != null ? (View) view.getParent() : null;
|
|
973
|
+
@Nullable Integer parentTag = parent != null ? parent.getId() : null;
|
|
974
|
+
|
|
975
|
+
FLog.e(
|
|
976
|
+
TAG,
|
|
977
|
+
"<%s id=%d parentTag=%s isRoot=%b />",
|
|
978
|
+
viewManagerName,
|
|
979
|
+
viewState.mReactTag,
|
|
980
|
+
parentTag,
|
|
981
|
+
viewState.mIsRoot);
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
|
|
966
985
|
/**
|
|
967
986
|
* This class holds view state for react tags. Objects of this class are stored into the {@link
|
|
968
987
|
* #mTagToViewState}, and they should be updated in the same thread.
|
|
@@ -10,7 +10,7 @@ package com.facebook.react.modules.core;
|
|
|
10
10
|
import com.facebook.react.bridge.WritableArray;
|
|
11
11
|
|
|
12
12
|
/** An interface used by {@link JavaTimerManager} to access and call JS timers from Java. */
|
|
13
|
-
public interface
|
|
13
|
+
public interface JavaScriptTimerExecutor {
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Calls the JS callback(s) associated with the timer ID(s). Also unregisters the callback if the
|
|
@@ -81,7 +81,7 @@ public class JavaTimerManager {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
if (mTimersToCall != null) {
|
|
84
|
-
|
|
84
|
+
mJavaScriptTimerExecutor.callTimers(mTimersToCall);
|
|
85
85
|
mTimersToCall = null;
|
|
86
86
|
}
|
|
87
87
|
|
|
@@ -139,7 +139,7 @@ public class JavaTimerManager {
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
if (sendIdleEvents) {
|
|
142
|
-
|
|
142
|
+
mJavaScriptTimerExecutor.callIdleCallbacks(absoluteFrameStartTime);
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
mCurrentIdleCallbackRunnable = null;
|
|
@@ -151,7 +151,7 @@ public class JavaTimerManager {
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
private final ReactApplicationContext mReactApplicationContext;
|
|
154
|
-
private final
|
|
154
|
+
private final JavaScriptTimerExecutor mJavaScriptTimerExecutor;
|
|
155
155
|
private final ReactChoreographer mReactChoreographer;
|
|
156
156
|
private final DevSupportManager mDevSupportManager;
|
|
157
157
|
private final Object mTimerGuard = new Object();
|
|
@@ -169,11 +169,11 @@ public class JavaTimerManager {
|
|
|
169
169
|
|
|
170
170
|
public JavaTimerManager(
|
|
171
171
|
ReactApplicationContext reactContext,
|
|
172
|
-
|
|
172
|
+
JavaScriptTimerExecutor javaScriptTimerManager,
|
|
173
173
|
ReactChoreographer reactChoreographer,
|
|
174
174
|
DevSupportManager devSupportManager) {
|
|
175
175
|
mReactApplicationContext = reactContext;
|
|
176
|
-
|
|
176
|
+
mJavaScriptTimerExecutor = javaScriptTimerManager;
|
|
177
177
|
mReactChoreographer = reactChoreographer;
|
|
178
178
|
mDevSupportManager = devSupportManager;
|
|
179
179
|
|
|
@@ -327,7 +327,7 @@ public class JavaTimerManager {
|
|
|
327
327
|
if (mDevSupportManager.getDevSupportEnabled()) {
|
|
328
328
|
long driftTime = Math.abs(remoteTime - deviceTime);
|
|
329
329
|
if (driftTime > 60000) {
|
|
330
|
-
|
|
330
|
+
mJavaScriptTimerExecutor.emitTimeDriftWarning(
|
|
331
331
|
"Debugger and device times have drifted by more than 60s. Please correct this by "
|
|
332
332
|
+ "running adb shell \"date `date +%m%d%H%M%Y.%S`\" on your debugger machine.");
|
|
333
333
|
}
|
|
@@ -338,7 +338,7 @@ public class JavaTimerManager {
|
|
|
338
338
|
if (duration == 0 && !repeat) {
|
|
339
339
|
WritableArray timerToCall = Arguments.createArray();
|
|
340
340
|
timerToCall.pushInt(callbackID);
|
|
341
|
-
|
|
341
|
+
mJavaScriptTimerExecutor.callTimers(timerToCall);
|
|
342
342
|
return;
|
|
343
343
|
}
|
|
344
344
|
|
|
@@ -22,7 +22,7 @@ import com.facebook.react.module.annotations.ReactModule;
|
|
|
22
22
|
public final class TimingModule extends NativeTimingSpec
|
|
23
23
|
implements LifecycleEventListener, HeadlessJsTaskEventListener {
|
|
24
24
|
|
|
25
|
-
public class
|
|
25
|
+
public class BridgeTimerExecutor implements JavaScriptTimerExecutor {
|
|
26
26
|
@Override
|
|
27
27
|
public void callTimers(WritableArray timerIDs) {
|
|
28
28
|
ReactApplicationContext reactApplicationContext = getReactApplicationContextIfActiveOrWarn();
|
|
@@ -61,7 +61,7 @@ public final class TimingModule extends NativeTimingSpec
|
|
|
61
61
|
mJavaTimerManager =
|
|
62
62
|
new JavaTimerManager(
|
|
63
63
|
reactContext,
|
|
64
|
-
new
|
|
64
|
+
new BridgeTimerExecutor(),
|
|
65
65
|
ReactChoreographer.getInstance(),
|
|
66
66
|
devSupportManager);
|
|
67
67
|
}
|
package/ReactAndroid/src/main/java/com/facebook/react/modules/i18nmanager/I18nManagerModule.java
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
package com.facebook.react.modules.i18nmanager;
|
|
9
9
|
|
|
10
10
|
import android.content.Context;
|
|
11
|
+
import android.os.Build;
|
|
11
12
|
import com.facebook.fbreact.specs.NativeI18nManagerSpec;
|
|
12
13
|
import com.facebook.react.bridge.NativeModule;
|
|
13
14
|
import com.facebook.react.bridge.ReactApplicationContext;
|
|
@@ -36,7 +37,12 @@ public class I18nManagerModule extends NativeI18nManagerSpec {
|
|
|
36
37
|
@Override
|
|
37
38
|
public Map<String, Object> getTypedExportedConstants() {
|
|
38
39
|
final Context context = getReactApplicationContext();
|
|
39
|
-
final Locale locale
|
|
40
|
+
final Locale locale;
|
|
41
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
|
42
|
+
locale = context.getResources().getConfiguration().getLocales().get(0);
|
|
43
|
+
} else {
|
|
44
|
+
locale = context.getResources().getConfiguration().locale;
|
|
45
|
+
}
|
|
40
46
|
|
|
41
47
|
final Map<String, Object> constants = MapBuilder.newHashMap();
|
|
42
48
|
constants.put("isRTL", sharedI18nUtilInstance.isRTL(context));
|
|
@@ -86,25 +86,8 @@ public class IntentModule extends NativeIntentAndroidSpec {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
try {
|
|
89
|
-
Activity currentActivity = getCurrentActivity();
|
|
90
89
|
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url).normalizeScheme());
|
|
91
|
-
|
|
92
|
-
String selfPackageName = getReactApplicationContext().getPackageName();
|
|
93
|
-
ComponentName componentName =
|
|
94
|
-
intent.resolveActivity(getReactApplicationContext().getPackageManager());
|
|
95
|
-
String otherPackageName = (componentName != null ? componentName.getPackageName() : "");
|
|
96
|
-
|
|
97
|
-
// If there is no currentActivity or we are launching to a different package we need to set
|
|
98
|
-
// the FLAG_ACTIVITY_NEW_TASK flag
|
|
99
|
-
if (currentActivity == null || !selfPackageName.equals(otherPackageName)) {
|
|
100
|
-
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
if (currentActivity != null) {
|
|
104
|
-
currentActivity.startActivity(intent);
|
|
105
|
-
} else {
|
|
106
|
-
getReactApplicationContext().startActivity(intent);
|
|
107
|
-
}
|
|
90
|
+
sendOSIntent(intent, false);
|
|
108
91
|
|
|
109
92
|
promise.resolve(true);
|
|
110
93
|
} catch (Exception e) {
|
|
@@ -235,6 +218,27 @@ public class IntentModule extends NativeIntentAndroidSpec {
|
|
|
235
218
|
}
|
|
236
219
|
}
|
|
237
220
|
|
|
238
|
-
|
|
221
|
+
sendOSIntent(intent, true);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
private void sendOSIntent(Intent intent, Boolean useNewTaskFlag) {
|
|
225
|
+
Activity currentActivity = getCurrentActivity();
|
|
226
|
+
|
|
227
|
+
String selfPackageName = getReactApplicationContext().getPackageName();
|
|
228
|
+
ComponentName componentName =
|
|
229
|
+
intent.resolveActivity(getReactApplicationContext().getPackageManager());
|
|
230
|
+
String otherPackageName = (componentName != null ? componentName.getPackageName() : "");
|
|
231
|
+
|
|
232
|
+
// If there is no currentActivity or we are launching to a different package we need to set
|
|
233
|
+
// the FLAG_ACTIVITY_NEW_TASK flag
|
|
234
|
+
if (useNewTaskFlag || currentActivity == null || !selfPackageName.equals(otherPackageName)) {
|
|
235
|
+
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
if (currentActivity != null) {
|
|
239
|
+
currentActivity.startActivity(intent);
|
|
240
|
+
} else {
|
|
241
|
+
getReactApplicationContext().startActivity(intent);
|
|
242
|
+
}
|
|
239
243
|
}
|
|
240
244
|
}
|
package/ReactAndroid/src/main/java/com/facebook/react/modules/network/ForwardingCookieHandler.java
CHANGED
|
@@ -144,10 +144,7 @@ public class ForwardingCookieHandler extends CookieHandler {
|
|
|
144
144
|
// specific exception.
|
|
145
145
|
// https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/webkit/WebViewFactory.java#348
|
|
146
146
|
if (message != null
|
|
147
|
-
&& exception
|
|
148
|
-
.getClass()
|
|
149
|
-
.getCanonicalName()
|
|
150
|
-
.equals("android.webkit.WebViewFactory.MissingWebViewPackageException")) {
|
|
147
|
+
&& exception.getClass().getCanonicalName().contains("MissingWebViewPackageException")) {
|
|
151
148
|
return null;
|
|
152
149
|
} else {
|
|
153
150
|
throw exception;
|
|
@@ -34,7 +34,6 @@ rn_android_library(
|
|
|
34
34
|
react_native_target("java/com/facebook/react/modules/camera:camera"),
|
|
35
35
|
react_native_target("java/com/facebook/react/modules/clipboard:clipboard"),
|
|
36
36
|
react_native_target("java/com/facebook/react/modules/core:core"),
|
|
37
|
-
react_native_target("java/com/facebook/react/modules/datepicker:datepicker"),
|
|
38
37
|
react_native_target("java/com/facebook/react/modules/debug:debug"),
|
|
39
38
|
react_native_target("java/com/facebook/react/modules/dialog:dialog"),
|
|
40
39
|
react_native_target("java/com/facebook/react/modules/fresco:fresco"),
|
|
@@ -23,7 +23,6 @@ import com.facebook.react.modules.blob.BlobModule;
|
|
|
23
23
|
import com.facebook.react.modules.blob.FileReaderModule;
|
|
24
24
|
import com.facebook.react.modules.camera.ImageStoreManager;
|
|
25
25
|
import com.facebook.react.modules.clipboard.ClipboardModule;
|
|
26
|
-
import com.facebook.react.modules.datepicker.DatePickerDialogModule;
|
|
27
26
|
import com.facebook.react.modules.dialog.DialogModule;
|
|
28
27
|
import com.facebook.react.modules.fresco.FrescoModule;
|
|
29
28
|
import com.facebook.react.modules.i18nmanager.I18nManagerModule;
|
|
@@ -72,7 +71,6 @@ import java.util.Map;
|
|
|
72
71
|
FileReaderModule.class,
|
|
73
72
|
AsyncStorageModule.class,
|
|
74
73
|
ClipboardModule.class,
|
|
75
|
-
DatePickerDialogModule.class,
|
|
76
74
|
DialogModule.class,
|
|
77
75
|
FrescoModule.class,
|
|
78
76
|
I18nManagerModule.class,
|
|
@@ -117,8 +115,6 @@ public class MainReactPackage extends TurboReactPackage {
|
|
|
117
115
|
return new AsyncStorageModule(context);
|
|
118
116
|
case ClipboardModule.NAME:
|
|
119
117
|
return new ClipboardModule(context);
|
|
120
|
-
case DatePickerDialogModule.FRAGMENT_TAG:
|
|
121
|
-
return new DatePickerDialogModule(context);
|
|
122
118
|
case DialogModule.NAME:
|
|
123
119
|
return new DialogModule(context);
|
|
124
120
|
case FrescoModule.NAME:
|
|
@@ -199,7 +195,6 @@ public class MainReactPackage extends TurboReactPackage {
|
|
|
199
195
|
FileReaderModule.class,
|
|
200
196
|
AsyncStorageModule.class,
|
|
201
197
|
ClipboardModule.class,
|
|
202
|
-
DatePickerDialogModule.class,
|
|
203
198
|
DialogModule.class,
|
|
204
199
|
FrescoModule.class,
|
|
205
200
|
I18nManagerModule.class,
|
package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.java
CHANGED
|
@@ -110,10 +110,6 @@ public abstract class ReactTextAnchorViewManager<T extends View, C extends React
|
|
|
110
110
|
view.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_NONE);
|
|
111
111
|
} else if (frequency.equals("full")) {
|
|
112
112
|
view.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_FULL);
|
|
113
|
-
} else if (frequency.equals("balanced")) {
|
|
114
|
-
view.setHyphenationFrequency(Layout.BREAK_STRATEGY_BALANCED);
|
|
115
|
-
} else if (frequency.equals("high")) {
|
|
116
|
-
view.setHyphenationFrequency(Layout.BREAK_STRATEGY_HIGH_QUALITY);
|
|
117
113
|
} else if (frequency.equals("normal")) {
|
|
118
114
|
view.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_NORMAL);
|
|
119
115
|
} else {
|
|
@@ -32,6 +32,7 @@ import com.facebook.react.uimanager.ThemedReactContext;
|
|
|
32
32
|
import com.facebook.react.uimanager.UIViewOperationQueue;
|
|
33
33
|
import com.facebook.react.uimanager.annotations.ReactProp;
|
|
34
34
|
import com.facebook.react.uimanager.events.RCTEventEmitter;
|
|
35
|
+
import com.facebook.yoga.YogaBaselineFunction;
|
|
35
36
|
import com.facebook.yoga.YogaConstants;
|
|
36
37
|
import com.facebook.yoga.YogaDirection;
|
|
37
38
|
import com.facebook.yoga.YogaMeasureFunction;
|
|
@@ -159,6 +160,20 @@ public class ReactTextShadowNode extends ReactBaseTextShadowNode {
|
|
|
159
160
|
}
|
|
160
161
|
};
|
|
161
162
|
|
|
163
|
+
private final YogaBaselineFunction mTextBaselineFunction =
|
|
164
|
+
new YogaBaselineFunction() {
|
|
165
|
+
@Override
|
|
166
|
+
public float baseline(YogaNode node, float width, float height) {
|
|
167
|
+
Spannable text =
|
|
168
|
+
Assertions.assertNotNull(
|
|
169
|
+
mPreparedSpannableText,
|
|
170
|
+
"Spannable element has not been prepared in onBeforeLayout");
|
|
171
|
+
|
|
172
|
+
Layout layout = measureSpannedText(text, width, YogaMeasureMode.EXACTLY);
|
|
173
|
+
return layout.getLineBaseline(layout.getLineCount() - 1);
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
|
|
162
177
|
public ReactTextShadowNode() {
|
|
163
178
|
this(null);
|
|
164
179
|
}
|
|
@@ -171,6 +186,7 @@ public class ReactTextShadowNode extends ReactBaseTextShadowNode {
|
|
|
171
186
|
private void initMeasureFunction() {
|
|
172
187
|
if (!isVirtual()) {
|
|
173
188
|
setMeasureFunction(mTextMeasureFunction);
|
|
189
|
+
setBaselineFunction(mTextBaselineFunction);
|
|
174
190
|
}
|
|
175
191
|
}
|
|
176
192
|
|
|
@@ -56,6 +56,7 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
|
|
|
56
56
|
private boolean mAdjustsFontSizeToFit = false;
|
|
57
57
|
private int mLinkifyMaskType = 0;
|
|
58
58
|
private boolean mNotifyOnInlineViewLayout;
|
|
59
|
+
private boolean mTextIsSelectable = false;
|
|
59
60
|
|
|
60
61
|
private ReactViewBackgroundManager mReactBackgroundManager;
|
|
61
62
|
private Spannable mSpanned;
|
|
@@ -433,9 +434,16 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
|
|
|
433
434
|
}
|
|
434
435
|
}
|
|
435
436
|
|
|
437
|
+
@Override
|
|
438
|
+
public void setTextIsSelectable(boolean selectable) {
|
|
439
|
+
mTextIsSelectable = selectable;
|
|
440
|
+
super.setTextIsSelectable(selectable);
|
|
441
|
+
}
|
|
442
|
+
|
|
436
443
|
@Override
|
|
437
444
|
public void onAttachedToWindow() {
|
|
438
445
|
super.onAttachedToWindow();
|
|
446
|
+
setTextIsSelectable(mTextIsSelectable);
|
|
439
447
|
if (mContainsImages && getText() instanceof Spanned) {
|
|
440
448
|
Spanned text = (Spanned) getText();
|
|
441
449
|
TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
|
|
@@ -68,9 +68,10 @@ public class TextAttributeProps {
|
|
|
68
68
|
private static final int DEFAULT_TEXT_SHADOW_COLOR = 0x55000000;
|
|
69
69
|
private static final int DEFAULT_JUSTIFICATION_MODE =
|
|
70
70
|
(Build.VERSION.SDK_INT < Build.VERSION_CODES.O) ? 0 : Layout.JUSTIFICATION_MODE_NONE;
|
|
71
|
-
|
|
72
71
|
private static final int DEFAULT_BREAK_STRATEGY =
|
|
73
72
|
(Build.VERSION.SDK_INT < Build.VERSION_CODES.M) ? 0 : Layout.BREAK_STRATEGY_HIGH_QUALITY;
|
|
73
|
+
private static final int DEFAULT_HYPHENATION_FREQUENCY =
|
|
74
|
+
(Build.VERSION.SDK_INT < Build.VERSION_CODES.M) ? 0 : Layout.HYPHENATION_FREQUENCY_NONE;
|
|
74
75
|
|
|
75
76
|
protected float mLineHeight = Float.NaN;
|
|
76
77
|
protected boolean mIsColorSet = false;
|
|
@@ -568,4 +569,22 @@ public class TextAttributeProps {
|
|
|
568
569
|
}
|
|
569
570
|
return androidTextBreakStrategy;
|
|
570
571
|
}
|
|
572
|
+
|
|
573
|
+
public static int getHyphenationFrequency(@Nullable String hyphenationFrequency) {
|
|
574
|
+
int androidHyphenationFrequency = DEFAULT_HYPHENATION_FREQUENCY;
|
|
575
|
+
if (hyphenationFrequency != null) {
|
|
576
|
+
switch (hyphenationFrequency) {
|
|
577
|
+
case "none":
|
|
578
|
+
androidHyphenationFrequency = Layout.HYPHENATION_FREQUENCY_NONE;
|
|
579
|
+
break;
|
|
580
|
+
case "normal":
|
|
581
|
+
androidHyphenationFrequency = Layout.HYPHENATION_FREQUENCY_NORMAL;
|
|
582
|
+
break;
|
|
583
|
+
default:
|
|
584
|
+
androidHyphenationFrequency = Layout.HYPHENATION_FREQUENCY_FULL;
|
|
585
|
+
break;
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
return androidHyphenationFrequency;
|
|
589
|
+
}
|
|
571
590
|
}
|
|
@@ -64,6 +64,7 @@ public class TextLayoutManager {
|
|
|
64
64
|
private static final boolean DEFAULT_INCLUDE_FONT_PADDING = true;
|
|
65
65
|
private static final String INCLUDE_FONT_PADDING_KEY = "includeFontPadding";
|
|
66
66
|
private static final String TEXT_BREAK_STRATEGY_KEY = "textBreakStrategy";
|
|
67
|
+
private static final String HYPHENATION_FREQUENCY_KEY = "android_hyphenationFrequency";
|
|
67
68
|
private static final String MAXIMUM_NUMBER_OF_LINES_KEY = "maximumNumberOfLines";
|
|
68
69
|
private static final LruCache<ReadableNativeMap, Spannable> sSpannableCache =
|
|
69
70
|
new LruCache<>(spannableCacheSize);
|
|
@@ -250,7 +251,8 @@ public class TextLayoutManager {
|
|
|
250
251
|
float width,
|
|
251
252
|
YogaMeasureMode widthYogaMeasureMode,
|
|
252
253
|
boolean includeFontPadding,
|
|
253
|
-
int textBreakStrategy
|
|
254
|
+
int textBreakStrategy,
|
|
255
|
+
int hyphenationFrequency) {
|
|
254
256
|
Layout layout;
|
|
255
257
|
int spanLength = text.length();
|
|
256
258
|
boolean unconstrainedWidth = widthYogaMeasureMode == YogaMeasureMode.UNDEFINED || width < 0;
|
|
@@ -281,10 +283,9 @@ public class TextLayoutManager {
|
|
|
281
283
|
.setLineSpacing(0.f, 1.f)
|
|
282
284
|
.setIncludePad(includeFontPadding)
|
|
283
285
|
.setBreakStrategy(textBreakStrategy)
|
|
284
|
-
.setHyphenationFrequency(
|
|
286
|
+
.setHyphenationFrequency(hyphenationFrequency)
|
|
285
287
|
.build();
|
|
286
288
|
}
|
|
287
|
-
|
|
288
289
|
} else if (boring != null && (unconstrainedWidth || boring.width <= width)) {
|
|
289
290
|
int boringLayoutWidth = boring.width;
|
|
290
291
|
if (boring.width < 0) {
|
|
@@ -325,7 +326,7 @@ public class TextLayoutManager {
|
|
|
325
326
|
.setLineSpacing(0.f, 1.f)
|
|
326
327
|
.setIncludePad(includeFontPadding)
|
|
327
328
|
.setBreakStrategy(textBreakStrategy)
|
|
328
|
-
.setHyphenationFrequency(
|
|
329
|
+
.setHyphenationFrequency(hyphenationFrequency);
|
|
329
330
|
|
|
330
331
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
|
331
332
|
builder.setUseLineSpacingFromFallbacks(true);
|
|
@@ -378,6 +379,9 @@ public class TextLayoutManager {
|
|
|
378
379
|
paragraphAttributes.hasKey(INCLUDE_FONT_PADDING_KEY)
|
|
379
380
|
? paragraphAttributes.getBoolean(INCLUDE_FONT_PADDING_KEY)
|
|
380
381
|
: DEFAULT_INCLUDE_FONT_PADDING;
|
|
382
|
+
int hyphenationFrequency =
|
|
383
|
+
TextAttributeProps.getHyphenationFrequency(
|
|
384
|
+
paragraphAttributes.getString(HYPHENATION_FREQUENCY_KEY));
|
|
381
385
|
|
|
382
386
|
if (text == null) {
|
|
383
387
|
throw new IllegalStateException("Spannable element has not been prepared in onBeforeLayout");
|
|
@@ -387,7 +391,13 @@ public class TextLayoutManager {
|
|
|
387
391
|
|
|
388
392
|
Layout layout =
|
|
389
393
|
createLayout(
|
|
390
|
-
text,
|
|
394
|
+
text,
|
|
395
|
+
boring,
|
|
396
|
+
width,
|
|
397
|
+
widthYogaMeasureMode,
|
|
398
|
+
includeFontPadding,
|
|
399
|
+
textBreakStrategy,
|
|
400
|
+
hyphenationFrequency);
|
|
391
401
|
|
|
392
402
|
int maximumNumberOfLines =
|
|
393
403
|
paragraphAttributes.hasKey(MAXIMUM_NUMBER_OF_LINES_KEY)
|
|
@@ -539,10 +549,19 @@ public class TextLayoutManager {
|
|
|
539
549
|
paragraphAttributes.hasKey(INCLUDE_FONT_PADDING_KEY)
|
|
540
550
|
? paragraphAttributes.getBoolean(INCLUDE_FONT_PADDING_KEY)
|
|
541
551
|
: DEFAULT_INCLUDE_FONT_PADDING;
|
|
552
|
+
int hyphenationFrequency =
|
|
553
|
+
TextAttributeProps.getTextBreakStrategy(
|
|
554
|
+
paragraphAttributes.getString(HYPHENATION_FREQUENCY_KEY));
|
|
542
555
|
|
|
543
556
|
Layout layout =
|
|
544
557
|
createLayout(
|
|
545
|
-
text,
|
|
558
|
+
text,
|
|
559
|
+
boring,
|
|
560
|
+
width,
|
|
561
|
+
YogaMeasureMode.EXACTLY,
|
|
562
|
+
includeFontPadding,
|
|
563
|
+
textBreakStrategy,
|
|
564
|
+
hyphenationFrequency);
|
|
546
565
|
return FontMetricsUtil.getFontMetrics(text, layout, sTextPaintInstance, context);
|
|
547
566
|
}
|
|
548
567
|
|
package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java
CHANGED
|
@@ -61,6 +61,7 @@ public class TextLayoutManagerMapBuffer {
|
|
|
61
61
|
public static final short PA_KEY_TEXT_BREAK_STRATEGY = 2;
|
|
62
62
|
public static final short PA_KEY_ADJUST_FONT_SIZE_TO_FIT = 3;
|
|
63
63
|
public static final short PA_KEY_INCLUDE_FONT_PADDING = 4;
|
|
64
|
+
public static final short PA_KEY_HYPHENATION_FREQUENCY = 5;
|
|
64
65
|
|
|
65
66
|
private static final boolean ENABLE_MEASURE_LOGGING = ReactBuildConfig.DEBUG && false;
|
|
66
67
|
|
|
@@ -264,7 +265,8 @@ public class TextLayoutManagerMapBuffer {
|
|
|
264
265
|
float width,
|
|
265
266
|
YogaMeasureMode widthYogaMeasureMode,
|
|
266
267
|
boolean includeFontPadding,
|
|
267
|
-
int textBreakStrategy
|
|
268
|
+
int textBreakStrategy,
|
|
269
|
+
int hyphenationFrequency) {
|
|
268
270
|
Layout layout;
|
|
269
271
|
int spanLength = text.length();
|
|
270
272
|
boolean unconstrainedWidth = widthYogaMeasureMode == YogaMeasureMode.UNDEFINED || width < 0;
|
|
@@ -295,7 +297,7 @@ public class TextLayoutManagerMapBuffer {
|
|
|
295
297
|
.setLineSpacing(0.f, 1.f)
|
|
296
298
|
.setIncludePad(includeFontPadding)
|
|
297
299
|
.setBreakStrategy(textBreakStrategy)
|
|
298
|
-
.setHyphenationFrequency(
|
|
300
|
+
.setHyphenationFrequency(hyphenationFrequency)
|
|
299
301
|
.build();
|
|
300
302
|
}
|
|
301
303
|
|
|
@@ -338,7 +340,7 @@ public class TextLayoutManagerMapBuffer {
|
|
|
338
340
|
.setLineSpacing(0.f, 1.f)
|
|
339
341
|
.setIncludePad(includeFontPadding)
|
|
340
342
|
.setBreakStrategy(textBreakStrategy)
|
|
341
|
-
.setHyphenationFrequency(
|
|
343
|
+
.setHyphenationFrequency(hyphenationFrequency);
|
|
342
344
|
|
|
343
345
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
|
344
346
|
builder.setUseLineSpacingFromFallbacks(true);
|
|
@@ -391,6 +393,9 @@ public class TextLayoutManagerMapBuffer {
|
|
|
391
393
|
paragraphAttributes.hasKey(PA_KEY_INCLUDE_FONT_PADDING)
|
|
392
394
|
? paragraphAttributes.getBoolean(PA_KEY_INCLUDE_FONT_PADDING)
|
|
393
395
|
: DEFAULT_INCLUDE_FONT_PADDING;
|
|
396
|
+
int hyphenationFrequency =
|
|
397
|
+
TextAttributeProps.getTextBreakStrategy(
|
|
398
|
+
paragraphAttributes.getString(PA_KEY_HYPHENATION_FREQUENCY));
|
|
394
399
|
|
|
395
400
|
if (text == null) {
|
|
396
401
|
throw new IllegalStateException("Spannable element has not been prepared in onBeforeLayout");
|
|
@@ -404,7 +409,13 @@ public class TextLayoutManagerMapBuffer {
|
|
|
404
409
|
|
|
405
410
|
Layout layout =
|
|
406
411
|
createLayout(
|
|
407
|
-
text,
|
|
412
|
+
text,
|
|
413
|
+
boring,
|
|
414
|
+
width,
|
|
415
|
+
widthYogaMeasureMode,
|
|
416
|
+
includeFontPadding,
|
|
417
|
+
textBreakStrategy,
|
|
418
|
+
hyphenationFrequency);
|
|
408
419
|
|
|
409
420
|
int maximumNumberOfLines =
|
|
410
421
|
paragraphAttributes.hasKey(PA_KEY_MAX_NUMBER_OF_LINES)
|
|
@@ -561,10 +572,19 @@ public class TextLayoutManagerMapBuffer {
|
|
|
561
572
|
paragraphAttributes.hasKey(PA_KEY_INCLUDE_FONT_PADDING)
|
|
562
573
|
? paragraphAttributes.getBoolean(PA_KEY_INCLUDE_FONT_PADDING)
|
|
563
574
|
: DEFAULT_INCLUDE_FONT_PADDING;
|
|
575
|
+
int hyphenationFrequency =
|
|
576
|
+
TextAttributeProps.getTextBreakStrategy(
|
|
577
|
+
paragraphAttributes.getString(PA_KEY_HYPHENATION_FREQUENCY));
|
|
564
578
|
|
|
565
579
|
Layout layout =
|
|
566
580
|
createLayout(
|
|
567
|
-
text,
|
|
581
|
+
text,
|
|
582
|
+
boring,
|
|
583
|
+
width,
|
|
584
|
+
YogaMeasureMode.EXACTLY,
|
|
585
|
+
includeFontPadding,
|
|
586
|
+
textBreakStrategy,
|
|
587
|
+
hyphenationFrequency);
|
|
568
588
|
return FontMetricsUtil.getFontMetrics(text, layout, sTextPaintInstance, context);
|
|
569
589
|
}
|
|
570
590
|
|
|
@@ -131,10 +131,13 @@ class ReactEditTextInputConnectionWrapper extends InputConnectionWrapper {
|
|
|
131
131
|
@Override
|
|
132
132
|
public boolean sendKeyEvent(KeyEvent event) {
|
|
133
133
|
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
|
134
|
+
boolean isNumberKey = event.getUnicodeChar() < 58 && event.getUnicodeChar() > 47;
|
|
134
135
|
if (event.getKeyCode() == KeyEvent.KEYCODE_DEL) {
|
|
135
136
|
dispatchKeyEvent(BACKSPACE_KEY_VALUE);
|
|
136
137
|
} else if (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) {
|
|
137
138
|
dispatchKeyEvent(ENTER_KEY_VALUE);
|
|
139
|
+
} else if (isNumberKey) {
|
|
140
|
+
dispatchKeyEvent(String.valueOf(event.getNumber()));
|
|
138
141
|
}
|
|
139
142
|
}
|
|
140
143
|
return super.sendKeyEvent(event);
|
|
@@ -27,7 +27,7 @@ LOCAL_CFLAGS += -fexceptions -frtti -Wno-unused-lambda-capture
|
|
|
27
27
|
LOCAL_LDLIBS += -landroid
|
|
28
28
|
|
|
29
29
|
# The dynamic libraries (.so files) that this module depends on.
|
|
30
|
-
LOCAL_SHARED_LIBRARIES := libfolly_json libfb libfbjni libglog_init libyoga
|
|
30
|
+
LOCAL_SHARED_LIBRARIES := libfolly_json libfb libfbjni libglog_init libyoga libreact_render_runtimescheduler
|
|
31
31
|
|
|
32
32
|
# The static libraries (.a files) that this module depends on.
|
|
33
33
|
LOCAL_STATIC_LIBRARIES := libreactnative libcallinvokerholder libruntimeexecutor
|
|
@@ -77,7 +77,7 @@ LOCAL_CFLAGS += -fexceptions -frtti -Wno-unused-lambda-capture
|
|
|
77
77
|
LOCAL_LDLIBS += -landroid
|
|
78
78
|
|
|
79
79
|
# The dynamic libraries (.so files) that this module depends on.
|
|
80
|
-
LOCAL_SHARED_LIBRARIES := libreactnativeutilsjni libfolly_json libfb libfbjni libglog_init libyoga logger
|
|
80
|
+
LOCAL_SHARED_LIBRARIES := libreactnativeutilsjni libfolly_json libfb libfbjni libglog_init libyoga logger libreact_render_runtimescheduler
|
|
81
81
|
|
|
82
82
|
# The static libraries (.a files) that this module depends on.
|
|
83
83
|
LOCAL_STATIC_LIBRARIES := libreactnative libruntimeexecutor libcallinvokerholder
|
|
@@ -129,6 +129,7 @@ $(call import-module,callinvoker)
|
|
|
129
129
|
$(call import-module,reactperflogger)
|
|
130
130
|
$(call import-module,hermes)
|
|
131
131
|
$(call import-module,runtimeexecutor)
|
|
132
|
+
$(call import-module,react/renderer/runtimescheduler)
|
|
132
133
|
$(call import-module,react/nativemodule/core)
|
|
133
134
|
|
|
134
135
|
include $(REACT_SRC_DIR)/reactperflogger/jni/Android.mk
|
|
@@ -20,6 +20,7 @@ EXPORTED_HEADERS = [
|
|
|
20
20
|
"ReadableNativeArray.h",
|
|
21
21
|
"ReadableNativeMap.h",
|
|
22
22
|
"JRuntimeExecutor.h",
|
|
23
|
+
"JRuntimeScheduler.h",
|
|
23
24
|
"WritableNativeArray.h",
|
|
24
25
|
"WritableNativeMap.h",
|
|
25
26
|
]
|
|
@@ -67,6 +68,7 @@ rn_xplat_cxx_library(
|
|
|
67
68
|
react_native_xplat_target("cxxreact:module"),
|
|
68
69
|
react_native_xplat_target("jsinspector:jsinspector"),
|
|
69
70
|
react_native_xplat_target("runtimeexecutor:runtimeexecutor"),
|
|
71
|
+
react_native_xplat_target("react/renderer/runtimescheduler:runtimescheduler"),
|
|
70
72
|
react_native_xplat_target("logger:logger"),
|
|
71
73
|
react_native_xplat_dep("jsi:jsi"),
|
|
72
74
|
FBJNI_TARGET,
|
|
@@ -27,11 +27,14 @@
|
|
|
27
27
|
#include <fbjni/ByteBuffer.h>
|
|
28
28
|
#include <folly/dynamic.h>
|
|
29
29
|
#include <glog/logging.h>
|
|
30
|
+
#include <react/renderer/runtimescheduler/RuntimeScheduler.h>
|
|
31
|
+
#include <react/renderer/runtimescheduler/RuntimeSchedulerBinding.h>
|
|
30
32
|
|
|
31
33
|
#include <logger/react_native_log.h>
|
|
32
34
|
|
|
33
35
|
#include "CxxModuleWrapper.h"
|
|
34
36
|
#include "JNativeRunnable.h"
|
|
37
|
+
#include "JReactCxxErrorHandler.h"
|
|
35
38
|
#include "JReactSoftExceptionLogger.h"
|
|
36
39
|
#include "JavaScriptExecutorHolder.h"
|
|
37
40
|
#include "JniJSModulesUnbundle.h"
|
|
@@ -135,6 +138,11 @@ void CatalystInstanceImpl::registerNatives() {
|
|
|
135
138
|
CatalystInstanceImpl::handleMemoryPressure),
|
|
136
139
|
makeNativeMethod(
|
|
137
140
|
"getRuntimeExecutor", CatalystInstanceImpl::getRuntimeExecutor),
|
|
141
|
+
makeNativeMethod(
|
|
142
|
+
"getRuntimeScheduler", CatalystInstanceImpl::getRuntimeScheduler),
|
|
143
|
+
makeNativeMethod(
|
|
144
|
+
"installRuntimeScheduler",
|
|
145
|
+
CatalystInstanceImpl::installRuntimeScheduler),
|
|
138
146
|
makeNativeMethod(
|
|
139
147
|
"warnOnLegacyNativeModuleSystemUse",
|
|
140
148
|
CatalystInstanceImpl::warnOnLegacyNativeModuleSystemUse),
|
|
@@ -155,6 +163,7 @@ void log(ReactNativeLogLevel level, const char *message) {
|
|
|
155
163
|
break;
|
|
156
164
|
case ReactNativeLogLevelError:
|
|
157
165
|
LOG(ERROR) << message;
|
|
166
|
+
JReactCxxErrorHandler::handleError(message);
|
|
158
167
|
break;
|
|
159
168
|
case ReactNativeLogLevelFatal:
|
|
160
169
|
LOG(FATAL) << message;
|
|
@@ -386,5 +395,25 @@ CatalystInstanceImpl::getRuntimeExecutor() {
|
|
|
386
395
|
return runtimeExecutor_;
|
|
387
396
|
}
|
|
388
397
|
|
|
398
|
+
jni::alias_ref<JRuntimeScheduler::javaobject>
|
|
399
|
+
CatalystInstanceImpl::getRuntimeScheduler() {
|
|
400
|
+
return runtimeScheduler_;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
void CatalystInstanceImpl::installRuntimeScheduler() {
|
|
404
|
+
if (!runtimeScheduler_) {
|
|
405
|
+
auto runtimeExecutor = instance_->getRuntimeExecutor();
|
|
406
|
+
auto runtimeScheduler = std::make_shared<RuntimeScheduler>(runtimeExecutor);
|
|
407
|
+
|
|
408
|
+
runtimeScheduler_ =
|
|
409
|
+
jni::make_global(JRuntimeScheduler::newObjectCxxArgs(runtimeScheduler));
|
|
410
|
+
|
|
411
|
+
runtimeExecutor([runtimeScheduler](jsi::Runtime &runtime) {
|
|
412
|
+
RuntimeSchedulerBinding::createAndInstallIfNeeded(
|
|
413
|
+
runtime, runtimeScheduler);
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
389
418
|
} // namespace react
|
|
390
419
|
} // namespace facebook
|