Simplify ViewManagerOnDemandReactPackage.getViewManagerNames to return Collection

Summary:
This way we can avoid unnecessary ArrayList copies.

Changelog: [Android][Changed] Generalized the return type of ViewManagerOnDemandReactPackage.getViewManagerNames

Reviewed By: nlutsenko

Differential Revision: D36131516

fbshipit-source-id: 6a42c76cadbcce4c3720875d80062e1ee237bc2f
This commit is contained in:
Pieter De Baets authored and Facebook GitHub Bot committed 2022-05-13 06:50:04 -07:00
1 parent d7921f0504
commit 51e029ec3c
6 files changed
+18 -17

No files matched your search

@@ -10,15 +10,14 @@ package com.facebook.react;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
import java.util.List;
import java.util.Collection;
public interface ViewManagerOnDemandReactPackage {
/**
* Provides a list of names of ViewManagers with which these modules can be accessed from JS.
* Typically, this is ViewManager.getName().
*/
@Nullable
List<String> getViewManagerNames(ReactApplicationContext reactContext);
Collection<String> getViewManagerNames(ReactApplicationContext reactContext);
/**
* Creates and returns a ViewManager with a specific name {@param viewManagerName}. It's up to an
* implementing package how to interpret the name.