Compare commits

...
1 Commits
Author SHA1 Message Date
Nivaldo BondançaandFacebook GitHub Bot e685f52e7b Codemod format for trailing commas incoming change [300/n]
Summary:
Adding trailing commas to folders:
- xplat/js/react-native-github/packages/react-native
- xplat/kotlin/ast_tools/core/src
- xplat/kotlin_compiler_plugins/template/src/main
- xplat/kotlin/kotlin_multiplatform_template/src/commonMain
- xplat/libraries/bloks/bloks-debugging/src
- xplat/libraries/bloks/bloks-lispy/src
- xplat/libraries/bloks/bloks-step-debugger/src
- xplat/mdv/uifiddle-prototype/android-server/playground
- xplat/mdv/uifiddle-prototype/android-server/server
- xplat/oxygen/common/src/test
- xplat/oxygen/mpts/src/main
- xplat/oxygen/mpts/src/test
- xplat/prototypes/smartglasses/AndroidStudioProjects/MetaAccessoryTest
- xplat/prototypes/smartglasses/AndroidStudioProjects/MetaWearableSDKSampleApp
- xplat/prototypes/smartglasses/AndroidStudioProjects/MetaWearableSDK
- xplat/prototypes/smartglasses/AndroidStudioProjects/Voice
- xplat/ReactNative/react-native-cxx/react/renderer
- xplat/rtc/media/tools/audio
- xplat/security/prodsec/android/codetransparency
- xplat/security/prodsec/siggy/java
- xplat/simplesql/codegen/java/com
- xplat/sonar/android/plugins/jetpack-compose
- xplat/sonar/android/plugins/leakcanary2
- xplat/sonar/android/plugins/litho
- xplat/sonar/android/plugins/retrofit2-protobuf
- xplat/sonar/android/sample/src
- xplat/sonar/android/src/facebook

Differential Revision: D80452590
2025-08-18 09:30:37 -07:00
8 changed files with 61 additions and 39 deletions
@@ -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
@@ -220,7 +220,8 @@ public abstract class DevSupportManagerBase(
}
context
},
{ openDebugger() })
{ openDebugger() },
)
}
}
@@ -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
@@ -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) {
@@ -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 {
@@ -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,
)
}