Skip to content

[Android] Remove getChildInDrawingOrderAtIndex#4156

Merged
j-piasecki merged 1 commit intosoftware-mansion:mainfrom
javache:pieterdb/remove-getChildInDrawingOrderAtIndex
May 8, 2026
Merged

[Android] Remove getChildInDrawingOrderAtIndex#4156
j-piasecki merged 1 commit intosoftware-mansion:mainfrom
javache:pieterdb/remove-getChildInDrawingOrderAtIndex

Conversation

@javache
Copy link
Copy Markdown
Contributor

@javache javache commented May 7, 2026

Summary

  • Remove the getChildInDrawingOrderAtIndex abstraction from ViewConfigurationHelper and its implementation in RNViewConfigurationHelper
  • Inline viewGroup.getChildAt(i) at the two call sites (GestureHandlerOrchestrator and HoverGestureHandler)
  • ReactViewGroup.getZIndexMappedChildIndex is 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#56717

Test plan

  • Android build via cd apps/basic-example && yarn android

`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.
Copilot AI review requested due to automatic review settings May 7, 2026 17:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 getChildInDrawingOrderAtIndex from ViewConfigurationHelper and deleted its RNViewConfigurationHelper implementation.
  • Inlined viewGroup.getChildAt(i) traversal in GestureHandlerOrchestrator and HoverGestureHandler.
  • Removed the now-unused RNViewConfigurationHelper companion instance from HoverGestureHandler.

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.

Copy link
Copy Markdown
Member

@j-piasecki j-piasecki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you ❤️

@j-piasecki j-piasecki merged commit f1f09bc into software-mansion:main May 8, 2026
6 of 7 checks passed
@javache javache deleted the pieterdb/remove-getChildInDrawingOrderAtIndex branch May 8, 2026 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants