mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
1
Commits
main
...
export-D80452590
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e685f52e7b |
+1
-2
@@ -52,8 +52,7 @@ internal class DebugServerException : RuntimeException {
|
||||
|\u2022 If you're on a physical device connected to the same machine, run 'adb reverse tcp:<PORT> tcp:<PORT> to forward requests from your device
|
||||
|\u2022 If your device is on the same Wi-Fi network, set 'Debug server host & port for device' in 'Dev settings' to your machine's IP address and the port of the local dev server - e.g. 10.0.1.1:<PORT>
|
||||
|
|
||||
|
|
||||
"""
|
||||
|"""
|
||||
.trimMargin()
|
||||
|
||||
@JvmStatic
|
||||
|
||||
+2
-1
@@ -220,7 +220,8 @@ public abstract class DevSupportManagerBase(
|
||||
}
|
||||
context
|
||||
},
|
||||
{ openDebugger() })
|
||||
{ openDebugger() },
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+9
-3
@@ -30,7 +30,7 @@ import java.util.Locale
|
||||
|
||||
internal class PerfMonitorOverlayViewManager(
|
||||
private val contextSupplier: Supplier<Context?>,
|
||||
private val onRequestAnalyzeTrace: () -> Unit
|
||||
private val onRequestAnalyzeTrace: () -> Unit,
|
||||
) : PerfMonitorOverlayManager {
|
||||
private var initialized: Boolean = false
|
||||
private var enabled: Boolean = false
|
||||
@@ -151,7 +151,11 @@ internal class PerfMonitorOverlayViewManager(
|
||||
LinearLayout(context).apply {
|
||||
orientation = LinearLayout.VERTICAL
|
||||
setPadding(
|
||||
dpToPx(8f).toInt(), dpToPx(16f).toInt(), dpToPx(16f).toInt(), dpToPx(8f).toInt())
|
||||
dpToPx(8f).toInt(),
|
||||
dpToPx(16f).toInt(),
|
||||
dpToPx(16f).toInt(),
|
||||
dpToPx(8f).toInt(),
|
||||
)
|
||||
addView(buttonInner)
|
||||
setOnClickListener { onRequestAnalyzeTrace() }
|
||||
}
|
||||
@@ -205,7 +209,9 @@ internal class PerfMonitorOverlayViewManager(
|
||||
setPadding(paddingHorizontal, paddingVertical, paddingHorizontal, paddingVertical)
|
||||
layoutParams =
|
||||
LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT)
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||
)
|
||||
background =
|
||||
GradientDrawable().apply {
|
||||
shape = GradientDrawable.RECTANGLE
|
||||
|
||||
+4
-4
@@ -37,10 +37,10 @@ public object LegacyArchitectureShadowNodeLogger {
|
||||
if (implementsYogaMeasureFunction && !annotatedWithCxxImpl) {
|
||||
val message =
|
||||
"""
|
||||
[Legacy Architecture] The ViewManager `$viewManagerName` is unlikely to work with the New Architecture.
|
||||
That's because the shadow node `${shadowNodeClass.simpleName}` implements the `YogaMeasureFunction.measure()` method.
|
||||
This is not supported in the New Architecture as shadow nodes with custom measurements should be implemented in C++.
|
||||
"""
|
||||
[Legacy Architecture] The ViewManager `$viewManagerName` is unlikely to work with the New Architecture.
|
||||
That's because the shadow node `${shadowNodeClass.simpleName}` implements the `YogaMeasureFunction.measure()` method.
|
||||
This is not supported in the New Architecture as shadow nodes with custom measurements should be implemented in C++.
|
||||
"""
|
||||
.trimIndent()
|
||||
|
||||
if (ReactBuildConfig.DEBUG) {
|
||||
|
||||
+14
-14
@@ -114,20 +114,20 @@ public class TextAttributes {
|
||||
|
||||
override fun toString(): String =
|
||||
"""
|
||||
TextAttributes {
|
||||
getAllowFontScaling(): $allowFontScaling
|
||||
getFontSize(): $fontSize
|
||||
getEffectiveFontSize(): $effectiveFontSize
|
||||
getHeightOfTallestInlineViewOrImage(): $heightOfTallestInlineViewOrImage
|
||||
getLetterSpacing(): $letterSpacing
|
||||
getEffectiveLetterSpacing(): $effectiveLetterSpacing
|
||||
getLineHeight(): $lineHeight
|
||||
getEffectiveLineHeight(): $effectiveLineHeight
|
||||
getTextTransform(): $textTransform
|
||||
getMaxFontSizeMultiplier(): $maxFontSizeMultiplier
|
||||
getEffectiveMaxFontSizeMultiplier(): $effectiveMaxFontSizeMultiplier
|
||||
}
|
||||
"""
|
||||
TextAttributes {
|
||||
getAllowFontScaling(): $allowFontScaling
|
||||
getFontSize(): $fontSize
|
||||
getEffectiveFontSize(): $effectiveFontSize
|
||||
getHeightOfTallestInlineViewOrImage(): $heightOfTallestInlineViewOrImage
|
||||
getLetterSpacing(): $letterSpacing
|
||||
getEffectiveLetterSpacing(): $effectiveLetterSpacing
|
||||
getLineHeight(): $lineHeight
|
||||
getEffectiveLineHeight(): $effectiveLineHeight
|
||||
getTextTransform(): $textTransform
|
||||
getMaxFontSizeMultiplier(): $maxFontSizeMultiplier
|
||||
getEffectiveMaxFontSizeMultiplier(): $effectiveMaxFontSizeMultiplier
|
||||
}
|
||||
"""
|
||||
.trimIndent()
|
||||
|
||||
internal companion object {
|
||||
|
||||
+21
-5
@@ -84,7 +84,7 @@ public class ReactVirtualViewExperimental(context: Context) :
|
||||
oldLeft: Int,
|
||||
oldTop: Int,
|
||||
oldRight: Int,
|
||||
oldBottom: Int
|
||||
oldBottom: Int,
|
||||
) {
|
||||
if (oldLeft != left || oldTop != top) {
|
||||
updateParentOffset()
|
||||
@@ -128,7 +128,11 @@ public class ReactVirtualViewExperimental(context: Context) :
|
||||
if (renderState == VirtualViewRenderState.Unknown) {
|
||||
// Feature flag is disabled, so use the former logic.
|
||||
modeChangeEmitter?.emitModeChange(
|
||||
VirtualViewMode.Visible, containerRelativeRect, thresholdRect, synchronous = true)
|
||||
VirtualViewMode.Visible,
|
||||
containerRelativeRect,
|
||||
thresholdRect,
|
||||
synchronous = true,
|
||||
)
|
||||
} else {
|
||||
// If the previous mode was prerender and the result of dispatching that event was
|
||||
// committed, we do not need to dispatch an event for visible.
|
||||
@@ -136,19 +140,31 @@ public class ReactVirtualViewExperimental(context: Context) :
|
||||
oldMode == VirtualViewMode.Prerender && renderState == VirtualViewRenderState.Rendered
|
||||
if (!wasPrerenderCommitted) {
|
||||
modeChangeEmitter?.emitModeChange(
|
||||
VirtualViewMode.Visible, containerRelativeRect, thresholdRect, synchronous = true)
|
||||
VirtualViewMode.Visible,
|
||||
containerRelativeRect,
|
||||
thresholdRect,
|
||||
synchronous = true,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
VirtualViewMode.Prerender -> {
|
||||
if (oldMode != VirtualViewMode.Visible) {
|
||||
modeChangeEmitter?.emitModeChange(
|
||||
VirtualViewMode.Prerender, containerRelativeRect, thresholdRect, synchronous = false)
|
||||
VirtualViewMode.Prerender,
|
||||
containerRelativeRect,
|
||||
thresholdRect,
|
||||
synchronous = false,
|
||||
)
|
||||
}
|
||||
}
|
||||
VirtualViewMode.Hidden -> {
|
||||
modeChangeEmitter?.emitModeChange(
|
||||
VirtualViewMode.Hidden, containerRelativeRect, thresholdRect, synchronous = false)
|
||||
VirtualViewMode.Hidden,
|
||||
containerRelativeRect,
|
||||
thresholdRect,
|
||||
synchronous = false,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ package com.facebook.yoga
|
||||
public abstract class YogaConfig {
|
||||
public abstract fun setExperimentalFeatureEnabled(
|
||||
feature: YogaExperimentalFeature,
|
||||
enabled: Boolean
|
||||
enabled: Boolean,
|
||||
)
|
||||
|
||||
public abstract fun setUseWebDefaults(useWebDefaults: Boolean)
|
||||
|
||||
@@ -26,7 +26,7 @@ public object YogaNative {
|
||||
public external fun jni_YGConfigSetExperimentalFeatureEnabledJNI(
|
||||
nativePointer: Long,
|
||||
feature: Int,
|
||||
enabled: Boolean
|
||||
enabled: Boolean,
|
||||
)
|
||||
|
||||
@JvmStatic
|
||||
@@ -59,7 +59,7 @@ public object YogaNative {
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeSetIsReferenceBaselineJNI(
|
||||
nativePointer: Long,
|
||||
isReferenceBaseline: Boolean
|
||||
isReferenceBaseline: Boolean,
|
||||
)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeIsReferenceBaselineJNI(nativePointer: Long): Boolean
|
||||
@@ -74,7 +74,7 @@ public object YogaNative {
|
||||
width: Float,
|
||||
height: Float,
|
||||
nativePointers: LongArray,
|
||||
nodes: Array<YogaNodeJNIBase>
|
||||
nodes: Array<YogaNodeJNIBase>,
|
||||
)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeMarkDirtyJNI(nativePointer: Long)
|
||||
@@ -171,7 +171,7 @@ public object YogaNative {
|
||||
public external fun jni_YGNodeStyleSetMarginPercentJNI(
|
||||
nativePointer: Long,
|
||||
edge: Int,
|
||||
percent: Float
|
||||
percent: Float,
|
||||
)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetMarginAutoJNI(nativePointer: Long, edge: Int)
|
||||
@@ -185,7 +185,7 @@ public object YogaNative {
|
||||
public external fun jni_YGNodeStyleSetPaddingPercentJNI(
|
||||
nativePointer: Long,
|
||||
edge: Int,
|
||||
percent: Float
|
||||
percent: Float,
|
||||
)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleGetBorderJNI(nativePointer: Long, edge: Int): Float
|
||||
@@ -202,7 +202,7 @@ public object YogaNative {
|
||||
public external fun jni_YGNodeStyleSetPositionPercentJNI(
|
||||
nativePointer: Long,
|
||||
edge: Int,
|
||||
percent: Float
|
||||
percent: Float,
|
||||
)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetPositionAutoJNI(nativePointer: Long, edge: Int)
|
||||
@@ -305,7 +305,7 @@ public object YogaNative {
|
||||
public external fun jni_YGNodeStyleSetGapPercentJNI(
|
||||
nativePointer: Long,
|
||||
gutter: Int,
|
||||
gapLength: Float
|
||||
gapLength: Float,
|
||||
)
|
||||
|
||||
@JvmStatic
|
||||
@@ -318,7 +318,7 @@ public object YogaNative {
|
||||
public external fun jni_YGNodeSetStyleInputsJNI(
|
||||
nativePointer: Long,
|
||||
styleInputsArray: FloatArray,
|
||||
size: Int
|
||||
size: Int,
|
||||
)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeCloneJNI(nativePointer: Long): Long
|
||||
@@ -326,6 +326,6 @@ public object YogaNative {
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeSetAlwaysFormsContainingBlockJNI(
|
||||
nativePointer: Long,
|
||||
alwaysFormContainingBlock: Boolean
|
||||
alwaysFormContainingBlock: Boolean,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user