forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for View Manager commands in Fabric
Reviewed By: achen1 Differential Revision: D7879104 fbshipit-source-id: fd89acb3941bb03364d18ddedf68a081aef934a0
- Loading branch information
Showing
8 changed files
with
89 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
32 changes: 32 additions & 0 deletions
32
ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerHelper.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.facebook.react.uimanager; | ||
|
||
import static com.facebook.react.uimanager.common.ViewType.FABRIC; | ||
import static com.facebook.react.uimanager.common.ViewUtil.getViewType; | ||
|
||
import com.facebook.react.bridge.CatalystInstance; | ||
import com.facebook.react.bridge.ReactContext; | ||
import com.facebook.react.bridge.UIManager; | ||
|
||
/** | ||
* Helper class for {@link UIManager}. | ||
*/ | ||
public class UIManagerHelper { | ||
|
||
/** | ||
* @return a {@link UIManager} that can handle the react tag received by parameter. | ||
*/ | ||
public static UIManager getUIManager(ReactContext context, int reactTag) { | ||
return getUIManager(context, getViewType(reactTag) == FABRIC); | ||
} | ||
|
||
/** | ||
* @return a {@link UIManager} that can handle the react tag received by parameter. | ||
*/ | ||
public static UIManager getUIManager(ReactContext context, boolean isFabric) { | ||
CatalystInstance catalystInstance = context.getCatalystInstance(); | ||
return isFabric ? | ||
catalystInstance.getJSIModule(UIManager.class) : | ||
catalystInstance.getNativeModule(UIManagerModule.class); | ||
} | ||
|
||
} |
This file contains 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
This file contains 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