|
@@ -10,28 +10,46 @@
|
10
|
10
|
|
11
|
11
|
'use strict';
|
12
|
12
|
|
13
|
|
-const ActivityIndicator = require('ActivityIndicator');
|
14
|
|
-const EdgeInsetsPropType = require('EdgeInsetsPropType');
|
15
|
|
-const Linking = require('Linking');
|
16
|
|
-const PropTypes = require('prop-types');
|
17
|
|
-const React = require('React');
|
18
|
|
-const ReactNative = require('ReactNative');
|
19
|
|
-const ScrollView = require('ScrollView');
|
20
|
|
-const StyleSheet = require('StyleSheet');
|
21
|
|
-const Text = require('Text');
|
22
|
|
-const UIManager = require('UIManager');
|
23
|
|
-const View = require('View');
|
24
|
|
-const ViewPropTypes = require('ViewPropTypes');
|
25
|
|
-const WebViewShared = require('WebViewShared');
|
26
|
|
-
|
27
|
|
-const deprecatedPropType = require('deprecatedPropType');
|
28
|
|
-const invariant = require('fbjs/lib/invariant');
|
29
|
|
-const keyMirror = require('fbjs/lib/keyMirror');
|
30
|
|
-const processDecelerationRate = require('processDecelerationRate');
|
31
|
|
-const requireNativeComponent = require('requireNativeComponent');
|
32
|
|
-const resolveAssetSource = require('resolveAssetSource');
|
33
|
|
-
|
34
|
|
-const RCTWebViewManager = require('NativeModules').WebViewManager;
|
|
13
|
+import React from 'react';
|
|
14
|
+import PropTypes from 'prop-types';
|
|
15
|
+
|
|
16
|
+import ReactNative from 'react-native'
|
|
17
|
+import {
|
|
18
|
+ ActivityIndicator,
|
|
19
|
+ EdgeInsetsPropType,
|
|
20
|
+ Linking,
|
|
21
|
+ ScrollView,
|
|
22
|
+ StyleSheet,
|
|
23
|
+ Text,
|
|
24
|
+ UIManager,
|
|
25
|
+ View,
|
|
26
|
+ ViewPropTypes,
|
|
27
|
+ requireNativeComponent,
|
|
28
|
+ NativeModules,
|
|
29
|
+ Image
|
|
30
|
+} from 'react-native';
|
|
31
|
+
|
|
32
|
+import invariant from 'fbjs/lib/invariant';
|
|
33
|
+import keyMirror from 'fbjs/lib/keyMirror';
|
|
34
|
+
|
|
35
|
+import deprecatedPropType from 'deprecated-prop-type';
|
|
36
|
+
|
|
37
|
+import WebViewShared from './WebViewShared';
|
|
38
|
+
|
|
39
|
+const resolveAssetSource = Image.resolveAssetSource;
|
|
40
|
+
|
|
41
|
+// Imported from https://github.com/facebook/react-native/blob/master/Libraries/Components/ScrollView/processDecelerationRate.js
|
|
42
|
+function processDecelerationRate(decelerationRate) {
|
|
43
|
+ if (decelerationRate === 'normal') {
|
|
44
|
+ decelerationRate = 0.998;
|
|
45
|
+ } else if (decelerationRate === 'fast') {
|
|
46
|
+ decelerationRate = 0.99;
|
|
47
|
+ }
|
|
48
|
+ return decelerationRate;
|
|
49
|
+}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+const RCTWebViewManager = NativeModules.WebViewManager;
|
35
|
53
|
|
36
|
54
|
const BGWASH = 'rgba(255,255,255,0.8)';
|
37
|
55
|
const RCT_WEBVIEW_REF = 'webview';
|