Browse Source

Rename ReactWebView to RNCWebView, remove more infinitered references

Jamon Holmgren 6 years ago
parent
commit
f9b9d3c092

+ 1
- 0
WebTest/android/app/build.gradle View File

137
 }
137
 }
138
 
138
 
139
 dependencies {
139
 dependencies {
140
+    compile project(':react-native-webview')
140
     compile fileTree(dir: "libs", include: ["*.jar"])
141
     compile fileTree(dir: "libs", include: ["*.jar"])
141
     compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
142
     compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
142
     compile "com.facebook.react:react-native:+"  // From node_modules
143
     compile "com.facebook.react:react-native:+"  // From node_modules

+ 3
- 1
WebTest/android/app/src/main/java/com/webtest/MainApplication.java View File

3
 import android.app.Application;
3
 import android.app.Application;
4
 
4
 
5
 import com.facebook.react.ReactApplication;
5
 import com.facebook.react.ReactApplication;
6
+import com.reactnativecommunity.webview.RNCWebViewPackage;
6
 import com.facebook.react.ReactNativeHost;
7
 import com.facebook.react.ReactNativeHost;
7
 import com.facebook.react.ReactPackage;
8
 import com.facebook.react.ReactPackage;
8
 import com.facebook.react.shell.MainReactPackage;
9
 import com.facebook.react.shell.MainReactPackage;
22
     @Override
23
     @Override
23
     protected List<ReactPackage> getPackages() {
24
     protected List<ReactPackage> getPackages() {
24
       return Arrays.<ReactPackage>asList(
25
       return Arrays.<ReactPackage>asList(
25
-          new MainReactPackage()
26
+          new MainReactPackage(),
27
+            new RNCWebViewPackage()
26
       );
28
       );
27
     }
29
     }
28
 
30
 

+ 2
- 0
WebTest/android/settings.gradle View File

1
 rootProject.name = 'WebTest'
1
 rootProject.name = 'WebTest'
2
+include ':react-native-webview'
3
+project(':react-native-webview').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-webview/android')
2
 
4
 
3
 include ':app'
5
 include ':app'

+ 62
- 2
WebTest/ios/WebTest.xcodeproj/project.pbxproj View File

5
 	};
5
 	};
6
 	objectVersion = 46;
6
 	objectVersion = 46;
7
 	objects = {
7
 	objects = {
8
-
9
 /* Begin PBXBuildFile section */
8
 /* Begin PBXBuildFile section */
10
 		00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; };
9
 		00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; };
11
 		00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; };
10
 		00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; };
38
 		5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; };
37
 		5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; };
39
 		832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
38
 		832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
40
 		ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */; };
39
 		ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */; };
40
+		0DEB930C40564C6EA64B2F22 /* libRNCWebView.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 694F766453F2454298825A66 /* libRNCWebView.a */; };
41
 /* End PBXBuildFile section */
41
 /* End PBXBuildFile section */
42
 
42
 
43
 /* Begin PBXContainerItemProxy section */
43
 /* Begin PBXContainerItemProxy section */
343
 		78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
343
 		78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
344
 		832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
344
 		832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
345
 		ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTBlob.xcodeproj; path = "../node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj"; sourceTree = "<group>"; };
345
 		ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTBlob.xcodeproj; path = "../node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj"; sourceTree = "<group>"; };
346
+		145424F98F774DD4816B6AB1 /* RNCWebView.xcodeproj */ = {isa = PBXFileReference; name = "RNCWebView.xcodeproj"; path = "../node_modules/react-native-webview/ios/RNCWebView.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
347
+		694F766453F2454298825A66 /* libRNCWebView.a */ = {isa = PBXFileReference; name = "libRNCWebView.a"; path = "libRNCWebView.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
346
 /* End PBXFileReference section */
348
 /* End PBXFileReference section */
347
 
349
 
348
 /* Begin PBXFrameworksBuildPhase section */
350
 /* Begin PBXFrameworksBuildPhase section */
371
 				832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,
373
 				832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,
372
 				00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,
374
 				00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,
373
 				139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,
375
 				139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,
376
+				0DEB930C40564C6EA64B2F22 /* libRNCWebView.a in Frameworks */,
374
 			);
377
 			);
