mirror of
https://github.com/status-im/react-native-webview.git
synced 2026-08-31 11:41:08 +00:00
chore(Android): Convert RNCWebViewPackage to Kotlin (#1194)
* RN is implementation dependency * renamed: RNCWebViewPackage.java -> RNCWebViewPackage.kt * migrate RNCWebViewPackage to Kotlin Co-authored-by: Jason Safaiyeh <safaiyeh@protonmail.com>
This commit is contained in:
co-authored by
Jason Safaiyeh
parent
f65783d348
commit
e6241cbb6a
@@ -1,27 +0,0 @@
|
||||
package com.reactnativecommunity.webview;
|
||||
|
||||
import com.facebook.react.ReactPackage;
|
||||
import com.facebook.react.bridge.JavaScriptModule;
|
||||
import com.facebook.react.bridge.NativeModule;
|
||||
import com.facebook.react.bridge.ReactApplicationContext;
|
||||
import com.facebook.react.uimanager.ViewManager;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class RNCWebViewPackage implements ReactPackage {
|
||||
@Override
|
||||
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
|
||||
return Collections.singletonList(new RNCWebViewModule(reactContext));
|
||||
}
|
||||
|
||||
// Deprecated from RN 0.47
|
||||
public List<Class<? extends JavaScriptModule>> createJSModules() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
|
||||
return Collections.singletonList(new RNCWebViewManager());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.reactnativecommunity.webview
|
||||
|
||||
import com.facebook.react.ReactPackage
|
||||
import com.facebook.react.bridge.ReactApplicationContext
|
||||
|
||||
|
||||
class RNCWebViewPackage: ReactPackage {
|
||||
override fun createNativeModules(reactContext: ReactApplicationContext) = listOf(
|
||||
RNCWebViewModule(reactContext)
|
||||
)
|
||||
|
||||
override fun createViewManagers(reactContext: ReactApplicationContext) = listOf(
|
||||
RNCWebViewManager()
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user