You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Move background drawing code from "react/views/view" to "react/uimanager/drawable" (#43720)
Summary: Pull Request resolved: #43720 This lets us use BG drawing code in rules which view depends on. I also removed some lib usage. The original class is still present, subclassing the class in its new location, but is marked deprecated. Next diffs in stack clean up some of our own now deprecated usage. Changelog: [Android][Breaking] - Deprecate `ReactViewBackgroundDrawable` in favor of `CSSBackgroundDrawable` Reviewed By: javache Differential Revision: D55565035 fbshipit-source-id: 501b3e2f674c09a88b1825657ba6349823054e8c
Copy file name to clipboardExpand all lines: packages/react-native/ReactAndroid/api/ReactAndroid.api
+48-44Lines changed: 48 additions & 44 deletions
Original file line number
Diff line number
Diff line change
@@ -5448,6 +5448,53 @@ public abstract interface class com/facebook/react/uimanager/debug/NotThreadSafe
5448
5448
public abstract fun onViewHierarchyUpdateFinished ()V
5449
5449
}
5450
5450
5451
+
public class com/facebook/react/uimanager/drawable/CSSBackgroundDrawable : android/graphics/drawable/Drawable {
5452
+
public fun <init> (Landroid/content/Context;)V
5453
+
public fun borderBoxPath ()Landroid/graphics/Path;
5454
+
public fun draw (Landroid/graphics/Canvas;)V
5455
+
public fun getAlpha ()I
5456
+
public fun getBorderColor (I)I
5457
+
public fun getBorderRadius (Lcom/facebook/react/uimanager/drawable/CSSBackgroundDrawable$BorderRadiusLocation;)F
5458
+
public fun getBorderRadiusOrDefaultTo (FLcom/facebook/react/uimanager/drawable/CSSBackgroundDrawable$BorderRadiusLocation;)F
5459
+
public fun getBorderWidthOrDefaultTo (FI)F
5460
+
public fun getDirectionAwareBorderInsets ()Landroid/graphics/RectF;
5461
+
public fun getFullBorderRadius ()F
5462
+
public fun getFullBorderWidth ()F
5463
+
public fun getOpacity ()I
5464
+
public fun getOutline (Landroid/graphics/Outline;)V
5465
+
public fun getResolvedLayoutDirection ()I
5466
+
public fun hasRoundedBorders ()Z
5467
+
protected fun onBoundsChange (Landroid/graphics/Rect;)V
5468
+
public fun onResolvedLayoutDirectionChanged (I)Z
5469
+
public fun paddingBoxPath ()Landroid/graphics/Path;
5470
+
public fun setAlpha (I)V
5471
+
public fun setBorderColor (IFF)V
5472
+
public fun setBorderStyle (Ljava/lang/String;)V
5473
+
public fun setBorderWidth (IF)V
5474
+
public fun setColor (I)V
5475
+
public fun setColorFilter (Landroid/graphics/ColorFilter;)V
5476
+
public fun setRadius (F)V
5477
+
public fun setRadius (FI)V
5478
+
public fun setResolvedLayoutDirection (I)Z
5479
+
}
5480
+
5481
+
public final class com/facebook/react/uimanager/drawable/CSSBackgroundDrawable$BorderRadiusLocation : java/lang/Enum {
5482
+
public static final field BOTTOM_END Lcom/facebook/react/uimanager/drawable/CSSBackgroundDrawable$BorderRadiusLocation;
5483
+
public static final field BOTTOM_LEFT Lcom/facebook/react/uimanager/drawable/CSSBackgroundDrawable$BorderRadiusLocation;
5484
+
public static final field BOTTOM_RIGHT Lcom/facebook/react/uimanager/drawable/CSSBackgroundDrawable$BorderRadiusLocation;
5485
+
public static final field BOTTOM_START Lcom/facebook/react/uimanager/drawable/CSSBackgroundDrawable$BorderRadiusLocation;
5486
+
public static final field END_END Lcom/facebook/react/uimanager/drawable/CSSBackgroundDrawable$BorderRadiusLocation;
5487
+
public static final field END_START Lcom/facebook/react/uimanager/drawable/CSSBackgroundDrawable$BorderRadiusLocation;
5488
+
public static final field START_END Lcom/facebook/react/uimanager/drawable/CSSBackgroundDrawable$BorderRadiusLocation;
5489
+
public static final field START_START Lcom/facebook/react/uimanager/drawable/CSSBackgroundDrawable$BorderRadiusLocation;
5490
+
public static final field TOP_END Lcom/facebook/react/uimanager/drawable/CSSBackgroundDrawable$BorderRadiusLocation;
5491
+
public static final field TOP_LEFT Lcom/facebook/react/uimanager/drawable/CSSBackgroundDrawable$BorderRadiusLocation;
5492
+
public static final field TOP_RIGHT Lcom/facebook/react/uimanager/drawable/CSSBackgroundDrawable$BorderRadiusLocation;
5493
+
public static final field TOP_START Lcom/facebook/react/uimanager/drawable/CSSBackgroundDrawable$BorderRadiusLocation;
5494
+
public static fun valueOf (Ljava/lang/String;)Lcom/facebook/react/uimanager/drawable/CSSBackgroundDrawable$BorderRadiusLocation;
5495
+
public static fun values ()[Lcom/facebook/react/uimanager/drawable/CSSBackgroundDrawable$BorderRadiusLocation;
5496
+
}
5497
+
5451
5498
public abstract interface class com/facebook/react/uimanager/events/BatchEventDispatchedListener {
5452
5499
public abstract fun onBatchEventDispatched ()V
5453
5500
}
@@ -7672,8 +7719,6 @@ public final class com/facebook/react/views/unimplementedview/ReactUnimplemented
7672
7719
7673
7720
public final class com/facebook/react/views/view/ColorUtil {
7674
7721
public static final field INSTANCE Lcom/facebook/react/views/view/ColorUtil;
7675
-
public static final fun getOpacityFromColor (I)I
7676
-
public static final fun multiplyColorAlpha (II)I
7677
7722
public static final fun normalize (DDDD)I
7678
7723
}
7679
7724
@@ -7706,49 +7751,8 @@ public class com/facebook/react/views/view/ReactDrawableHelper {
7706
7751
public static fun createDrawableFromJSDescription (Landroid/content/Context;Lcom/facebook/react/bridge/ReadableMap;)Landroid/graphics/drawable/Drawable;
7707
7752
}
7708
7753
7709
-
public class com/facebook/react/views/view/ReactViewBackgroundDrawable : android/graphics/drawable/Drawable {
7754
+
public class com/facebook/react/views/view/ReactViewBackgroundDrawable : com/facebook/react/uimanager/drawable/CSSBackgroundDrawable {
7710
7755
public fun <init> (Landroid/content/Context;)V
7711
-
public fun draw (Landroid/graphics/Canvas;)V
7712
-
public fun getAlpha ()I
7713
-
public fun getBorderColor (I)I
7714
-
public fun getBorderRadius (Lcom/facebook/react/views/view/ReactViewBackgroundDrawable$BorderRadiusLocation;)F
7715
-
public fun getBorderRadiusOrDefaultTo (FLcom/facebook/react/views/view/ReactViewBackgroundDrawable$BorderRadiusLocation;)F
7716
-
public fun getBorderWidthOrDefaultTo (FI)F
7717
-
public fun getDirectionAwareBorderInsets ()Landroid/graphics/RectF;
7718
-
public fun getFullBorderRadius ()F
7719
-
public fun getFullBorderWidth ()F
7720
-
public fun getOpacity ()I
7721
-
public fun getOutline (Landroid/graphics/Outline;)V
7722
-
public fun getResolvedLayoutDirection ()I
7723
-
public fun hasRoundedBorders ()Z
7724
-
protected fun onBoundsChange (Landroid/graphics/Rect;)V
7725
-
public fun onResolvedLayoutDirectionChanged (I)Z
7726
-
public fun setAlpha (I)V
7727
-
public fun setBorderColor (IFF)V
7728
-
public fun setBorderStyle (Ljava/lang/String;)V
7729
-
public fun setBorderWidth (IF)V
7730
-
public fun setColor (I)V
7731
-
public fun setColorFilter (Landroid/graphics/ColorFilter;)V
7732
-
public fun setRadius (F)V
7733
-
public fun setRadius (FI)V
7734
-
public fun setResolvedLayoutDirection (I)Z
7735
-
}
7736
-
7737
-
public final class com/facebook/react/views/view/ReactViewBackgroundDrawable$BorderRadiusLocation : java/lang/Enum {
7738
-
public static final field BOTTOM_END Lcom/facebook/react/views/view/ReactViewBackgroundDrawable$BorderRadiusLocation;
7739
-
public static final field BOTTOM_LEFT Lcom/facebook/react/views/view/ReactViewBackgroundDrawable$BorderRadiusLocation;
7740
-
public static final field BOTTOM_RIGHT Lcom/facebook/react/views/view/ReactViewBackgroundDrawable$BorderRadiusLocation;
7741
-
public static final field BOTTOM_START Lcom/facebook/react/views/view/ReactViewBackgroundDrawable$BorderRadiusLocation;
7742
-
public static final field END_END Lcom/facebook/react/views/view/ReactViewBackgroundDrawable$BorderRadiusLocation;
7743
-
public static final field END_START Lcom/facebook/react/views/view/ReactViewBackgroundDrawable$BorderRadiusLocation;
7744
-
public static final field START_END Lcom/facebook/react/views/view/ReactViewBackgroundDrawable$BorderRadiusLocation;
7745
-
public static final field START_START Lcom/facebook/react/views/view/ReactViewBackgroundDrawable$BorderRadiusLocation;
7746
-
public static final field TOP_END Lcom/facebook/react/views/view/ReactViewBackgroundDrawable$BorderRadiusLocation;
7747
-
public static final field TOP_LEFT Lcom/facebook/react/views/view/ReactViewBackgroundDrawable$BorderRadiusLocation;
7748
-
public static final field TOP_RIGHT Lcom/facebook/react/views/view/ReactViewBackgroundDrawable$BorderRadiusLocation;
7749
-
public static final field TOP_START Lcom/facebook/react/views/view/ReactViewBackgroundDrawable$BorderRadiusLocation;
7750
-
public static fun valueOf (Ljava/lang/String;)Lcom/facebook/react/views/view/ReactViewBackgroundDrawable$BorderRadiusLocation;
7751
-
public static fun values ()[Lcom/facebook/react/views/view/ReactViewBackgroundDrawable$BorderRadiusLocation;
7752
7756
}
7753
7757
7754
7758
public class com/facebook/react/views/view/ReactViewBackgroundManager {
0 commit comments