Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
package com.facebook.hermes.instrumentation

import com.facebook.soloader.SoLoader
import com.facebook.soloader.annotation.SoLoaderLibrary

/** Hermes sampling profiler static JSI API. */
@SoLoaderLibrary("jsijniprofiler")
public object HermesSamplingProfiler {
init {
SoLoader.loadLibrary("jsijniprofiler")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ internal class CxxInspectorPackagerConnection(
deviceName: String,
packageName: String,
) : IInspectorPackagerConnection {
@DoNotStrip private val mHybridData: HybridData
@Suppress("NoHungarianNotation") // fbjni accesses this field by name "mHybridData"
@DoNotStrip
private val mHybridData: HybridData

init {
mHybridData = initHybrid(url, deviceName, packageName, DelegateImpl())
Expand All @@ -48,7 +50,12 @@ internal class CxxInspectorPackagerConnection(

/** Java wrapper around a C++ IWebSocketDelegate, allowing us to call the interface from Java. */
@DoNotStrip
private class WebSocketDelegate @DoNotStrip constructor(private val mHybridData: HybridData) :
private class WebSocketDelegate
@DoNotStrip
constructor(
@Suppress("NoHungarianNotation") // fbjni accesses this field by name "mHybridData"
private val mHybridData: HybridData,
) :
Closeable {
external fun didFailWithError(posixCode: Int?, error: String?)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ import com.facebook.react.fabric.mounting.LayoutMetricsConversions

internal open class SurfaceHandlerBinding(moduleName: String) : HybridClassBase() {

init {
initHybrid(NO_SURFACE_ID, moduleName)
}

private external fun initHybrid(surfaceId: Int, moduleName: String)

val surfaceId: Int
get() = _getSurfaceId()

Expand All @@ -28,6 +22,12 @@ internal open class SurfaceHandlerBinding(moduleName: String) : HybridClassBase(
val moduleName: String
get() = _getModuleName()

init {
initHybrid(NO_SURFACE_ID, moduleName)
}

private external fun initHybrid(surfaceId: Int, moduleName: String)

private external fun _getSurfaceId(): Int

private external fun _getModuleName(): String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ package com.facebook.react.runtime
import com.facebook.jni.HybridData
import com.facebook.proguard.annotations.DoNotStrip
import com.facebook.soloader.SoLoader
import com.facebook.soloader.annotation.SoLoaderLibrary

@SoLoaderLibrary("rninstance")
public abstract class JSRuntimeFactory(
@Suppress("unused", "NoHungarianNotation", "NotAccessedPrivateField")
@DoNotStrip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ import com.facebook.react.bridge.WritableArray
import com.facebook.react.bridge.WritableNativeArray
import com.facebook.react.modules.core.JavaScriptTimerExecutor
import com.facebook.soloader.SoLoader
import com.facebook.soloader.annotation.SoLoaderLibrary

@DoNotStrip
@SoLoaderLibrary("rninstance")
internal class JSTimerExecutor() : HybridClassBase(), JavaScriptTimerExecutor {
init {
initHybrid()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import com.facebook.react.devsupport.inspector.TracingStateListener
import com.facebook.react.devsupport.perfmonitor.PerfMonitorInspectorTarget
import com.facebook.react.devsupport.perfmonitor.PerfMonitorUpdateListener
import com.facebook.soloader.SoLoader
import com.facebook.soloader.annotation.SoLoaderLibrary
import java.io.Closeable
import java.util.concurrent.Executor

Expand Down Expand Up @@ -82,6 +83,7 @@ internal class ReactHostInspectorTarget(reactHostImpl: ReactHostImpl) :
return mHybridData.isValid()
}

@SoLoaderLibrary("rninstance")
private companion object {
init {
SoLoader.loadLibrary("rninstance")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import com.facebook.jni.HybridData
import com.facebook.jni.annotations.DoNotStrip
import com.facebook.react.runtime.JSRuntimeFactory
import com.facebook.soloader.SoLoader
import com.facebook.soloader.annotation.SoLoaderLibrary

@SoLoaderLibrary("hermesinstancejni")
public class HermesInstance(allocInOldGenBeforeTTI: Boolean) :
JSRuntimeFactory(initHybrid(allocInOldGenBeforeTTI)) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1012,18 +1012,18 @@ public void setTouchCancel(@NonNull T view, boolean value) {
* especially helpful for views that are recycled so we can retain and restore the original
* listener upon recycling (onDropViewInstance).
*/
private class BaseVMFocusChangeListener<V extends View> implements OnFocusChangeListener {
private static class BaseVMFocusChangeListener implements OnFocusChangeListener {
private @Nullable OnFocusChangeListener mOriginalFocusChangeListener;

public BaseVMFocusChangeListener(@Nullable OnFocusChangeListener originalFocusChangeListener) {
mOriginalFocusChangeListener = originalFocusChangeListener;
}

public void attach(T view) {
public void attach(View view) {
view.setOnFocusChangeListener(this);
}

public void detach(T view) {
public void detach(View view) {
view.setOnFocusChangeListener(mOriginalFocusChangeListener);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

package com.facebook.react.uimanager

import android.annotation.TargetApi
import android.graphics.BlendMode
import android.os.Build
import android.view.ViewGroup
import androidx.annotation.RequiresApi
import androidx.core.view.children
import com.facebook.react.R

Expand All @@ -20,7 +20,7 @@ import com.facebook.react.R
* This object provides utilities to convert CSS mix-blend-mode string values into Android's
* [BlendMode] enumeration and to determine when views need isolated layers for proper blending.
*/
@TargetApi(29)
@RequiresApi(29)
internal object BlendModeHelper {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ package com.facebook.react.uimanager
import com.facebook.proguard.annotations.DoNotStripAny
import com.facebook.react.bridge.RuntimeExecutor
import com.facebook.soloader.SoLoader
import com.facebook.soloader.annotation.SoLoaderLibrary
import kotlin.jvm.JvmStatic

/**
Expand All @@ -19,6 +20,7 @@ import kotlin.jvm.JvmStatic
* JavaScript runtime, making component name information available to the native side.
*/
@DoNotStripAny
@SoLoaderLibrary("uimanagerjni")
internal object ComponentNameResolverBinding {
init {
SoLoader.loadLibrary("uimanagerjni")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ public void setMaxHeight(Dynamic maxHeight) {
maxHeight.recycle();
}

@Override
@ReactProp(name = ViewProps.FLEX, defaultFloat = 0f)
public void setFlex(float flex) {
if (isVirtual()) {
Expand All @@ -238,6 +239,7 @@ public void setFlex(float flex) {
super.setFlex(flex);
}

@Override
@ReactProp(name = ViewProps.FLEX_GROW, defaultFloat = 0f)
public void setFlexGrow(float flexGrow) {
if (isVirtual()) {
Expand Down Expand Up @@ -309,6 +311,7 @@ public void setGap(Dynamic gap) {
gap.recycle();
}

@Override
@ReactProp(name = ViewProps.FLEX_SHRINK, defaultFloat = 0f)
public void setFlexShrink(float flexShrink) {
if (isVirtual()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,6 @@ public void onBatchComplete() {
mTagsWithLayoutVisited.clear();
}

private NodeIndexPair walkUpUntilNativeKindIsParent(
ReactShadowNode node, int indexInNativeChildren) {
// Logic removed due to NativeKind removal
return new NodeIndexPair(node, indexInNativeChildren);
}

private void addNodeToNode(ReactShadowNode parent, ReactShadowNode child, int index) {
// Logic removed due to NativeKind removal
}
Expand Down Expand Up @@ -289,8 +283,6 @@ private void applyLayoutBase(ReactShadowNode node) {
}
mTagsWithLayoutVisited.put(tag, true);

ReactShadowNode parent = node.getParent();

// We use screenX/screenY (which round to integer pixels) at each node in the hierarchy to
// emulate what the layout would look like if it were actually built with native views which
// have to have integral top/left/bottom/right values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ package com.facebook.react.views.text

import android.content.res.AssetManager
import android.graphics.Typeface
import android.text.TextUtils
import com.facebook.react.bridge.ReadableArray
import com.facebook.react.common.ReactConstants
import com.facebook.react.common.assets.ReactFontManager
Expand Down Expand Up @@ -93,7 +92,7 @@ public object ReactTypefaceUtils {
"stylistic-twenty" -> features.add("'ss20'")
}
}
return TextUtils.join(", ", features)
return features.joinToString(", ")
}

@JvmStatic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ package com.facebook.react.views.text

import android.os.Build
import android.text.Layout
import android.text.TextUtils
import android.text.TextUtils.TruncateAt
import android.util.LayoutDirection
import android.view.Gravity
Expand Down Expand Up @@ -238,7 +237,7 @@ public class TextAttributeProps private constructor() {
}
}
}
fontFeatureSettings = TextUtils.join(", ", features)
fontFeatureSettings = features.joinToString(", ")
}

private fun setFontWeight(fontWeightString: String?) {
Expand Down
Loading