@@ -35,6 +35,13 @@ public class HyperFragmentViewManager extends ViewGroupManager<FrameLayout> {
3535 private static final int COMMAND_PROCESS = 175 ;
3636
3737 private final ReactApplicationContext reactContext ;
38+ // Track props for each view
39+ private String currentNamespace = null ;
40+ private String currentPayload = null ;
41+ private FrameLayout currentView = null ;
42+
43+ // Architecture detection
44+ private final Boolean newArchEnabled = BuildConfig .IS_NEW_ARCHITECTURE_ENABLED ;
3845
3946 public HyperFragmentViewManager (ReactApplicationContext reactContext ) {
4047 this .reactContext = reactContext ;
@@ -58,6 +65,69 @@ protected FrameLayout createViewInstance(@NonNull ThemedReactContext context) {
5865 public Map <String , Integer > getCommandsMap () {
5966 return MapBuilder .of ("process" , COMMAND_PROCESS );
6067 }
68+ // Fabric-compatible props
69+ @ ReactProp (name = "namespace" )
70+ public void setNamespace (FrameLayout view , @ Nullable String namespace ) {
71+ currentNamespace = namespace ;
72+ currentView = view ;
73+ tryProcessProps ();
74+ }
75+
76+ @ ReactProp (name = "payload" )
77+ public void setPayload (FrameLayout view , @ Nullable String payload ) {
78+ currentPayload = payload ;
79+ currentView = view ;
80+ tryProcessProps ();
81+ }
82+
83+ private void tryProcessProps () {
84+ if (currentNamespace != null && currentPayload != null && currentView != null && newArchEnabled ) {
85+ currentView .post (() -> {
86+ processWithProps (currentView , currentNamespace , currentPayload );
87+ });
88+ }
89+ }
90+
91+ @ ReactProp (name = "height" , defaultFloat = 0f )
92+ public void setHeight (FrameLayout view , float height ) {
93+ // Height prop received
94+ }
95+
96+ @ ReactProp (name = "width" , defaultFloat = 0f )
97+ public void setWidth (FrameLayout view , float width ) {
98+ // Width prop received
99+ }
100+
101+ private void processWithProps (FrameLayout view , String namespace , String payload ) {
102+ try {
103+ setupLayout (view );
104+
105+ JSONObject fragments = new JSONObject ();
106+ fragments .put (namespace , view );
107+
108+ JSONObject payloadObj = new JSONObject (payload );
109+ payloadObj .getJSONObject ("payload" ).put ("fragmentViewGroups" , fragments );
110+
111+ FragmentActivity activity = (FragmentActivity ) reactContext .getCurrentActivity ();
112+ HyperServices hyperServices = HyperSdkReactModule .getHyperServices ();
113+
114+ if (activity == null || hyperServices == null ) {
115+ return ;
116+ }
117+
118+ hyperServices .process (activity , payloadObj );
119+
120+ } catch (Exception e ) {
121+ SdkTracker .trackAndLogBootException (
122+ NAME ,
123+ LogConstants .CATEGORY_LIFECYCLE ,
124+ LogConstants .SUBCATEGORY_HYPER_SDK ,
125+ LogConstants .SDK_TRACKER_LABEL ,
126+ "Exception in processWithProps" ,
127+ e
128+ );
129+ }
130+ }
61131
62132 @ Override
63133 public void receiveCommand (@ NonNull FrameLayout root , String commandId , @ Nullable ReadableArray args ) {
0 commit comments