Skip to content
Closed
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 @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<2fc347cdb33327437d29e5fd91e24011>>
* @generated SignedSource<<e46c13b3f084d06567a69b3a0a09d536>>
*/

/**
Expand Down Expand Up @@ -102,12 +102,6 @@ public object ReactNativeFeatureFlags {
@JvmStatic
public fun enableAccumulatedUpdatesInRawPropsAndroid(): Boolean = accessor.enableAccumulatedUpdatesInRawPropsAndroid()

/**
* When enabled, Android Text measurement and rendering respects the system Bold text accessibility setting via `Configuration.fontWeightAdjustment`.
*/
@JvmStatic
public fun enableAndroidFontWeightAdjustment(): Boolean = accessor.enableAndroidFontWeightAdjustment()

/**
* Enables various optimizations throughout the path of measuring text on Android.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<a506d2515fce404e19bd61099cc60117>>
* @generated SignedSource<<1cfa607d57c9128a403ae1c93e17bb11>>
*/

/**
Expand Down Expand Up @@ -32,7 +32,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
private var disableViewPreallocationAndroidCache: Boolean? = null
private var enableAccessibilityOrderCache: Boolean? = null
private var enableAccumulatedUpdatesInRawPropsAndroidCache: Boolean? = null
private var enableAndroidFontWeightAdjustmentCache: Boolean? = null
private var enableAndroidTextMeasurementOptimizationsCache: Boolean? = null
private var enableBridgelessArchitectureCache: Boolean? = null
private var enableCppPropsIteratorSetterCache: Boolean? = null
Expand Down Expand Up @@ -216,15 +215,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
return cached
}

override fun enableAndroidFontWeightAdjustment(): Boolean {
var cached = enableAndroidFontWeightAdjustmentCache
if (cached == null) {
cached = ReactNativeFeatureFlagsCxxInterop.enableAndroidFontWeightAdjustment()
enableAndroidFontWeightAdjustmentCache = cached
}
return cached
}

override fun enableAndroidTextMeasurementOptimizations(): Boolean {
var cached = enableAndroidTextMeasurementOptimizationsCache
if (cached == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<1ef72233f02973021b83bd2e2aa1f69b>>
* @generated SignedSource<<9447989a7bdc93fdabc38ff113b1b9f9>>
*/

/**
Expand Down Expand Up @@ -52,8 +52,6 @@ public object ReactNativeFeatureFlagsCxxInterop {

@DoNotStrip @JvmStatic public external fun enableAccumulatedUpdatesInRawPropsAndroid(): Boolean

@DoNotStrip @JvmStatic public external fun enableAndroidFontWeightAdjustment(): Boolean

@DoNotStrip @JvmStatic public external fun enableAndroidTextMeasurementOptimizations(): Boolean

@DoNotStrip @JvmStatic public external fun enableBridgelessArchitecture(): Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<eb9958ddc04dd1cd8d1add366f5f7741>>
* @generated SignedSource<<e53e5044e4c408b2d3e55e279d1a7e51>>
*/

/**
Expand Down Expand Up @@ -47,8 +47,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi

override fun enableAccumulatedUpdatesInRawPropsAndroid(): Boolean = false

override fun enableAndroidFontWeightAdjustment(): Boolean = true

override fun enableAndroidTextMeasurementOptimizations(): Boolean = false

override fun enableBridgelessArchitecture(): Boolean = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<9ae32c46a5a6310ef96eb91c9ea5b12e>>
* @generated SignedSource<<7159c0be9e1044361603d06061b571f6>>
*/

/**
Expand Down Expand Up @@ -36,7 +36,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
private var disableViewPreallocationAndroidCache: Boolean? = null
private var enableAccessibilityOrderCache: Boolean? = null
private var enableAccumulatedUpdatesInRawPropsAndroidCache: Boolean? = null
private var enableAndroidFontWeightAdjustmentCache: Boolean? = null
private var enableAndroidTextMeasurementOptimizationsCache: Boolean? = null
private var enableBridgelessArchitectureCache: Boolean? = null
private var enableCppPropsIteratorSetterCache: Boolean? = null
Expand Down Expand Up @@ -232,16 +231,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
return cached
}

override fun enableAndroidFontWeightAdjustment(): Boolean {
var cached = enableAndroidFontWeightAdjustmentCache
if (cached == null) {
cached = currentProvider.enableAndroidFontWeightAdjustment()
accessedFeatureFlags.add("enableAndroidFontWeightAdjustment")
enableAndroidFontWeightAdjustmentCache = cached
}
return cached
}

override fun enableAndroidTextMeasurementOptimizations(): Boolean {
var cached = enableAndroidTextMeasurementOptimizationsCache
if (cached == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<1a1d47f2d85404c776e55db40f7dbc6e>>
* @generated SignedSource<<dffe8127e5ad9769989307888c95ce7b>>
*/

/**
Expand Down Expand Up @@ -47,8 +47,6 @@ public interface ReactNativeFeatureFlagsProvider {

@DoNotStrip public fun enableAccumulatedUpdatesInRawPropsAndroid(): Boolean

@DoNotStrip public fun enableAndroidFontWeightAdjustment(): Boolean

@DoNotStrip public fun enableAndroidTextMeasurementOptimizations(): Boolean

@DoNotStrip public fun enableBridgelessArchitecture(): Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import com.facebook.common.logging.FLog
import com.facebook.react.bridge.ReadableArray
import com.facebook.react.common.ReactConstants
import com.facebook.react.common.assets.ReactFontManager
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags
import kotlin.math.max
import kotlin.math.min

Expand Down Expand Up @@ -125,10 +124,7 @@ public object ReactTypefaceUtils {

@JvmStatic
public fun getFontWeightAdjustment(context: Context): Int =
if (
Build.VERSION.SDK_INT >= Build.VERSION_CODES.S &&
ReactNativeFeatureFlags.enableAndroidFontWeightAdjustment()
) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
context.resources.configuration.fontWeightAdjustment
} else {
0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<28de1e205f30135e96d5cb94a902faec>>
* @generated SignedSource<<1996a0e1d04c4bd885e8e499c980954e>>
*/

/**
Expand Down Expand Up @@ -111,12 +111,6 @@ class ReactNativeFeatureFlagsJavaProvider
return method(javaProvider_);
}

bool enableAndroidFontWeightAdjustment() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableAndroidFontWeightAdjustment");
return method(javaProvider_);
}

bool enableAndroidTextMeasurementOptimizations() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableAndroidTextMeasurementOptimizations");
Expand Down Expand Up @@ -625,11 +619,6 @@ bool JReactNativeFeatureFlagsCxxInterop::enableAccumulatedUpdatesInRawPropsAndro
return ReactNativeFeatureFlags::enableAccumulatedUpdatesInRawPropsAndroid();
}

bool JReactNativeFeatureFlagsCxxInterop::enableAndroidFontWeightAdjustment(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::enableAndroidFontWeightAdjustment();
}

bool JReactNativeFeatureFlagsCxxInterop::enableAndroidTextMeasurementOptimizations(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::enableAndroidTextMeasurementOptimizations();
Expand Down Expand Up @@ -1067,9 +1056,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"enableAccumulatedUpdatesInRawPropsAndroid",
JReactNativeFeatureFlagsCxxInterop::enableAccumulatedUpdatesInRawPropsAndroid),
makeNativeMethod(
"enableAndroidFontWeightAdjustment",
JReactNativeFeatureFlagsCxxInterop::enableAndroidFontWeightAdjustment),
makeNativeMethod(
"enableAndroidTextMeasurementOptimizations",
JReactNativeFeatureFlagsCxxInterop::enableAndroidTextMeasurementOptimizations),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<535898dd9498c65f30d56122c06b408b>>
* @generated SignedSource<<5e373288f9b9a5f72f6975329194c799>>
*/

/**
Expand Down Expand Up @@ -66,9 +66,6 @@ class JReactNativeFeatureFlagsCxxInterop
static bool enableAccumulatedUpdatesInRawPropsAndroid(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);

static bool enableAndroidFontWeightAdjustment(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);

static bool enableAndroidTextMeasurementOptimizations(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<8fd664cb106945e5c6e436a0cf36120d>>
* @generated SignedSource<<134ddac03c568b9e0c4bc50bbdfa99a3>>
*/

/**
Expand Down Expand Up @@ -74,10 +74,6 @@ bool ReactNativeFeatureFlags::enableAccumulatedUpdatesInRawPropsAndroid() {
return getAccessor().enableAccumulatedUpdatesInRawPropsAndroid();
}

bool ReactNativeFeatureFlags::enableAndroidFontWeightAdjustment() {
return getAccessor().enableAndroidFontWeightAdjustment();
}

bool ReactNativeFeatureFlags::enableAndroidTextMeasurementOptimizations() {
return getAccessor().enableAndroidTextMeasurementOptimizations();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<196ba25b807fd064ca6150c7d2cd741c>>
* @generated SignedSource<<242e9297345bfe821b4550c24d89c2ba>>
*/

/**
Expand Down Expand Up @@ -99,11 +99,6 @@ class ReactNativeFeatureFlags {
*/
RN_EXPORT static bool enableAccumulatedUpdatesInRawPropsAndroid();

/**
* When enabled, Android Text measurement and rendering respects the system Bold text accessibility setting via `Configuration.fontWeightAdjustment`.
*/
RN_EXPORT static bool enableAndroidFontWeightAdjustment();

/**
* Enables various optimizations throughout the path of measuring text on Android.
*/
Expand Down
Loading
Loading