Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit ea665d9

Browse files
authored
basic implementation of modal on android to avoid runtime (#21)
1 parent 8a602f2 commit ea665d9

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
package com.modal;
9+
10+
import com.facebook.react.module.annotations.ReactModule;
11+
import com.facebook.react.views.modal.ReactModalHostManager;
12+
13+
/** View manager for {@link ReactModalHostView} components. */
14+
@ReactModule(name = ReactModalHostManager.REACT_CLASS)
15+
public class ReactModalHostManagerImproved extends ReactModalHostManager {
16+
17+
public static final String REACT_CLASS = "RCTModalHostViewImproved";
18+
19+
@Override
20+
public String getName() {
21+
return REACT_CLASS;
22+
}
23+
}

android/src/main/java/com/text/TextViewPackage.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.facebook.react.bridge.NativeModule;
66
import com.facebook.react.bridge.ReactApplicationContext;
77
import com.facebook.react.uimanager.ViewManager;
8+
import com.modal.ReactModalHostManagerImproved;
89
import com.textinput.ReactTextInputImprovedManager;
910

1011
import java.util.ArrayList;
@@ -17,6 +18,7 @@ public List<ViewManager> createViewManagers(ReactApplicationContext reactContext
1718
List<ViewManager> viewManagers = new ArrayList<>();
1819
viewManagers.add(new ReactTextViewImprovedManager());
1920
viewManagers.add(new ReactTextInputImprovedManager());
21+
viewManagers.add(new ReactModalHostManagerImproved());
2022
return viewManagers;
2123
}
2224

0 commit comments

Comments
 (0)