[Android] Remove getChildInDrawingOrderAtIndex#4156
Merged
j-piasecki merged 1 commit intosoftware-mansion:mainfrom May 8, 2026
Merged
Conversation
`ReactViewGroup.getZIndexMappedChildIndex` was a legacy architecture API that has been a no-op (returning its input unchanged) and is being removed in the next React Native release. Remove the `getChildInDrawingOrderAtIndex` abstraction entirely and inline the `getChildAt` call at each usage site.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the getChildInDrawingOrderAtIndex abstraction from the Android ViewConfigurationHelper API and inlines ViewGroup.getChildAt(i) at the two call sites where child traversal is performed. The intent is to align RNGH with upstream React Native changes where ReactViewGroup.getZIndexMappedChildIndex is being removed.
Changes:
- Removed
getChildInDrawingOrderAtIndexfromViewConfigurationHelperand deleted itsRNViewConfigurationHelperimplementation. - Inlined
viewGroup.getChildAt(i)traversal inGestureHandlerOrchestratorandHoverGestureHandler. - Removed the now-unused
RNViewConfigurationHelpercompanion instance fromHoverGestureHandler.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNViewConfigurationHelper.kt | Removes the getChildInDrawingOrderAtIndex override implementation. |
| packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/core/ViewConfigurationHelper.kt | Removes getChildInDrawingOrderAtIndex from the interface. |
| packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/core/HoverGestureHandler.kt | Inlines getChildAt traversal and removes the static RNViewConfigurationHelper. |
| packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt | Inlines getChildAt traversal in child extraction loop. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
getChildInDrawingOrderAtIndexabstraction fromViewConfigurationHelperand its implementation inRNViewConfigurationHelperviewGroup.getChildAt(i)at the two call sites (GestureHandlerOrchestratorandHoverGestureHandler)ReactViewGroup.getZIndexMappedChildIndexis a legacy architecture API that has been a no-op (returns its input unchanged) and has been removed in Remove setViewZIndex and associated state from BaseViewManager facebook/react-native#56717Test plan
cd apps/basic-example && yarn android