Skip to content

Commit 48395d3

Browse files
cortinicofacebook-github-bot
authored andcommitted
Convert ReactViewGroup to Kotlin (#51767)
Summary: Pull Request resolved: #51767 This is going to convert the last class inside `com.facebook.react.views.view` to Kotlin. I still need to assess if this is going to be breaking or not for our users. Potentially some breakages for Kotlin consumer could happen (see changes on ReactViewManager). I'll follow-up with an investigation on that one. Changelog: [Android] [Changed] - Convert ReactViewGroup to Kotlin Reviewed By: mdvacca Differential Revision: D75797215 fbshipit-source-id: 5d58faa651d5959909a4b0237aad9c4209895083
1 parent 747eb3c commit 48395d3

5 files changed

Lines changed: 960 additions & 1063 deletions

File tree

packages/react-native/ReactAndroid/api/ReactAndroid.api

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3329,6 +3329,10 @@ public final class com/facebook/react/soloader/OpenSourceMergedSoMapping : com/f
33293329
public fun mapLibName (Ljava/lang/String;)Ljava/lang/String;
33303330
}
33313331

3332+
public abstract interface class com/facebook/react/touch/OnInterceptTouchEventListener {
3333+
public abstract fun onInterceptTouchEvent (Landroid/view/ViewGroup;Landroid/view/MotionEvent;)Z
3334+
}
3335+
33323336
public abstract interface class com/facebook/react/touch/ReactHitSlopView {
33333337
public abstract fun getHitSlopRect ()Landroid/graphics/Rect;
33343338
}
@@ -6750,24 +6754,24 @@ public class com/facebook/react/views/view/ReactViewGroup : android/view/ViewGro
67506754
public fun onViewAdded (Landroid/view/View;)V
67516755
public fun onViewRemoved (Landroid/view/View;)V
67526756
public fun requestLayout ()V
6753-
public fun setBackfaceVisibility (Ljava/lang/String;)V
6754-
public fun setBackfaceVisibilityDependantOpacity ()V
6757+
public final fun setBackfaceVisibility (Ljava/lang/String;)V
6758+
public final fun setBackfaceVisibilityDependantOpacity ()V
67556759
public fun setBackgroundColor (I)V
6756-
public fun setBorderColor (ILjava/lang/Integer;)V
6757-
public fun setBorderRadius (F)V
6758-
public fun setBorderRadius (FI)V
6759-
public fun setBorderRadius (Lcom/facebook/react/uimanager/style/BorderRadiusProp;Lcom/facebook/react/uimanager/LengthPercentage;)V
6760-
public fun setBorderStyle (Ljava/lang/String;)V
6761-
public fun setBorderWidth (IF)V
6760+
public final fun setBorderColor (ILjava/lang/Integer;)V
6761+
public final fun setBorderRadius (F)V
6762+
public final fun setBorderRadius (FI)V
6763+
public final fun setBorderRadius (Lcom/facebook/react/uimanager/style/BorderRadiusProp;Lcom/facebook/react/uimanager/LengthPercentage;)V
6764+
public final fun setBorderStyle (Ljava/lang/String;)V
6765+
public final fun setBorderWidth (IF)V
67626766
public fun setHitSlopRect (Landroid/graphics/Rect;)V
6763-
public fun setNeedsOffscreenAlphaCompositing (Z)V
6767+
public final fun setNeedsOffscreenAlphaCompositing (Z)V
67646768
public fun setOnInterceptTouchEventListener (Lcom/facebook/react/touch/OnInterceptTouchEventListener;)V
6765-
public fun setOpacityIfPossible (F)V
6769+
public final fun setOpacityIfPossible (F)V
67666770
public fun setOverflow (Ljava/lang/String;)V
67676771
public fun setOverflowInset (IIII)V
67686772
public fun setPointerEvents (Lcom/facebook/react/uimanager/PointerEvents;)V
67696773
public fun setRemoveClippedSubviews (Z)V
6770-
public fun setTranslucentBackgroundDrawable (Landroid/graphics/drawable/Drawable;)V
6774+
public final fun setTranslucentBackgroundDrawable (Landroid/graphics/drawable/Drawable;)V
67716775
public fun updateClippingRect ()V
67726776
public fun updateClippingRect (Ljava/util/Set;)V
67736777
public fun updateDrawingOrder ()V

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/touch/OnInterceptTouchEventListener.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import android.view.ViewGroup
1414
* Interface definition for a callback to be invoked when a onInterceptTouch is called on a
1515
* [ViewGroup].
1616
*/
17-
internal fun interface OnInterceptTouchEventListener {
17+
public fun interface OnInterceptTouchEventListener {
1818

1919
/**
2020
* Called when a onInterceptTouch is invoked on a view group.
@@ -24,5 +24,5 @@ internal fun interface OnInterceptTouchEventListener {
2424
* @return Return true to steal motion event from the children and have the dispatched to this
2525
* view, or return false to allow motion event to be delivered to children view
2626
*/
27-
fun onInterceptTouchEvent(view: ViewGroup, event: MotionEvent): Boolean
27+
public fun onInterceptTouchEvent(view: ViewGroup, event: MotionEvent): Boolean
2828
}

0 commit comments

Comments
 (0)