375
 			runOnlyForDeploymentPostprocessing = 0;
378
 			runOnlyForDeploymentPostprocessing = 0;
376
 		};
379
 		};
557
 				832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,
560
 				832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,
558
 				00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
561
 				00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
559
 				139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
562
 				139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
563
+				145424F98F774DD4816B6AB1 /* RNCWebView.xcodeproj */,
560
 			);
564
 			);
561
 			name = Libraries;
565
 			name = Libraries;
562
 			sourceTree = "<group>";
566
 			sourceTree = "<group>";
685
 		83CBB9F71A601CBA00E9B192 /* Project object */ = {
689
 		83CBB9F71A601CBA00E9B192 /* Project object */ = {
686
 			isa = PBXProject;
690
 			isa = PBXProject;
687
 			attributes = {
691
 			attributes = {
688
-				LastUpgradeCheck = 0610;
692
+				LastUpgradeCheck = 610;
689
 				ORGANIZATIONNAME = Facebook;
693
 				ORGANIZATIONNAME = Facebook;
690
 				TargetAttributes = {
694
 				TargetAttributes = {
691
 					00E356ED1AD99517003FC87E = {
695
 					00E356ED1AD99517003FC87E = {
1181
 				);
1185
 				);
1182
 				PRODUCT_NAME = "$(TARGET_NAME)";
1186
 				PRODUCT_NAME = "$(TARGET_NAME)";
1183
 				TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WebTest.app/WebTest";
1187
 				TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WebTest.app/WebTest";
1188
+				LIBRARY_SEARCH_PATHS = (
1189
+					"$(inherited)",
1190
+					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1191
+				);
1192
+				HEADER_SEARCH_PATHS = (
1193
+					"$(inherited)",
1194
+					"$(SRCROOT)/../node_modules/react-native-webview/ios/**",
1195
+				);
1184
 			};
1196
 			};
1185
 			name = Debug;
1197
 			name = Debug;
1186
 		};
1198
 		};
1198
 				);
1210
 				);
1199
 				PRODUCT_NAME = "$(TARGET_NAME)";
1211
 				PRODUCT_NAME = "$(TARGET_NAME)";
1200
 				TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WebTest.app/WebTest";
1212
 				TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WebTest.app/WebTest";
1213
+				LIBRARY_SEARCH_PATHS = (
1214
+					"$(inherited)",
1215
+					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1216
+				);
1217
+				HEADER_SEARCH_PATHS = (
1218
+					"$(inherited)",
1219
+					"$(SRCROOT)/../node_modules/react-native-webview/ios/**",
1220
+				);
1201
 			};
1221
 			};
1202
 			name = Release;
1222
 			name = Release;
1203
 		};
1223
 		};
1216
 				);
1236
 				);
1217
 				PRODUCT_NAME = WebTest;
1237
 				PRODUCT_NAME = WebTest;
1218
 				VERSIONING_SYSTEM = "apple-generic";
1238
 				VERSIONING_SYSTEM = "apple-generic";
1239
+				HEADER_SEARCH_PATHS = (
1240
+					"$(inherited)",
1241
+					"$(SRCROOT)/../node_modules/react-native-webview/ios/**",
1242
+				);
1219
 			};
1243
 			};
1220
 			name = Debug;
1244
 			name = Debug;
1221
 		};
1245
 		};
1233
 				);
1257
 				);
1234
 				PRODUCT_NAME = WebTest;
1258
 				PRODUCT_NAME = WebTest;
1235
 				VERSIONING_SYSTEM = "apple-generic";
1259
 				VERSIONING_SYSTEM = "apple-generic";
1260
+				HEADER_SEARCH_PATHS = (
1261
+					"$(inherited)",
1262
+					"$(SRCROOT)/../node_modules/react-native-webview/ios/**",
1263
+				);
1236
 			};
