Skip to content

Commit 5aa512f

Browse files
committed
Add comments
1 parent d89a2dd commit 5aa512f

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

  • packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,12 @@ public ScrollEndedListeners getScrollEndedListeners() {
209209
return mScrollEndedListeners;
210210
}
211211

212+
/**
213+
* Returns all windows associated with this context, including the main activity window and any
214+
* additional windows (such as modals or overlays) that have been registered.
215+
*
216+
* @return A set of all associated {@link Window} instances
217+
*/
212218
public Set<Window> getWindows() {
213219
Activity activity = getCurrentActivity();
214220
Set<Window> windows = mAdditionalWindows.getAll();
@@ -280,10 +286,20 @@ public void removeWindowFocusChangeListener(WindowFocusChangeListener listener)
280286
mWindowFocusEventListeners.remove(listener);
281287
}
282288

289+
/**
290+
* Registers an additional window (such as a modal or overlay).
291+
*
292+
* @param window The {@link Window} to register
293+
*/
283294
public void registerAdditionalWindow(Window window) {
284295
mAdditionalWindows.register(window, this::handleException);
285296
}
286297

298+
/**
299+
* Unregisters a previously registered additional window.
300+
*
301+
* @param window The {@link Window} to unregister
302+
*/
287303
public void unregisterAdditionalWindow(Window window) {
288304
mAdditionalWindows.unregister(window);
289305
}

0 commit comments

Comments
 (0)