mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Gate off % border radii on Android Paper (#45945)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/45945 This code is forked on iOS, where we have been, as a policy, avoiding Paper-specific changes. This code is shared between renderers on Android, but it is confusing developer experience to have it work on Android Paper, to then fail on iOS unless it is on new arch. This change disables support on Android Paper for consistency. Changelog: [Android][Removed] - Gate off % border radii on Android Paper Reviewed By: cortinico Differential Revision: D60967347 fbshipit-source-id: 1d26bc71aee677aa9a0dc9bb38f781a99c7762a8
This commit is contained in:
committed by
Facebook GitHub Bot
parent
757cefb26e
commit
bbd5b5e157
@@ -4369,6 +4369,7 @@ public final class com/facebook/react/uimanager/LengthPercentage {
|
||||
public static final field Companion Lcom/facebook/react/uimanager/LengthPercentage$Companion;
|
||||
public fun <init> ()V
|
||||
public fun <init> (FLcom/facebook/react/uimanager/LengthPercentageType;)V
|
||||
public final fun getUnit ()Lcom/facebook/react/uimanager/LengthPercentageType;
|
||||
public final fun resolve (FF)F
|
||||
public static final fun setFromDynamic (Lcom/facebook/react/bridge/Dynamic;)Lcom/facebook/react/uimanager/LengthPercentage;
|
||||
}
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ public enum class LengthPercentageType {
|
||||
|
||||
public class LengthPercentage(
|
||||
private val value: Float,
|
||||
private val unit: LengthPercentageType,
|
||||
public val unit: LengthPercentageType,
|
||||
) {
|
||||
public companion object {
|
||||
@JvmStatic
|
||||
|
||||
+10
@@ -26,6 +26,7 @@ import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags;
|
||||
import com.facebook.react.module.annotations.ReactModule;
|
||||
import com.facebook.react.uimanager.BackgroundStyleApplicator;
|
||||
import com.facebook.react.uimanager.LengthPercentage;
|
||||
import com.facebook.react.uimanager.LengthPercentageType;
|
||||
import com.facebook.react.uimanager.PixelUtil;
|
||||
import com.facebook.react.uimanager.PointerEvents;
|
||||
import com.facebook.react.uimanager.Spacing;
|
||||
@@ -156,6 +157,15 @@ public class ReactViewManager extends ReactClippingViewManager<ReactViewGroup> {
|
||||
})
|
||||
public void setBorderRadius(ReactViewGroup view, int index, Dynamic rawBorderRadius) {
|
||||
@Nullable LengthPercentage borderRadius = LengthPercentage.setFromDynamic(rawBorderRadius);
|
||||
|
||||
// We do not support percentage border radii on Paper in order to be consistent with iOS (to
|
||||
// avoid developer surprise if it works on one platform but not another).
|
||||
if (ViewUtil.getUIManagerType(view) != UIManagerType.FABRIC
|
||||
&& borderRadius != null
|
||||
&& borderRadius.getUnit() == LengthPercentageType.PERCENT) {
|
||||
borderRadius = null;
|
||||
}
|
||||
|
||||
if (ReactNativeFeatureFlags.enableBackgroundStyleApplicator()) {
|
||||
BackgroundStyleApplicator.setBorderRadius(
|
||||
view, BorderRadiusProp.values()[index], borderRadius);
|
||||
|
||||
Reference in New Issue
Block a user