1264
 			};
1237
 			name = Release;
1265
 			name = Release;
1238
 		};
1266
 		};
1259
 				SDKROOT = appletvos;
1287
 				SDKROOT = appletvos;
1260
 				TARGETED_DEVICE_FAMILY = 3;
1288
 				TARGETED_DEVICE_FAMILY = 3;
1261
 				TVOS_DEPLOYMENT_TARGET = 9.2;
1289
 				TVOS_DEPLOYMENT_TARGET = 9.2;
1290
+				LIBRARY_SEARCH_PATHS = (
1291
+					"$(inherited)",
1292
+					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1293
+				);
1294
+				HEADER_SEARCH_PATHS = (
1295
+					"$(inherited)",
1296
+					"$(SRCROOT)/../node_modules/react-native-webview/ios/**",
1297
+				);
1262
 			};
1298
 			};
1263
 			name = Debug;
1299
 			name = Debug;
1264
 		};
1300
 		};
1285
 				SDKROOT = appletvos;
1321
 				SDKROOT = appletvos;
1286
 				TARGETED_DEVICE_FAMILY = 3;
1322
 				TARGETED_DEVICE_FAMILY = 3;
1287
 				TVOS_DEPLOYMENT_TARGET = 9.2;
1323
 				TVOS_DEPLOYMENT_TARGET = 9.2;
1324
+				LIBRARY_SEARCH_PATHS = (
1325
+					"$(inherited)",
1326
+					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1327
+				);
1328
+				HEADER_SEARCH_PATHS = (
1329
+					"$(inherited)",
1330
+					"$(SRCROOT)/../node_modules/react-native-webview/ios/**",
1331
+				);
1288
 			};
1332
 			};
1289
 			name = Release;
1333
 			name = Release;
1290
 		};
1334
 		};
1310
 				SDKROOT = appletvos;
1354
 				SDKROOT = appletvos;
1311
 				TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WebTest-tvOS.app/WebTest-tvOS";
1355
 				TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WebTest-tvOS.app/WebTest-tvOS";
1312
 				TVOS_DEPLOYMENT_TARGET = 10.1;
1356
 				TVOS_DEPLOYMENT_TARGET = 10.1;
1357
+				LIBRARY_SEARCH_PATHS = (
1358
+					"$(inherited)",
1359
+					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1360
+				);
1361
+				HEADER_SEARCH_PATHS = (
1362
+					"$(inherited)",
1363
+					"$(SRCROOT)/../node_modules/react-native-webview/ios/**",
1364
+				);
1313
 			};
1365
 			};
1314
 			name = Debug;
1366
 			name = Debug;
1315
 		};
1367
 		};
1335
 				SDKROOT = appletvos;
1387
 				SDKROOT = appletvos;
1336
 				TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WebTest-tvOS.app/WebTest-tvOS";
1388
 				TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WebTest-tvOS.app/WebTest-tvOS";
1337
 				TVOS_DEPLOYMENT_TARGET = 10.1;
1389
 				TVOS_DEPLOYMENT_TARGET = 10.1;
1390
+				LIBRARY_SEARCH_PATHS = (
1391
+					"$(inherited)",
1392
+					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1393
+				);
1394
+				HEADER_SEARCH_PATHS = (
1395
+					"$(inherited)",
1396
+					"$(SRCROOT)/../node_modules/react-native-webview/ios/**",
1397
+				);
1338
 			};
1398
 			};
1339
 			name = Release;
1399
 			name = Release;
1340
 		};
1400
 		};

+ 2
- 1
WebTest/package.json View File

8
   },
8
   },
9
   "dependencies": {
9
   "dependencies": {
10
     "react": "16.4.1",
10
     "react": "16.4.1",
11
-    "react-native": "0.56.0"
11
+    "react-native": "0.56.0",
12
+    "react-native-webview": "../"
12
   },
13
   },
