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:
parent
f65783d348
commit
e6241cbb6a
|
@ -123,6 +123,6 @@ def kotlin_version = getExtOrDefault('kotlinVersion')
|
|||
|
||||
dependencies {
|
||||
//noinspection GradleDynamicVersion
|
||||
api 'com.facebook.react:react-native:+'
|
||||
implementation 'com.facebook.react:react-native:+'
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
)
|
||||
}
|
Loading…
Reference in New Issue