13
   "devDependencies": {
14
   "devDependencies": {
14
     "@babel/core": "^7.0.0-beta",
15
     "@babel/core": "^7.0.0-beta",

+ 1
- 1
android/src/main/AndroidManifest.xml View File

1
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.infinitered.webview">
1
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.reactnativecommunity.webview">
2
 </manifest>
2
 </manifest>

android/src/main/java/com/infinitered/webview/ReactWebViewManager.java → android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java View File

1
-package com.infinitered.webview;
1
+package com.reactnativecommunity.webview;
2
 
2
 
3
 import android.annotation.TargetApi;
3
 import android.annotation.TargetApi;
4
 import android.content.Context;
4
 import android.content.Context;
49
 import com.facebook.react.uimanager.events.ContentSizeChangeEvent;
49
 import com.facebook.react.uimanager.events.ContentSizeChangeEvent;
50
 import com.facebook.react.uimanager.events.Event;
50
 import com.facebook.react.uimanager.events.Event;
51
 import com.facebook.react.uimanager.events.EventDispatcher;
51
 import com.facebook.react.uimanager.events.EventDispatcher;
52
-import com.infinitered.webview.events.TopLoadingErrorEvent;
53
-import com.infinitered.webview.events.TopLoadingFinishEvent;
54
-import com.infinitered.webview.events.TopLoadingStartEvent;
55
-import com.infinitered.webview.events.TopMessageEvent;
52
+import com.reactnativecommunity.webview.events.TopLoadingErrorEvent;
53
+import com.reactnativecommunity.webview.events.TopLoadingFinishEvent;
54
+import com.reactnativecommunity.webview.events.TopLoadingStartEvent;
55
+import com.reactnativecommunity.webview.events.TopMessageEvent;
56
 import java.io.UnsupportedEncodingException;
56
 import java.io.UnsupportedEncodingException;
57
 import java.util.ArrayList;
57
 import java.util.ArrayList;
58
 import java.util.HashMap;
58
 import java.util.HashMap;
83
  *  - canGoBack - boolean, whether there is anything on a history stack to go back
83
  *  - canGoBack - boolean, whether there is anything on a history stack to go back
84
  *  - canGoForward - boolean, whether it is possible to request GO_FORWARD command
84
  *  - canGoForward - boolean, whether it is possible to request GO_FORWARD command
85
  */
85
  */
86
-@ReactModule(name = ReactWebViewManager.REACT_CLASS)
87
-public class ReactWebViewManager extends SimpleViewManager<WebView> {
86
+@ReactModule(name = RNCWebViewManager.REACT_CLASS)
87
+public class RNCWebViewManager extends SimpleViewManager<WebView> {
88
 
88
 
89
   protected static final String REACT_CLASS = "RNCWebView";
89
   protected static final String REACT_CLASS = "RNCWebView";
90
 
90
 
108
   protected WebViewConfig mWebViewConfig;
108
   protected WebViewConfig mWebViewConfig;
109
   protected @Nullable WebView.PictureListener mPictureListener;
109
   protected @Nullable WebView.PictureListener mPictureListener;
110
 
110
 
111
-  protected static class ReactWebViewClient extends WebViewClient {
111
+  protected static class RNCWebViewClient extends WebViewClient {
112
 
112
 
113
     protected boolean mLastLoadFailed = false;
113
     protected boolean mLastLoadFailed = false;
114
     protected @Nullable ReadableArray mUrlPrefixesForDefaultIntent;
114
     protected @Nullable ReadableArray mUrlPrefixesForDefaultIntent;
119
       super.onPageFinished(webView, url);
119
       super.onPageFinished(webView, url);
120
 
120
 
121
       if (!mLastLoadFailed) {
121
       if (!mLastLoadFailed) {
122
-        ReactWebView reactWebView = (ReactWebView) webView;
122
+        RNCWebView reactWebView = (RNCWebView) webView;
123
         reactWebView.callInjectedJavaScript();
123
         reactWebView.callInjectedJavaScript();
124
         reactWebView.linkBridge();
124
         reactWebView.linkBridge();
125
         emitFinishEvent(webView, url);
125
         emitFinishEvent(webView, url);
242
    * Subclass of {@link WebView} that implements {@link LifecycleEventListener} interface in order
242
    * Subclass of {@link WebView} that implements {@link LifecycleEventListener} interface in order
243
    * to call {@link WebView#destroy} on activity destroy event and also to clear the client
243
    * to call {@link WebView#destroy} on activity destroy event and also to clear the client
244
    */
244
    */
245
-  protected static class ReactWebView extends WebView implements LifecycleEventListener {
245
+  protected static class RNCWebView extends WebView implements LifecycleEventListener {
246
     protected @Nullable String injectedJS;
246
     protected @Nullable String injectedJS;
247
     protected boolean messagingEnabled = false;
247
     protected boolean messagingEnabled = false;
248
-    protected @Nullable ReactWebViewClient mReactWebViewClient;
248
+    protected @Nullable RNCWebViewClient mRNCWebViewClient;
249
 
249
 
250
-    protected class ReactWebViewBridge {
251
-      ReactWebView mContext;
250
+    protected class RNCWebViewBridge {
251
+      RNCWebView mContext;
252
 
252
 
253
-      ReactWebViewBridge(ReactWebView c) {
253
+      RNCWebViewBridge(RNCWebView c) {
254
         mContext = c;
254
         mContext = c;
255
       }
255
       }
256
 
256
 
267
      * Reactive Native needed for access to ReactNative internal system functionality
267
      * Reactive Native needed for access to ReactNative internal system functionality
268
      *
268
      *
269
      */
269
      */
270
-    public ReactWebView(ThemedReactContext reactContext) {
270
+    public RNCWebView(ThemedReactContext reactContext) {
271
       super(reactContext);
271
       super(reactContext);
272
     }
272
     }
273
 
273
 
289
     @Override
289
     @Override
290
     public void setWebViewClient(WebViewClient client) {
290
     public void setWebViewClient(WebViewClient client) {
291
       super.setWebViewClient(client);
291
       super.setWebViewClient(client);
292
-      mReactWebViewClient = (ReactWebViewClient)client;
292
+      mRNCWebViewClient = (RNCWebViewClient)client;
293
     }
293
     }
294
 
294
 
295
-    public @Nullable ReactWebViewClient getReactWebViewClient() {
296
-      return mReactWebViewClient;
295
+    public @Nullable RNCWebViewClient getRNCWebViewClient() {
296
+      return mRNCWebViewClient;
297
     }
297
     }
298
 
298
 
299
     public void setInjectedJavaScript(@Nullable String js) {
299
     public void setInjectedJavaScript(@Nullable String js) {
300
       injectedJS = js;
300
       injectedJS = js;
301
     }
301
     }
302
 
302
 
303
-    protected ReactWebViewBridge createReactWebViewBridge(ReactWebView webView) {
304
-      return new ReactWebViewBridge(webView);
303
+    protected RNCWebViewBridge createRNCWebViewBridge(RNCWebView webView) {
304
+      return new RNCWebViewBridge(webView);
305
     }
305
     }
306
 
306
 
307
     public void setMessagingEnabled(boolean enabled) {
307
     public void setMessagingEnabled(boolean enabled) {
311
 
311
 
312
       messagingEnabled = enabled;
312
       messagingEnabled = enabled;
313
       if (enabled) {
313
       if (enabled) {
314
-        addJavascriptInterface(createReactWebViewBridge(this), BRIDGE_NAME);
314
+        addJavascriptInterface(createRNCWebViewBridge(this), BRIDGE_NAME);
315
         linkBridge();
315
         linkBridge();
316
       } else {
316
       } else {
317
         removeJavascriptInterface(BRIDGE_NAME);
317
         removeJavascriptInterface(BRIDGE_NAME);
360
     }
360
     }
361
   }
361
   }
362
 
362
 
363
-  public ReactWebViewManager() {
363
+  public RNCWebViewManager() {
364
     mWebViewConfig = new WebViewConfig() {
364
     mWebViewConfig = new WebViewConfig() {
365
       public void configWebView(WebView webView) {
365
       public void configWebView(WebView webView) {
366
       }
366
       }
367
     };
367
     };
368
   }
368
   }
369
 
369
 
370
-  public ReactWebViewManager(WebViewConfig webViewConfig) {
370
+  public RNCWebViewManager(WebViewConfig webViewConfig) {
371
     mWebViewConfig = webViewConfig;
371
     mWebViewConfig = webViewConfig;
372
   }
372
   }
373
 
373
 
376
     return REACT_CLASS;
376
     return REACT_CLASS;
377
   }
377
   }
378
 
378
 
379
-  protected ReactWebView createReactWebViewInstance(ThemedReactContext reactContext) {
380
-    return new ReactWebView(reactContext);
379
+  protected RNCWebView createRNCWebViewInstance(ThemedReactContext reactContext) {
380
+    return new RNCWebView(reactContext);
381
   }
381
   }
382
 
382
 
383
   @Override
383
   @Override
384
   @TargetApi(Build.VERSION_CODES.LOLLIPOP)
384
   @TargetApi(Build.VERSION_CODES.LOLLIPOP)
385
   protected WebView createViewInstance(ThemedReactContext reactContext) {
385
   protected WebView createViewInstance(ThemedReactContext reactContext) {
386
-    ReactWebView webView = createReactWebViewInstance(reactContext);
386
+    RNCWebView webView = createRNCWebViewInstance(reactContext);
387
     webView.setWebChromeClient(new WebChromeClient() {
387
     webView.setWebChromeClient(new WebChromeClient() {
388
       @Override
388
       @Override
389
       public boolean onConsoleMessage(ConsoleMessage message) {
389
       public boolean onConsoleMessage(ConsoleMessage message) {
474
 
474
 
475
   @ReactProp(name = "injectedJavaScript")
475
   @ReactProp(name = "injectedJavaScript")
476
   public void setInjectedJavaScript(WebView view, @Nullable String injectedJavaScript) {
476
   public void setInjectedJavaScript(WebView view, @Nullable String injectedJavaScript) {
477
-    ((ReactWebView) view).setInjectedJavaScript(injectedJavaScript);
477
+    ((RNCWebView) view).setInjectedJavaScript(injectedJavaScript);
478
   }
478
   }
479
 
479
 
480
   @ReactProp(name = "messagingEnabled")
480
   @ReactProp(name = "messagingEnabled")
481
   public void setMessagingEnabled(WebView view, boolean enabled) {
481
   public void setMessagingEnabled(WebView view, boolean enabled) {
482
-    ((ReactWebView) view).setMessagingEnabled(enabled);
482
+    ((RNCWebView) view).setMessagingEnabled(enabled);
483
   }
483
   }
484
 
484
 
485
   @ReactProp(name = "source")
485
   @ReactProp(name = "source")
568
   public void setUrlPrefixesForDefaultIntent(
568
   public void setUrlPrefixesForDefaultIntent(
569
       WebView view,
569
       WebView view,
570
       @Nullable ReadableArray urlPrefixesForDefaultIntent) {
570
       @Nullable ReadableArray urlPrefixesForDefaultIntent) {
571
-    ReactWebViewClient client = ((ReactWebView) view).getReactWebViewClient();
571
+    RNCWebViewClient client = ((RNCWebView) view).getRNCWebViewClient();
572
     if (client != null && urlPrefixesForDefaultIntent != null) {
572
     if (client != null && urlPrefixesForDefaultIntent != null) {
573
       client.setUrlPrefixesForDefaultIntent(urlPrefixesForDefaultIntent);
573
       client.setUrlPrefixesForDefaultIntent(urlPrefixesForDefaultIntent);
574
     }
574
     }
585
   public void setOriginWhitelist(
585
   public void setOriginWhitelist(
586
     WebView view,
586
     WebView view,
587
     @Nullable ReadableArray originWhitelist) {
587
     @Nullable ReadableArray originWhitelist) {
588
-    ReactWebViewClient client = ((ReactWebView) view).getReactWebViewClient();
588
+    RNCWebViewClient client = ((RNCWebView) view).getRNCWebViewClient();
589
     if (client != null && originWhitelist != null) {
589
     if (client != null && originWhitelist != null) {
590
       List<Pattern> whiteList = new LinkedList<>();
590
       List<Pattern> whiteList = new LinkedList<>();
591
       for (int i = 0 ; i < originWhitelist.size() ; i++) {
591
       for (int i = 0 ; i < originWhitelist.size() ; i++) {
598
   @Override
598
   @Override
599
   protected void addEventEmitters(ThemedReactContext reactContext, WebView view) {
599
   protected void addEventEmitters(ThemedReactContext reactContext, WebView view) {
600
     // Do not register default touch emitter and let WebView implementation handle touches
600
     // Do not register default touch emitter and let WebView implementation handle touches
601
-    view.setWebViewClient(new ReactWebViewClient());
601
+    view.setWebViewClient(new RNCWebViewClient());
602
   }
602
   }
603
 
603
 
604
   @Override
604
   @Override
656
   @Override
656
   @Override
657
   public void onDropViewInstance(WebView webView) {
657
   public void onDropViewInstance(WebView webView) {
658
     super.onDropViewInstance(webView);
658
     super.onDropViewInstance(webView);
659
-    ((ThemedReactContext) webView.getContext()).removeLifecycleEventListener((ReactWebView) webView);
660
-    ((ReactWebView) webView).cleanupCallbacksAndDestroy();
659
+    ((ThemedReactContext) webView.getContext()).removeLifecycleEventListener((RNCWebView) webView);
660
+    ((RNCWebView) webView).cleanupCallbacksAndDestroy();
661
   }
661
   }
662
 
662
 
663
   protected WebView.PictureListener getPictureListener() {
663
   protected WebView.PictureListener getPictureListener() {

android/src/main/java/com/infinitered/webview/ReactWebViewModule.java → android/src/main/java/com/reactnativecommunity/webview/RNCWebViewModule.java View File

1
 
1
 
2
-package com.infinitered.webview;
2
+package com.reactnativecommunity.webview;
3
 
3
 
4
 import com.facebook.react.bridge.ReactApplicationContext;
4
 import com.facebook.react.bridge.ReactApplicationContext;
5
 import com.facebook.react.bridge.ReactContextBaseJavaModule;
5
 import com.facebook.react.bridge.ReactContextBaseJavaModule;
6
 import com.facebook.react.bridge.ReactMethod;
6
 import com.facebook.react.bridge.ReactMethod;
7
 import com.facebook.react.bridge.Callback;
7
 import com.facebook.react.bridge.Callback;
8
 
8
 
9
-public class ReactWebViewModule extends ReactContextBaseJavaModule {
9
+public class RNCWebViewModule extends ReactContextBaseJavaModule {
10
 
10
 
11
   private final ReactApplicationContext reactContext;
11
   private final ReactApplicationContext reactContext;
12
 
12
 
13
-  public ReactWebViewModule(ReactApplicationContext reactContext) {
13
+  public RNCWebViewModule(ReactApplicationContext reactContext) {
14
     super(reactContext);
14
     super(reactContext);
15
     this.reactContext = reactContext;
15
     this.reactContext = reactContext;
16
   }
16
   }

android/src/main/java/com/infinitered/webview/ReactWebViewPackage.java → android/src/main/java/com/reactnativecommunity/webview/RNCWebViewPackage.java View File

1
 
1
 
2
-package com.infinitered.webview;
2
+package com.reactnativecommunity.webview;
3
 
3
 
4
 import java.util.Arrays;
4
 import java.util.Arrays;
5
 import java.util.Collections;
5
 import java.util.Collections;
10
 import com.facebook.react.bridge.ReactApplicationContext;
10
 import com.facebook.react.bridge.ReactApplicationContext;
11
 import com.facebook.react.uimanager.ViewManager;
11
 import com.facebook.react.uimanager.ViewManager;
12
 import com.facebook.react.bridge.JavaScriptModule;
12
 import com.facebook.react.bridge.JavaScriptModule;
13
-public class ReactWebViewPackage implements ReactPackage {
13
+public class RNCWebViewPackage implements ReactPackage {
14
     @Override
14
     @Override
15
     public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
15
     public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
16
-      return Arrays.<NativeModule>asList(new ReactWebViewModule(reactContext));
16
+      return Arrays.<NativeModule>asList(new RNCWebViewModule(reactContext));
17
     }
17
     }
18
 
18
 
19
     // Deprecated from RN 0.47
19
     // Deprecated from RN 0.47
23
 
23
 
24
     @Override
24
     @Override
25
     public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
25
     public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
26
-        ReactWebViewManager viewManager = new ReactWebViewManager();
26
+        RNCWebViewManager viewManager = new RNCWebViewManager();
27
         return Arrays.<ViewManager>asList(viewManager);
27
         return Arrays.<ViewManager>asList(viewManager);
28
     }
28
     }
29
 }
29
 }

android/src/main/java/com/infinitered/webview/WebViewConfig.java → android/src/main/java/com/reactnativecommunity/webview/WebViewConfig.java View File

1
-package com.infinitered.webview;
1
+package com.reactnativecommunity.webview;
2
 
2
 
3
 import android.webkit.WebView;
3
 import android.webkit.WebView;
4
 
4
 
5
 /**
5
 /**
6
  * Implement this interface in order to config your {@link WebView}. An instance of that
6
  * Implement this interface in order to config your {@link WebView}. An instance of that
7
- * implementation will have to be given as a constructor argument to {@link ReactWebViewManager}.
7
+ * implementation will have to be given as a constructor argument to {@link RNCWebViewManager}.
8
  */
8
  */
9
 public interface WebViewConfig {
9
 public interface WebViewConfig {
10
 
10
 

android/src/main/java/com/infinitered/webview/events/TopLoadingErrorEvent.java → android/src/main/java/com/reactnativecommunity/webview/events/TopLoadingErrorEvent.java View File

1
-package com.infinitered.webview.events;
1
+package com.reactnativecommunity.webview.events;
2
 
2
 
3
 import com.facebook.react.bridge.WritableMap;
3
 import com.facebook.react.bridge.WritableMap;
4
 import com.facebook.react.uimanager.events.Event;
4
 import com.facebook.react.uimanager.events.Event;

android/src/main/java/com/infinitered/webview/events/TopLoadingFinishEvent.java → android/src/main/java/com/reactnativecommunity/webview/events/TopLoadingFinishEvent.java View File

1
-package com.infinitered.webview.events;
1
+package com.reactnativecommunity.webview.events;
2
 
2
 
3
 import com.facebook.react.bridge.WritableMap;
3
 import com.facebook.react.bridge.WritableMap;
4
 import com.facebook.react.uimanager.events.Event;
4
 import com.facebook.react.uimanager.events.Event;

android/src/main/java/com/infinitered/webview/events/TopLoadingStartEvent.java → android/src/main/java/com/reactnativecommunity/webview/events/TopLoadingStartEvent.java View File

1
-package com.infinitered.webview.events;
1
+package com.reactnativecommunity.webview.events;
2
 
2
 
3
 import com.facebook.react.bridge.WritableMap;
3
 import com.facebook.react.bridge.WritableMap;
4
 import com.facebook.react.uimanager.events.Event;
4
 import com.facebook.react.uimanager.events.Event;

android/src/main/java/com/infinitered/webview/events/TopMessageEvent.java → android/src/main/java/com/reactnativecommunity/webview/events/TopMessageEvent.java View File

1
-package com.infinitered.webview.events;
1
+package com.reactnativecommunity.webview.events;
2
 
2
 
3
 import com.facebook.react.bridge.WritableMap;
3
 import com.facebook.react.bridge.WritableMap;
4
 import com.facebook.react.bridge.Arguments;
4
 import com.facebook.react.bridge.Arguments;