diff --git a/__tests__/data/17759.diff b/__tests__/data/17759.diff new file mode 100644 index 0000000..3f0518c --- /dev/null +++ b/__tests__/data/17759.diff @@ -0,0 +1,48 @@ +diff --git a/Libraries/Image/Image.ios.js b/Libraries/Image/Image.ios.js +index fd99b986b88..f8ae5a17211 100644 +--- a/Libraries/Image/Image.ios.js ++++ b/Libraries/Image/Image.ios.js +@@ -241,6 +241,10 @@ const Image = createReactClass({ + * + * - `repeat`: Repeat the image to cover the frame of the view. The + * image will keep it's size and aspect ratio. (iOS only) ++ * ++ * - 'center': Scale the image down so that it is completely visible, ++ * if bigger than the area of the view. ++ * The image will not be scaled up. + */ + resizeMode: PropTypes.oneOf([ + 'cover', +diff --git a/RNTester/js/ImageExample.js b/RNTester/js/ImageExample.js +index 6e677890404..7577b5b349c 100644 +--- a/RNTester/js/ImageExample.js ++++ b/RNTester/js/ImageExample.js +@@ -572,18 +572,16 @@ exports.examples = [ + /> + + : null } +- { Platform.OS === 'android' ? +- +- +- Center +- +- +- +- : null } ++ ++ ++ Center ++ ++ ++ + + + ); \ No newline at end of file diff --git a/__tests__/data/MapView.js.blame b/__tests__/data/MapView.js.blame deleted file mode 100644 index 90b0b80..0000000 --- a/__tests__/data/MapView.js.blame +++ /dev/null @@ -1,9049 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - react-native/Libraries/Components/MapView/MapView.js at master · facebook/react-native - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Skip to content - - - - - - - - - - - - - -
- -
-
- - -
-
-
- -
-
- - - -
    - -
  • -
    - -
    - - - - Watch - - - - -
    - -
    -
    -
    -
  • - -
  • -
    -
    - - -
    -
    - - -
    - -
  • - -
  • - - - Fork - - - - - -
  • -
- -

- - /react-native - -

- -
- -
- -
-
- - -Permalink - - - -
- Newer -
    -
  1. -
  2. -
  3. -
  4. -
  5. -
  6. -
  7. -
  8. -
  9. -
  10. -
- Older -
- -
-
-
- -
- - - -
- - 100644 - - 564 lines (508 sloc) - - 16.2 KB -
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Mar 10, 2015 - - @tadeuzagallo - [ReactNative] Oss GeoMap - -
1/**
- Mar 23, 2015 - - @vjeux - [ReactNative] Expanded license on js files - - - - -
2 * Copyright (c) 2015-present, Facebook, Inc.
3 * All rights reserved.
4 *
5 * This source code is licensed under the BSD-style license found in the
6 * LICENSE file in the root directory of this source tree. An additional grant
7 * of patent rights can be found in the PATENTS file in the same directory.
- Mar 10, 2015 - - @tadeuzagallo - [ReactNative] Oss GeoMap - -
8 *
9 * @providesModule MapView
- Mar 25, 2015 - - @bhosmer - flowified Libraries from Avik - - - - -
10 * @flow
- Mar 10, 2015 - - @tadeuzagallo - [ReactNative] Oss GeoMap - -
11 */
12'use strict';
13
- Dec 23, 2015 - - @shtefanntz - Added ColorPropType - - - - -
14const ColorPropType = require('ColorPropType');
- Dec 17, 2015 - - @nicklockwood - Added ability to use a custom view for MapView annotations - - - - -
15const EdgeInsetsPropType = require('EdgeInsetsPropType');
16const Image = require('Image');
- Nov 4, 2016 - - @davidaurelio - RN: Update React (2/2) - - - - -
17const NativeMethodsMixin = require('NativeMethodsMixin');
- Dec 17, 2015 - - @nicklockwood - Added ability to use a custom view for MapView annotations - - - - -
18const React = require('React');
19const StyleSheet = require('StyleSheet');
20const View = require('View');
21
- Jan 29, 2016 - - @janicduplessis - Add a deprecatedPropType module to show deprecation warnings - - - - -
22const deprecatedPropType = require('deprecatedPropType');
- Dec 17, 2015 - - @nicklockwood - Added ability to use a custom view for MapView annotations - - - - -
23const processColor = require('processColor');
24const resolveAssetSource = require('resolveAssetSource');
25const requireNativeComponent = require('requireNativeComponent');
- Mar 10, 2015 - - @tadeuzagallo - [ReactNative] Oss GeoMap - -
26
- Mar 25, 2015 - - @bhosmer - flowified Libraries from Avik - - - - -
27type Event = Object;
28
- Jun 24, 2016 - - @caabernathy - Update MapView doc - - - - -
29/**
- Nov 4, 2016 - - @mkonicek - Deprecate MapView in favor of airbnb/react-native-maps - - - - -
30 * State of an annotation on the map.
- Jun 24, 2016 - - @caabernathy - Update MapView doc - - - - -
31 */
- Jan 4, 2016 - - @browniefed - Implement draggable annotations on MapView. Closes #2512 - - - - -
32export type AnnotationDragState = $Enum<{
- Jun 24, 2016 - - @caabernathy - Update MapView doc - - - - -
33 /**
34 * Annotation is not being touched.
35 */
- Aug 9, 2016 - - @davidaurelio - Auto-fix lint errors - - - - -
36 idle: string,
- Jun 24, 2016 - - @caabernathy - Update MapView doc - - - - -
37 /**
38 * Annotation dragging has began.
39 */
- Aug 9, 2016 - - @davidaurelio - Auto-fix lint errors - - - - -
40 starting: string,
- Jun 24, 2016 - - @caabernathy - Update MapView doc - - - - -
41 /**
42 * Annotation is being dragged.
43 */
- Aug 9, 2016 - - @davidaurelio - Auto-fix lint errors - - - - -
44 dragging: string,
- Jun 24, 2016 - - @caabernathy - Update MapView doc - - - - -
45 /**
46 * Annotation dragging is being canceled.
47 */
- Aug 9, 2016 - - @davidaurelio - Auto-fix lint errors - - - - -
48 canceling: string,
- Jun 24, 2016 - - @caabernathy - Update MapView doc - - - - -
49 /**
50 * Annotation dragging has ended.
51 */
- Aug 9, 2016 - - @davidaurelio - Auto-fix lint errors - - - - -
52 ending: string,
- Jan 4, 2016 - - @browniefed - Implement draggable annotations on MapView. Closes #2512 - - - - -
53}>;
54
- Jun 13, 2016 - - @benhoyt - Note that MapView is not yet available on Android - - - - -
55/**
- Nov 4, 2016 - - @mkonicek - Deprecate MapView in favor of airbnb/react-native-maps - - - - -
56 * **IMPORTANT: This component is now DEPRECATED and will be removed
57 * in January 2017 (React Native version 0.42). This component only supports
58 * iOS.**
59 *
60 * **Please use
61 * [react-native-maps](https://github.com/airbnb/react-native-maps) by Airbnb
62 * instead of this component.** Our friends at Airbnb have done an amazing job
63 * building a cross-platform `MapView` component that is more feature
64 * complete. It is used extensively (over 9k installs / month).
- Jun 24, 2016 - - @caabernathy - Update MapView doc - - - - -
65 *
66 * `MapView` is used to display embeddable maps and annotations using
67 * `MKMapView`.
68 *
69 * ```
70 * import React, { Component } from 'react';
71 * import { MapView } from 'react-native';
72 *
73 * class MapMyRide extends Component {
74 * render() {
75 * return (
76 * <MapView
77 * style={{height: 200, margin: 40}}
78 * showsUserLocation={true}
79 * />
80 * );
81 * }
82 * }
83 * ```
84 *
- Jun 13, 2016 - - @benhoyt - Note that MapView is not yet available on Android - - - - -
85 */
86
- Dec 17, 2015 - - @nicklockwood - Added ability to use a custom view for MapView annotations - - - - -
87const MapView = React.createClass({
- Jan 4, 2016 - - @browniefed - Implement draggable annotations on MapView. Closes #2512 - - - - -
88
- Mar 10, 2015 - - @tadeuzagallo - [ReactNative] Oss GeoMap - -
89 mixins: [NativeMethodsMixin],
90
91 propTypes: {
- Nov 18, 2015 - - @kmagiera - Compose propTypes from View.propTypes where appropriate. - - - - -
92 ...View.propTypes,
- Mar 10, 2015 - - @tadeuzagallo - [ReactNative] Oss GeoMap - -
93 /**
- Jun 24, 2016 - - @caabernathy - Update MapView doc - - - - -
94 * Used to style and layout the `MapView`.
- Mar 10, 2015 - - @tadeuzagallo - [ReactNative] Oss GeoMap - -
95 */
96 style: View.propTypes.style,
97
98 /**
- Jan 6, 2016 - - @Crash-- - Map follow user location - - - - -
99 * If `true` the app will ask for the user's location and display it on
100 * the map. Default value is `false`.
- Mar 10, 2015 - - @tadeuzagallo - [ReactNative] Oss GeoMap - -
101 *
- Jun 24, 2016 - - @caabernathy - Update MapView doc - - - - -
102 * **NOTE**: You'll need to add the `NSLocationWhenInUseUsageDescription`
- Jan 6, 2016 - - @Crash-- - Map follow user location - - - - -
103 * key in Info.plist to enable geolocation, otherwise it will fail silently.
- Mar 10, 2015 - - @tadeuzagallo - [ReactNative] Oss GeoMap - -
104 */
105 showsUserLocation: React.PropTypes.bool,
106
107 /**
- Jan 6, 2016 - - @Crash-- - Map follow user location - - - - -
108 * If `true` the map will follow the user's location whenever it changes.
109 * Note that this has no effect unless `showsUserLocation` is enabled.
110 * Default value is `true`.
111 */
112 followUserLocation: React.PropTypes.bool,
- Jan 29, 2016 - - @janicduplessis - Add a deprecatedPropType module to show deprecation warnings - - - - -
113
- Jan 6, 2016 - - @Crash-- - Map follow user location - - - - -
114 /**
- Oct 29, 2015 - - @Andr3wHur5t - Added support for toggling POI visibility on iOS map view. - - - - -
115 * If `false` points of interest won't be displayed on the map.
116 * Default value is `true`.
117 */
118 showsPointsOfInterest: React.PropTypes.bool,
119
120 /**
- Jun 24, 2016 - - @caabernathy - Update MapView doc - - - - -
121 * If `false`, compass won't be displayed on the map.
- Nov 19, 2015 - - @gilchenzion - Add showsCompass to MapView props - - - - -
122 * Default value is `true`.
123 */
124 showsCompass: React.PropTypes.bool,
125
126 /**
- Nov 20, 2016 - - @donyu - Add in support for showing annotation callouts by default without the… - - - - -
127 * If `true` the map will show the callouts for all annotations without
128 * the user having to click on the annotation.
129 * Default value is `false`.
130 */
131 showsAnnotationCallouts: React.PropTypes.bool,
132
133 /**
- Mar 10, 2015 - - @tadeuzagallo - [ReactNative] Oss GeoMap - -
134 * If `false` the user won't be able to pinch/zoom the map.
- Sep 22, 2015 - - @ultralame - fix minor grammar and typo errors in comments - - - - -
135 * Default value is `true`.
- Mar 10, 2015 - - @tadeuzagallo - [ReactNative] Oss GeoMap - -
136 */
137 zoomEnabled: React.PropTypes.bool,
138
139 /**
140 * When this property is set to `true` and a valid camera is associated with
- Jul 5, 2016 - - @davidaurelio - Remove `node_modules/react` from the list of discoverable haste modules - - - - -
141 * the map, the camera's heading angle is used to rotate the plane of the
- Jun 24, 2016 - - @caabernathy - Update MapView doc - - - - -
142 * map around its center point.
143 *
144 * When this property is set to `false`, the
- Jul 5, 2016 - - @davidaurelio - Remove `node_modules/react` from the list of discoverable haste modules - - - - -
145 * camera's heading angle is ignored and the map is always oriented so
- Mar 10, 2015 - - @tadeuzagallo - [ReactNative] Oss GeoMap - -
146 * that true north is situated at the top of the map view
147 */
148 rotateEnabled: React.PropTypes.bool,
149
150 /**
151 * When this property is set to `true` and a valid camera is associated
- Jul 5, 2016 - - @davidaurelio - Remove `node_modules/react` from the list of discoverable haste modules - - - - -
152 * with the map, the camera's pitch angle is used to tilt the plane
- Jun 24, 2016 - - @caabernathy - Update MapView doc - - - - -
153 * of the map.
154 *
- Jul 5, 2016 - - @davidaurelio - Remove `node_modules/react` from the list of discoverable haste modules - - - - -
155 * When this property is set to `false`, the camera's pitch
- Mar 10, 2015 - - @tadeuzagallo - [ReactNative] Oss GeoMap - -
156 * angle is ignored and the map is always displayed as if the user
157 * is looking straight down onto it.
158 */
159 pitchEnabled: React.PropTypes.bool,
160
161 /**
162 * If `false` the user won't be able to change the map region being displayed.
163 * Default value is `true`.
164 */
165 scrollEnabled: React.PropTypes.bool,
166
167 /**
- Jun 11, 2015 - - - Add map type property (standard, satellite, hybrid) to MapView. - - - - -
168 * The map type to be displayed.
- Jun 25, 2015 - - @dvcrn - [MapView] Support for annotation callouts, annotation press, callout … - - - - -
169 *
- Jun 24, 2016 - - @caabernathy - Update MapView doc - - - - -
170 * - `standard`: Standard road map (default).
171 * - `satellite`: Satellite view.
172 * - `hybrid`: Satellite view with roads and points of interest overlaid.
- Jun 11, 2015 - - - Add map type property (standard, satellite, hybrid) to MapView. - - - - -
173 */
174 mapType: React.PropTypes.oneOf([
- Jun 25, 2015 - - @dvcrn - [MapView] Support for annotation callouts, annotation press, callout … - - - - -
175 'standard',
176 'satellite',
- Jun 11, 2015 - - - Add map type property (standard, satellite, hybrid) to MapView. - - - - -
177 'hybrid',
178 ]),
179
180 /**
- Mar 10, 2015 - - @tadeuzagallo - [ReactNative] Oss GeoMap - -
181 * The region to be displayed by the map.
182 *
183 * The region is defined by the center coordinates and the span of
184 * coordinates to display.
185 */
186 region: React.PropTypes.shape({
187 /**
188 * Coordinates for the center of the map.
189 */
190 latitude: React.PropTypes.number.isRequired,
191 longitude: React.PropTypes.number.isRequired,
192
193 /**
- Dec 15, 2015 - - @jutaz - Bugfix - Typos - - - - -
194 * Distance between the minimum and the maximum latitude/longitude
- Mar 10, 2015 - - @tadeuzagallo - [ReactNative] Oss GeoMap - -
195 * to be displayed.
196 */
- Dec 17, 2015 - - @nicklockwood - Added ability to use a custom view for MapView annotations - - - - -
197 latitudeDelta: React.PropTypes.number,
198 longitudeDelta: React.PropTypes.number,
- Mar 10, 2015 - - @tadeuzagallo - [ReactNative] Oss GeoMap - -
199 }),
200
201 /**
- Jun 24, 2016 - - @caabernathy - Update MapView doc - - - - -
202 * Map annotations with title and subtitle.
- Apr 15, 2015 - - @ginamdar - MapView to support MKPointAnnotation using new attribute annotate in … - - - - -
203 */
204 annotations: React.PropTypes.arrayOf(React.PropTypes.shape({
205 /**
206 * The location of the annotation.
207 */
208 latitude: React.PropTypes.number.isRequired,
209 longitude: React.PropTypes.number.isRequired,
210
211 /**
- Jun 25, 2015 - - @dvcrn - [MapView] Support for annotation callouts, annotation press, callout … - - - - -
212 * Whether the pin drop should be animated or not
213 */
214 animateDrop: React.PropTypes.bool,
- Jan 29, 2016 - - @janicduplessis - Add a deprecatedPropType module to show deprecation warnings - - - - -
215
- Jan 4, 2016 - - @browniefed - Implement draggable annotations on MapView. Closes #2512 - - - - -
216 /**
217 * Whether the pin should be draggable or not
218 */
219 draggable: React.PropTypes.bool,
220
221 /**
222 * Event that fires when the annotation drag state changes.
- Jan 29, 2016 - - @janicduplessis - Add a deprecatedPropType module to show deprecation warnings - - - - -
223 */
- Jan 4, 2016 - - @browniefed - Implement draggable annotations on MapView. Closes #2512 - - - - -
224 onDragStateChange: React.PropTypes.func,
- Jun 25, 2015 - - @dvcrn - [MapView] Support for annotation callouts, annotation press, callout … - - - - -
225
226 /**
- Jan 29, 2016 - - @jerolimov - Add MapView annotation callback when it gets / lost the focus - - - - -
227 * Event that fires when the annotation gets was tapped by the user
228 * and the callout view was displayed.
229 */
230 onFocus: React.PropTypes.func,
231
232 /**
233 * Event that fires when another annotation or the mapview itself
234 * was tapped and a previously shown annotation will be closed.
235 */
236 onBlur: React.PropTypes.func,
237
238 /**
- Jun 24, 2016 - - @caabernathy - Update MapView doc - - - - -
239 * Annotation title and subtile.
- Apr 15, 2015 - - @ginamdar - MapView to support MKPointAnnotation using new attribute annotate in … - - - - -
240 */
241 title: React.PropTypes.string,
242 subtitle: React.PropTypes.string,
- Dec 18, 2015 - - @gabelevi - Fixed Flow errors - - - - -
243
- Jun 25, 2015 - - @dvcrn - [MapView] Support for annotation callouts, annotation press, callout … - - - - -
244 /**
- Dec 17, 2015 - - @nicklockwood - Added ability to use a custom view for MapView annotations - - - - -
245 * Callout views.
- Jun 25, 2015 - - @dvcrn - [MapView] Support for annotation callouts, annotation press, callout … - - - - -
246 */
- Dec 17, 2015 - - @nicklockwood - Added ability to use a custom view for MapView annotations - - - - -
247 leftCalloutView: React.PropTypes.element,
248 rightCalloutView: React.PropTypes.element,
249 detailCalloutView: React.PropTypes.element,
- Dec 18, 2015 - - @gabelevi - Fixed Flow errors - - - - -
250
- Jun 25, 2015 - - @dvcrn - [MapView] Support for annotation callouts, annotation press, callout … - - - - -
251 /**
- Nov 26, 2015 - - @nicklockwood - Added support for custom color and image for map annotations - - - - -
252 * The pin color. This can be any valid color string, or you can use one
253 * of the predefined PinColors constants. Applies to both standard pins
254 * and custom pin images.
- Nov 30, 2015 - - @nicklockwood - Fixed MapView crash on iOS 8 and earlier - - - - -
255 *
256 * Note that on iOS 8 and earlier, only the standard PinColor constants
- Dec 15, 2015 - - @jutaz - Bugfix - Typos - - - - -
257 * are supported for regular pins. For custom pin images, any tintColor
- Nov 30, 2015 - - @nicklockwood - Fixed MapView crash on iOS 8 and earlier - - - - -
258 * value is supported on all iOS versions.
- Nov 26, 2015 - - @nicklockwood - Added support for custom color and image for map annotations - - - - -
259 */
- Dec 23, 2015 - - @shtefanntz - Added ColorPropType - - - - -
260 tintColor: ColorPropType,
- Nov 26, 2015 - - @nicklockwood - Added support for custom color and image for map annotations - - - - -
261
262 /**
263 * Custom pin image. This must be a static image resource inside the app.
264 */
265 image: Image.propTypes.source,
- Dec 1, 2015 - - @trave7er - fix several lint warnings - - - - -
266
- Nov 26, 2015 - - @timfpark - Add Polyline support to MapView - - - - -
267 /**
- Dec 17, 2015 - - @nicklockwood - Added ability to use a custom view for MapView annotations - - - - -
268 * Custom pin view. If set, this replaces the pin or custom pin image.
269 */
270 view: React.PropTypes.element,
271
272 /**
- Nov 26, 2015 - - @timfpark - Add Polyline support to MapView - - - - -
273 * annotation id
274 */
275 id: React.PropTypes.string,
- Dec 18, 2015 - - @gabelevi - Fixed Flow errors - - - - -
276
- Dec 17, 2015 - - @nicklockwood - Added ability to use a custom view for MapView annotations - - - - -
277 /**
278 * Deprecated. Use the left/right/detailsCalloutView props instead.
279 */
- Jan 29, 2016 - - @janicduplessis - Add a deprecatedPropType module to show deprecation warnings - - - - -
280 hasLeftCallout: deprecatedPropType(
281 React.PropTypes.bool,
282 'Use `leftCalloutView` instead.'
283 ),
284 hasRightCallout: deprecatedPropType(
285 React.PropTypes.bool,
286 'Use `rightCalloutView` instead.'
287 ),
288 onLeftCalloutPress: deprecatedPropType(
289 React.PropTypes.func,
290 'Use `leftCalloutView` instead.'
291 ),
292 onRightCalloutPress: deprecatedPropType(
293 React.PropTypes.func,
294 'Use `rightCalloutView` instead.'
295 ),
- Nov 26, 2015 - - @timfpark - Add Polyline support to MapView - - - - -
296 })),
297
298 /**
299 * Map overlays
300 */
301 overlays: React.PropTypes.arrayOf(React.PropTypes.shape({
302 /**
303 * Polyline coordinates
304 */
305 coordinates: React.PropTypes.arrayOf(React.PropTypes.shape({
306 latitude: React.PropTypes.number.isRequired,
307 longitude: React.PropTypes.number.isRequired
308 })),
- Jun 25, 2015 - - @dvcrn - [MapView] Support for annotation callouts, annotation press, callout … - - - - -
309
- Nov 26, 2015 - - @timfpark - Add Polyline support to MapView - - - - -
310 /**
311 * Line attributes
312 */
313 lineWidth: React.PropTypes.number,
- Dec 23, 2015 - - @shtefanntz - Added ColorPropType - - - - -
314 strokeColor: ColorPropType,
315 fillColor: ColorPropType,
- Nov 26, 2015 - - @timfpark - Add Polyline support to MapView - - - - -
316
317 /**
318 * Overlay id
319 */
320 id: React.PropTypes.string
- Apr 15, 2015 - - @ginamdar - MapView to support MKPointAnnotation using new attribute annotate in … - - - - -
321 })),
322
323 /**
- Jun 24, 2016 - - @caabernathy - Update MapView doc - - - - -
324 * Maximum size of the area that can be displayed.
- Mar 10, 2015 - - @tadeuzagallo - [ReactNative] Oss GeoMap - -
325 */
326 maxDelta: React.PropTypes.number,
327
328 /**
- Jun 24, 2016 - - @caabernathy - Update MapView doc - - - - -
329 * Minimum size of the area that can be displayed.
- Mar 10, 2015 - - @tadeuzagallo - [ReactNative] Oss GeoMap - -
330 */
331 minDelta: React.PropTypes.number,
332
333 /**
334 * Insets for the map's legal label, originally at bottom left of the map.
335 */
336 legalLabelInsets: EdgeInsetsPropType,
337
338 /**
339 * Callback that is called continuously when the user is dragging the map.
340 */
341 onRegionChange: React.PropTypes.func,
342
343 /**
344 * Callback that is called once, when the user is done moving the map.
345 */
346 onRegionChangeComplete: React.PropTypes.func,
- Jun 25, 2015 - - @dvcrn - [MapView] Support for annotation callouts, annotation press, callout … - - - - -
347
348 /**
- Jun 24, 2016 - - @caabernathy - Update MapView doc - - - - -
349 * Deprecated. Use annotation `onFocus` and `onBlur` instead.
- Jun 25, 2015 - - @dvcrn - [MapView] Support for annotation callouts, annotation press, callout … - - - - -
350 */
351 onAnnotationPress: React.PropTypes.func,
- Nov 18, 2015 - - @kmagiera - Use requireNativeComponent everywhere. - - - - -
352
353 /**
354 * @platform android
355 */
356 active: React.PropTypes.bool,
- Mar 10, 2015 - - @tadeuzagallo - [ReactNative] Oss GeoMap - -
357 },
358
- Mar 10, 2016 - - @nicklockwood - Removed unnecessary exportedConstants - - - - -
359 statics: {
360 /**
361 * Standard iOS MapView pin color constants, to be used with the
362 * `annotation.tintColor` property. On iOS 8 and earlier these are the
363 * only supported values when using regular pins. On iOS 9 and later
364 * you are not obliged to use these, but they are useful for matching
365 * the standard iOS look and feel.
366 */
367 PinColors: {
368 RED: '#ff3b30',
369 GREEN: '#4cd964',
370 PURPLE: '#c969e0',
371 },
372 },
373
- Nov 26, 2015 - - @nicklockwood - Added support for custom color and image for map annotations - - - - -
374 render: function() {
- Jan 6, 2016 - - @Crash-- - Map follow user location - - - - -
375 let children = [], {annotations, overlays, followUserLocation} = this.props;
- Dec 19, 2015 - - @nicklockwood - Fix map annotation view layout bug - - - - -
376 annotations = annotations && annotations.map((annotation: Object) => {
- Dec 17, 2015 - - @nicklockwood - Added ability to use a custom view for MapView annotations - - - - -
377 let {
378 id,
379 image,
380 tintColor,
381 view,
382 leftCalloutView,
383 rightCalloutView,
384 detailCalloutView,
385 } = annotation;
- Dec 18, 2015 - - @gabelevi - Fixed Flow errors - - - - -
386
- Dec 17, 2015 - - @nicklockwood - Added ability to use a custom view for MapView annotations - - - - -
387 if (!view && image && tintColor) {
388 view = <Image
389 style={{
390 tintColor: processColor(tintColor),
391 }}
392 source={image}
393 />;
- Dec 18, 2015 - - @nicklockwood - Fixed image source for MapView annotations - - - - -
394 image = undefined;
- Dec 17, 2015 - - @nicklockwood - Added ability to use a custom view for MapView annotations - - - - -
395 }
396 if (view) {
- Dec 18, 2015 - - @nicklockwood - Fixed image source for MapView annotations - - - - -
397 if (image) {
398 console.warn('`image` and `view` both set on annotation. Image will be ignored.');
399 }
- Dec 17, 2015 - - @nicklockwood - Added ability to use a custom view for MapView annotations - - - - -
400 var viewIndex = children.length;
401 children.push(React.cloneElement(view, {
- Apr 22, 2016 - - @gabelevi - Fix or suppress errors in react-native - - - - -
402 // $FlowFixMe - An array of styles should be fine
- Dec 17, 2015 - - @nicklockwood - Added ability to use a custom view for MapView annotations - - - - -
403 style: [styles.annotationView, view.props.style || {}]
404 }));
405 }
406 if (leftCalloutView) {
407 var leftCalloutViewIndex = children.length;
408 children.push(React.cloneElement(leftCalloutView, {
409 style: [styles.calloutView, leftCalloutView.props.style || {}]
410 }));
411 }
412 if (rightCalloutView) {
413 var rightCalloutViewIndex = children.length;
414 children.push(React.cloneElement(rightCalloutView, {
415 style: [styles.calloutView, rightCalloutView.props.style || {}]
416 }));
417 }
418 if (detailCalloutView) {
419 var detailCalloutViewIndex = children.length;
420 children.push(React.cloneElement(detailCalloutView, {
421 style: [styles.calloutView, detailCalloutView.props.style || {}]
422 }));
423 }
- Jan 29, 2016 - - @janicduplessis - Add a deprecatedPropType module to show deprecation warnings - - - - -
424
- Aug 9, 2016 - - @davidaurelio - Auto-fix lint errors - - - - -
425 const result = {
- Nov 26, 2015 - - @nicklockwood - Added support for custom color and image for map annotations - - - - -
426 ...annotation,
427 tintColor: tintColor && processColor(tintColor),
- Dec 19, 2015 - - @nicklockwood - Fix map annotation view layout bug - - - - -
428 image,
- Dec 17, 2015 - - @nicklockwood - Added ability to use a custom view for MapView annotations - - - - -
429 viewIndex,
430 leftCalloutViewIndex,
431 rightCalloutViewIndex,
432 detailCalloutViewIndex,
433 view: undefined,
434 leftCalloutView: undefined,
435 rightCalloutView: undefined,
436 detailCalloutView: undefined,
- Nov 26, 2015 - - @nicklockwood - Added support for custom color and image for map annotations - - - - -
437 };
- Dec 19, 2015 - - @nicklockwood - Fix map annotation view layout bug - - - - -
438 result.id = id || encodeURIComponent(JSON.stringify(result));
439 result.image = image && resolveAssetSource(image);
440 return result;
- Nov 26, 2015 - - @nicklockwood - Added support for custom color and image for map annotations - - - - -
441 });
- Dec 19, 2015 - - @nicklockwood - Fix map annotation view layout bug - - - - -
442 overlays = overlays && overlays.map((overlay: Object) => {
- Aug 9, 2016 - - @davidaurelio - Auto-fix lint errors - - - - -
443 const {id, fillColor, strokeColor} = overlay;
444 const result = {
- Nov 26, 2015 - - @timfpark - Add Polyline support to MapView - - - - -
445 ...overlay,
446 strokeColor: strokeColor && processColor(strokeColor),
447 fillColor: fillColor && processColor(fillColor),
448 };
- Dec 19, 2015 - - @nicklockwood - Fix map annotation view layout bug - - - - -
449 result.id = id || encodeURIComponent(JSON.stringify(result));
450 return result;
- Nov 26, 2015 - - @timfpark - Add Polyline support to MapView - - - - -
451 });
- Jun 25, 2015 - - @dvcrn - [MapView] Support for annotation callouts, annotation press, callout … - - - - -
452
- Jan 29, 2016 - - @jerolimov - Add MapView annotation callback when it gets / lost the focus - - - - -
453 const findByAnnotationId = (annotationId: string) => {
454 if (!annotations) {
455 return null;
456 }
457 for (let i = 0, l = annotations.length; i < l; i++) {
458 if (annotations[i].id === annotationId) {
459 return annotations[i];
460 }
461 }
462 return null;
463 };
464
- Nov 26, 2015 - - @nicklockwood - Added support for custom color and image for map annotations - - - - -
465 // TODO: these should be separate events, to reduce bridge traffic
- Jan 29, 2016 - - @jerolimov - Add MapView annotation callback when it gets / lost the focus - - - - -
466 let onPress, onAnnotationDragStateChange, onAnnotationFocus, onAnnotationBlur;
- Nov 26, 2015 - - @timfpark - Add Polyline support to MapView - - - - -
467 if (annotations) {
- Jan 29, 2016 - - @jerolimov - Add MapView annotation callback when it gets / lost the focus - - - - -
468 onPress = (event: Event) => {
- Nov 26, 2015 - - @nicklockwood - Added support for custom color and image for map annotations - - - - -
469 if (event.nativeEvent.action === 'annotation-click') {
- Jan 29, 2016 - - @jerolimov - Add MapView annotation callback when it gets / lost the focus - - - - -
470 // TODO: Remove deprecated onAnnotationPress API call later.
- Nov 26, 2015 - - @nicklockwood - Added support for custom color and image for map annotations - - - - -
471 this.props.onAnnotationPress &&
472 this.props.onAnnotationPress(event.nativeEvent.annotation);
473 } else if (event.nativeEvent.action === 'callout-click') {
- Jan 29, 2016 - - @jerolimov - Add MapView annotation callback when it gets / lost the focus - - - - -
474 const annotation = findByAnnotationId(event.nativeEvent.annotationId);
475 if (annotation) {
476 // Pass the right function
477 if (event.nativeEvent.side === 'left' && annotation.onLeftCalloutPress) {
478 annotation.onLeftCalloutPress(event.nativeEvent);
479 } else if (event.nativeEvent.side === 'right' && annotation.onRightCalloutPress) {
480 annotation.onRightCalloutPress(event.nativeEvent);
- Nov 26, 2015 - - @nicklockwood - Added support for custom color and image for map annotations - - - - -
481 }
- Jun 25, 2015 - - @dvcrn - [MapView] Support for annotation callouts, annotation press, callout … - - - - -
482 }
483 }
- Nov 26, 2015 - - @nicklockwood - Added support for custom color and image for map annotations - - - - -
484 };
- Jan 29, 2016 - - @jerolimov - Add MapView annotation callback when it gets / lost the focus - - - - -
485 onAnnotationDragStateChange = (event: Event) => {
486 const annotation = findByAnnotationId(event.nativeEvent.annotationId);
487 if (annotation) {
488 // Call callback
489 annotation.onDragStateChange &&
490 annotation.onDragStateChange(event.nativeEvent);
- Jan 4, 2016 - - @browniefed - Implement draggable annotations on MapView. Closes #2512 - - - - -
491 }
- Jan 29, 2016 - - @jerolimov - Add MapView annotation callback when it gets / lost the focus - - - - -
492 };
493 onAnnotationFocus = (event: Event) => {
494 const annotation = findByAnnotationId(event.nativeEvent.annotationId);
495 if (annotation && annotation.onFocus) {
496 annotation.onFocus(event.nativeEvent);
- Jan 4, 2016 - - @browniefed - Implement draggable annotations on MapView. Closes #2512 - - - - -
497 }
- Jan 29, 2016 - - @jerolimov - Add MapView annotation callback when it gets / lost the focus - - - - -
498 };
499 onAnnotationBlur = (event: Event) => {
500 const annotation = findByAnnotationId(event.nativeEvent.annotationId);
501 if (annotation && annotation.onBlur) {
502 annotation.onBlur(event.nativeEvent);
503 }
504 };
- Nov 26, 2015 - - @nicklockwood - Added support for custom color and image for map annotations - - - - -
505 }
- Jun 25, 2015 - - @dvcrn - [MapView] Support for annotation callouts, annotation press, callout … - - - - -
506
- Nov 26, 2015 - - @nicklockwood - Added support for custom color and image for map annotations - - - - -
507 // TODO: these should be separate events, to reduce bridge traffic
508 if (this.props.onRegionChange || this.props.onRegionChangeComplete) {
509 var onChange = (event: Event) => {
510 if (event.nativeEvent.continuous) {
511 this.props.onRegionChange &&
512 this.props.onRegionChange(event.nativeEvent.region);
513 } else {
514 this.props.onRegionChangeComplete &&
515 this.props.onRegionChangeComplete(event.nativeEvent.region);
516 }
517 };
- Jun 25, 2015 - - @dvcrn - [MapView] Support for annotation callouts, annotation press, callout … - - - - -
518 }
519
- Jan 6, 2016 - - @Crash-- - Map follow user location - - - - -
520 // followUserLocation defaults to true if showUserLocation is set
521 if (followUserLocation === undefined) {
522 followUserLocation = this.props.showUserLocation;
523 }
524
- Nov 26, 2015 - - @nicklockwood - Added support for custom color and image for map annotations - - - - -
525 return (
526 <RCTMap
527 {...this.props}
528 annotations={annotations}
- Dec 17, 2015 - - @nicklockwood - Added ability to use a custom view for MapView annotations - - - - -
529 children={children}
- Jan 6, 2016 - - @Crash-- - Map follow user location - - - - -
530 followUserLocation={followUserLocation}
- Nov 26, 2015 - - @timfpark - Add Polyline support to MapView - - - - -
531 overlays={overlays}
- Nov 26, 2015 - - @nicklockwood - Added support for custom color and image for map annotations - - - - -
532 onPress={onPress}
533 onChange={onChange}
- Jan 4, 2016 - - @browniefed - Implement draggable annotations on MapView. Closes #2512 - - - - -
534 onAnnotationDragStateChange={onAnnotationDragStateChange}
- Jan 29, 2016 - - @jerolimov - Add MapView annotation callback when it gets / lost the focus - - - - -
535 onAnnotationFocus={onAnnotationFocus}
536 onAnnotationBlur={onAnnotationBlur}
- Nov 26, 2015 - - @nicklockwood - Added support for custom color and image for map annotations - - - - -
537 />
538 );
- Mar 10, 2015 - - @tadeuzagallo - [ReactNative] Oss GeoMap - -
539 },
540});
541
- Dec 17, 2015 - - @nicklockwood - Added ability to use a custom view for MapView annotations - - - - -
542const styles = StyleSheet.create({
543 annotationView: {
544 position: 'absolute',
545 backgroundColor: 'transparent',
546 },
547 calloutView: {
548 position: 'absolute',
549 backgroundColor: 'white',
550 },
551});
552
553const RCTMap = requireNativeComponent('RCTMap', MapView, {
- Jan 4, 2016 - - @browniefed - Implement draggable annotations on MapView. Closes #2512 - - - - -
554 nativeOnly: {
555 onAnnotationDragStateChange: true,
- Jan 29, 2016 - - @jerolimov - Add MapView annotation callback when it gets / lost the focus - - - - -
556 onAnnotationFocus: true,
557 onAnnotationBlur: true,
- Jan 4, 2016 - - @browniefed - Implement draggable annotations on MapView. Closes #2512 - - - - -
558 onChange: true,
559 onPress: true
560 }
- Nov 18, 2015 - - @kmagiera - Use requireNativeComponent everywhere. - - - - -
561});
- Mar 10, 2015 - - @tadeuzagallo - [ReactNative] Oss GeoMap - -
562
563module.exports = MapView;
-
- -
- - -
- -
- - -
-
- -
- - - - - - - -
- - - You can't perform that action at this time. -
- - - - - - - - - -
- - You signed in with another tab or window. Reload to refresh your session. - You signed out in another tab or window. Reload to refresh your session. -
- - - - - diff --git a/__tests__/data/WebView.ios.js.blame b/__tests__/data/WebView.ios.js.blame new file mode 100644 index 0000000..84946d0 --- /dev/null +++ b/__tests__/data/WebView.ios.js.blame @@ -0,0 +1,15752 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + react-native/Libraries/Components/WebView/WebView.ios.js at master · facebook/react-native + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Skip to content +
+ + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+
+
+ + + + + + + + + +
+
+ +
    +
  • +
    + +
    + + + +
    +
    +
    + + Notifications +
    + + + +
    +
    +
    +
    +
  • + +
  • + +
    +
    + + + +
    +
    + + + +
    + +
  • + +
  • + + + Fork + + + + + +
  • +
+ +

+ + /react-native + +

+ +
+ + + + +
+ +
+
+ + + +
+ + Permalink + + + +
+ Newer +
    +
  1. +
  2. +
  3. +
  4. +
  5. +
  6. +
  7. +
  8. +
  9. +
  10. +
+ Older +
+ +
+
+
+ +
+ + + +
+ + 100644 + + 672 lines (610 sloc) + + 19.2 KB +
+
+ +
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
1
+
/**
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @vjeux + +
+
+ + +
Mar 23, 2015
+
+
+
+ +
+ + + +
+ +
+
+
2
+
* Copyright (c) 2015-present, Facebook, Inc.
+
+
+
3
+
* All rights reserved.
+
+
+
4
+
*
+
+
+
5
+
* This source code is licensed under the BSD-style license found in the
+
+
+
6
+
* LICENSE file in the root directory of this source tree. An additional grant
+
+
+
7
+
* of patent rights can be found in the PATENTS file in the same directory.
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
8
+
*
+
+
+
9
+
* @providesModule WebView
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + + + facebook-github-bot-1 +
+
+ + +
Feb 1, 2016
+
+
+
+ +
+ + + +
+ +
+
+
10
+
* @noflow
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
11
+
*/
+
+
+
12
+
'use strict';
+
+
+
13
+
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
14
+
var ActivityIndicator = require('ActivityIndicator');
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
15
+
var EdgeInsetsPropType = require('EdgeInsetsPropType');
+
+
+
16
+
var React = require('React');
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
17
+
var PropTypes = require('prop-types');
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @yungsters + + + Facebook Github Bot +
+
+ + +
Oct 14, 2016
+
+
+
+ +
+ + + +
+ +
+
+
18
+
var ReactNative = require('ReactNative');
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
19
+
var StyleSheet = require('StyleSheet');
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @donyu + +
+
+ + +
Mar 31, 2015
+
+
+
+ +
+ + + +
+ +
+
+
20
+
var Text = require('Text');
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + + + facebook-github-bot-7 +
+
+ + +
Jan 6, 2016
+
+
+
+ +
+ + + +
+ +
+
+
21
+
var UIManager = require('UIManager');
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
22
+
var View = require('View');
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
23
+
var ViewPropTypes = require('ViewPropTypes');
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + trave7er + + facebook-github-bot-8 +
+
+ + +
Feb 15, 2016
+
+
+
+ +
+ + + +
+ +
+
+
24
+
var ScrollView = require('ScrollView');
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
25
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + + + facebook-github-bot-1 +
+
+ + +
Feb 1, 2016
+
+
+
+ +
+ + + +
+ +
+
+
26
+
var deprecatedPropType = require('deprecatedPropType');
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @davidaurelio + + + Facebook Github Bot 2 +
+
+ + +
Mar 2, 2016
+
+
+
+ +
+ + + +
+ +
+
+
27
+
var invariant = require('fbjs/lib/invariant');
+
+
+
28
+
var keyMirror = require('fbjs/lib/keyMirror');
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + + + facebook-github-bot-1 +
+
+ + +
Feb 1, 2016
+
+
+
+ +
+ + + +
+ +
+
+
29
+
var processDecelerationRate = require('processDecelerationRate');
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
30
+
var requireNativeComponent = require('requireNativeComponent');
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + + + facebook-github-bot-7 +
+
+ + +
Feb 3, 2016
+
+
+
+ +
+ + + +
+ +
+
+
31
+
var resolveAssetSource = require('resolveAssetSource');
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
32
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sahrens + +
+
+ + +
Mar 18, 2015
+
+
+
+ +
+ + + +
+ +
+
+
33
+
var RCTWebViewManager = require('NativeModules').WebViewManager;
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
34
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @donyu + +
+
+ + +
Mar 31, 2015
+
+
+
+ +
+ + + +
+ +
+
+
35
+
var BGWASH = 'rgba(255,255,255,0.8)';
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sahrens + +
+
+ + +
Mar 17, 2015
+
+
+
+ +
+ + + +
+ +
+
+
36
+
var RCT_WEBVIEW_REF = 'webview';
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
37
+
+
+
+
38
+
var WebViewState = keyMirror({
+
+
+
39
+
IDLE: null,
+
+
+
40
+
LOADING: null,
+
+
+
41
+
ERROR: null,
+
+
+
42
+
});
+
+
+
43
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + + + Facebook Github Bot 5 +
+
+ + +
Mar 10, 2016
+
+
+
+ +
+ + + +
+ +
+
+
44
+
const NavigationType = keyMirror({
+
+
+
45
+
click: true,
+
+
+
46
+
formsubmit: true,
+
+
+
47
+
backforward: true,
+
+
+
48
+
reload: true,
+
+
+
49
+
formresubmit: true,
+
+
+
50
+
other: true,
+
+
+
51
+
});
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
52
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + + + Facebook Github Bot 5 +
+
+ + +
Mar 10, 2016
+
+
+
+ +
+ + + +
+ +
+
+
53
+
const JSNavigationScheme = 'react-js-navigation';
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
54
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @bhosmer + +
+
+ + +
Mar 25, 2015
+
+
+
+ +
+ + + +
+ +
+
+
55
+
type ErrorEvent = {
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @davidaurelio + + + Facebook Github Bot 4 +
+
+ + +
Aug 9, 2016
+
+
+
+ +
+ + + +
+ +
+
+
56
+
domain: any,
+
+
+
57
+
code: any,
+
+
+
58
+
description: any,
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @bhosmer + +
+
+ + +
Mar 25, 2015
+
+
+
+ +
+ + + +
+ +
+
+
59
+
}
+
+
+
60
+
+
+
+
61
+
type Event = Object;
+
+
+
62
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + yueshuaijie + + Facebook Github Bot 6 +
+
+ + +
Jul 13, 2016
+
+
+
+ +
+ + + +
+ +
+
+
63
+
const DataDetectorTypes = [
+
+
+
64
+
'phoneNumber',
+
+
+
65
+
'link',
+
+
+
66
+
'address',
+
+
+
67
+
'calendarEvent',
+
+
+
68
+
'none',
+
+
+
69
+
'all',
+
+
+
70
+
];
+
+
+
71
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @donyu + +
+
+ + +
Mar 31, 2015
+
+
+
+ +
+ + + +
+ +
+
+
72
+
var defaultRenderLoading = () => (
+
+
+
73
+
<View style={styles.loadingView}>
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
74
+
<ActivityIndicator />
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @donyu + +
+
+ + +
Mar 31, 2015
+
+
+
+ +
+ + + +
+ +
+
+
75
+
</View>
+
+
+
76
+
);
+
+
+
77
+
var defaultRenderError = (errorDomain, errorCode, errorDesc) => (
+
+
+
78
+
<View style={styles.errorContainer}>
+
+
+
79
+
<Text style={styles.errorTextTitle}>
+
+
+
80
+
Error loading page
+
+
+
81
+
</Text>
+
+
+
82
+
<Text style={styles.errorText}>
+
+
+
83
+
{'Domain: ' + errorDomain}
+
+
+
84
+
</Text>
+
+
+
85
+
<Text style={styles.errorText}>
+
+
+
86
+
{'Error Code: ' + errorCode}
+
+
+
87
+
</Text>
+
+
+
88
+
<Text style={styles.errorText}>
+
+
+
89
+
{'Description: ' + errorDesc}
+
+
+
90
+
</Text>
+
+
+
91
+
</View>
+
+
+
92
+
);
+
+
+
93
+
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
94
+
/**
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @caabernathy + + + Facebook Github Bot 4 +
+
+ + +
Jun 23, 2016
+
+
+
+ +
+ + + +
+ +
+
+
95
+
* `WebView` renders web content in a native view.
+
+
+
96
+
*
+
+
+
97
+
*```
+
+
+
98
+
* import React, { Component } from 'react';
+
+
+
99
+
* import { WebView } from 'react-native';
+
+
+
100
+
*
+
+
+
101
+
* class MyWeb extends Component {
+
+
+
102
+
* render() {
+
+
+
103
+
* return (
+
+
+
104
+
* <WebView
+
+
+
105
+
* source={{uri: 'https://github.com/facebook/react-native'}}
+
+
+
106
+
* style={{marginTop: 20}}
+
+
+
107
+
* />
+
+
+
108
+
* );
+
+
+
109
+
* }
+
+
+
110
+
* }
+
+
+
111
+
*```
+
+
+
112
+
*
+
+
+
113
+
* You can use this component to navigate back and forth in the web view's
+
+
+
114
+
* history and configure various properties for the web content.
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
115
+
*/
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sophiebits + + + Facebook Github Bot 8 +
+
+ + +
Jul 26, 2016
+
+
+
+ +
+ + + +
+ +
+
+
116
+
class WebView extends React.Component {
+
+
+
117
+
static JSNavigationScheme = JSNavigationScheme;
+
+
+
118
+
static NavigationType = NavigationType;
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @cbrevik + + + + @facebook-github-bot + +
+
+ + +
Sep 19, 2017
+
+
+
+ +
+ + + +
+ +
+
+
119
+
static get extraNativeComponentConfig() {
+
+
+
120
+
return {
+
+
+
121
+
nativeOnly: {
+
+
+
122
+
onLoadingStart: true,
+
+
+
123
+
onLoadingError: true,
+
+
+
124
+
onLoadingFinish: true,
+
+
+
125
+
onMessage: true,
+
+
+
126
+
messagingEnabled: PropTypes.bool,
+
+
+
127
+
},
+
+
+
128
+
};
+
+
+
129
+
}
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
130
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sophiebits + + + Facebook Github Bot 8 +
+
+ + +
Jul 26, 2016
+
+
+
+ +
+ + + +
+ +
+
+
131
+
static propTypes = {
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @bvaughn + + + + @facebook-github-bot + +
+
+ + +
Mar 24, 2017
+
+
+
+ +
+ + + +
+ +
+
+
132
+
...ViewPropTypes,
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + + + facebook-github-bot-1 +
+
+ + +
Feb 1, 2016
+
+
+
+ +
+ + + +
+ +
+
+
133
+
+
+
+
134
+
html: deprecatedPropType(
+
+
+
135
+
PropTypes.string,
+
+
+
136
+
'Use the `source` prop instead.'
+
+
+
137
+
),
+
+
+
138
+
+
+
+
139
+
url: deprecatedPropType(
+
+
+
140
+
PropTypes.string,
+
+
+
141
+
'Use the `source` prop instead.'
+
+
+
142
+
),
+
+
+
143
+
+
+
+
144
+
/**
+
+
+
145
+
* Loads static html or a uri (with optional headers) in the WebView.
+
+
+
146
+
*/
+
+
+
147
+
source: PropTypes.oneOfType([
+
+
+
148
+
PropTypes.shape({
+
+
+
149
+
/*
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @caabernathy + + + Facebook Github Bot 4 +
+
+ + +
Jun 23, 2016
+
+
+
+ +
+ + + +
+ +
+
+
150
+
* The URI to load in the `WebView`. Can be a local or remote file.
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + + + facebook-github-bot-1 +
+
+ + +
Feb 1, 2016
+
+
+
+ +
+ + + +
+ +
+
+
151
+
*/
+
+
+
152
+
uri: PropTypes.string,
+
+
+
153
+
/*
+
+
+
154
+
* The HTTP Method to use. Defaults to GET if not specified.
+
+
+
155
+
* NOTE: On Android, only GET and POST are supported.
+
+
+
156
+
*/
+
+
+
157
+
method: PropTypes.string,
+
+
+
158
+
/*
+
+
+
159
+
* Additional HTTP headers to send with the request.
+
+
+
160
+
* NOTE: On Android, this can only be used with GET requests.
+
+
+
161
+
*/
+
+
+
162
+
headers: PropTypes.object,
+
+
+
163
+
/*
+
+
+
164
+
* The HTTP body to send with the request. This must be a valid
+
+
+
165
+
* UTF-8 string, and will be sent exactly as specified, with no
+
+
+
166
+
* additional encoding (e.g. URL-escaping or base64) applied.
+
+
+
167
+
* NOTE: On Android, this can only be used with POST requests.
+
+
+
168
+
*/
+
+
+
169
+
body: PropTypes.string,
+
+
+
170
+
}),
+
+
+
171
+
PropTypes.shape({
+
+
+
172
+
/*
+
+
+
173
+
* A static HTML page to display in the WebView.
+
+
+
174
+
*/
+
+
+
175
+
html: PropTypes.string,
+
+
+
176
+
/*
+
+
+
177
+
* The base URL to be used for any relative links in the HTML.
+
+
+
178
+
*/
+
+
+
179
+
baseUrl: PropTypes.string,
+
+
+
180
+
}),
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + + + facebook-github-bot-7 +
+
+ + +
Feb 3, 2016
+
+
+
+ +
+ + + +
+ +
+
+
181
+
/*
+
+
+
182
+
* Used internally by packager.
+
+
+
183
+
*/
+
+
+
184
+
PropTypes.number,
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + + + facebook-github-bot-1 +
+
+ + +
Feb 1, 2016
+
+
+
+ +
+ + + +
+ +
+
+
185
+
]),
+
+
+
186
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @mkonicek + + + facebook-github-bot-6 +
+
+ + +
Dec 17, 2015
+
+
+
+ +
+ + + +
+ +
+
+
187
+
/**
+
+
+
188
+
* Function that returns a view to show if there's an error.
+
+
+
189
+
*/
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @donyu + +
+
+ + +
Mar 31, 2015
+
+
+
+ +
+ + + +
+ +
+
+
190
+
renderError: PropTypes.func, // view to show if there's an error
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @mkonicek + + + facebook-github-bot-6 +
+
+ + +
Dec 17, 2015
+
+
+
+ +
+ + + +
+ +
+
+
191
+
/**
+
+
+
192
+
* Function that returns a loading indicator.
+
+
+
193
+
*/
+
+
+
194
+
renderLoading: PropTypes.func,
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + Horcrux + + facebook-github-bot-3 +
+
+ + +
Jan 15, 2016
+
+
+
+ +
+ + + +
+ +
+
+
195
+
/**
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @caabernathy + + + Facebook Github Bot 4 +
+
+ + +
Jun 23, 2016
+
+
+
+ +
+ + + +
+ +
+
+
196
+
* Function that is invoked when the `WebView` has finished loading.
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + Horcrux + + facebook-github-bot-3 +
+
+ + +
Jan 15, 2016
+
+
+
+ +
+ + + +
+ +
+
+
197
+
*/
+
+
+
198
+
onLoad: PropTypes.func,
+
+
+
199
+
/**
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @caabernathy + + + Facebook Github Bot 4 +
+
+ + +
Jun 23, 2016
+
+
+
+ +
+ + + +
+ +
+
+
200
+
* Function that is invoked when the `WebView` load succeeds or fails.
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + Horcrux + + facebook-github-bot-3 +
+
+ + +
Jan 15, 2016
+
+
+
+ +
+ + + +
+ +
+
+
201
+
*/
+
+
+
202
+
onLoadEnd: PropTypes.func,
+
+
+
203
+
/**
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @caabernathy + + + Facebook Github Bot 4 +
+
+ + +
Jun 23, 2016
+
+
+
+ +
+ + + +
+ +
+
+
204
+
* Function that is invoked when the `WebView` starts loading.
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + Horcrux + + facebook-github-bot-3 +
+
+ + +
Jan 15, 2016
+
+
+
+ +
+ + + +
+ +
+
+
205
+
*/
+
+
+
206
+
onLoadStart: PropTypes.func,
+
+
+
207
+
/**
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @caabernathy + + + Facebook Github Bot 4 +
+
+ + +
Jun 23, 2016
+
+
+
+ +
+ + + +
+ +
+
+
208
+
* Function that is invoked when the `WebView` load fails.
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + Horcrux + + facebook-github-bot-3 +
+
+ + +
Jan 15, 2016
+
+
+
+ +
+ + + +
+ +
+
+
209
+
*/
+
+
+
210
+
onError: PropTypes.func,
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @mkonicek + + + facebook-github-bot-6 +
+
+ + +
Dec 17, 2015
+
+
+
+ +
+ + + +
+ +
+
+
211
+
/**
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @caabernathy + + + Facebook Github Bot 4 +
+
+ + +
Jun 23, 2016
+
+
+
+ +
+ + + +
+ +
+
+
212
+
* Boolean value that determines whether the web view bounces
+
+
+
213
+
* when it reaches the edge of the content. The default value is `true`.
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @mkonicek + + + facebook-github-bot-6 +
+
+ + +
Dec 17, 2015
+
+
+
+ +
+ + + +
+ +
+
+
214
+
* @platform ios
+
+
+
215
+
*/
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @lwansbrough + +
+
+ + +
Apr 20, 2015
+
+
+
+ +
+ + + +
+ +
+
+
216
+
bounces: PropTypes.bool,
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @aflanagan + + + facebook-github-bot-4 +
+
+ + +
Jan 28, 2016
+
+
+
+ +
+ + + +
+ +
+
+
217
+
/**
+
+
+
218
+
* A floating-point number that determines how quickly the scroll view
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @caabernathy + + + Facebook Github Bot 4 +
+
+ + +
Jun 23, 2016
+
+
+
+ +
+ + + +
+ +
+
+
219
+
* decelerates after the user lifts their finger. You may also use the
+
+
+
220
+
* string shortcuts `"normal"` and `"fast"` which match the underlying iOS
+
+
+
221
+
* settings for `UIScrollViewDecelerationRateNormal` and
+
+
+
222
+
* `UIScrollViewDecelerationRateFast` respectively:
+
+
+
223
+
*
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + + + Facebook Github Bot 5 +
+
+ + +
Mar 10, 2016
+
+
+
+ +
+ + + +
+ +
+
+
224
+
* - normal: 0.998
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @caabernathy + + + Facebook Github Bot 4 +
+
+ + +
Jun 23, 2016
+
+
+
+ +
+ + + +
+ +
+
+
225
+
* - fast: 0.99 (the default for iOS web view)
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @aflanagan + + + facebook-github-bot-4 +
+
+ + +
Jan 28, 2016
+
+
+
+ +
+ + + +
+ +
+
+
226
+
* @platform ios
+
+
+
227
+
*/
+
+
+
228
+
decelerationRate: ScrollView.propTypes.decelerationRate,
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @mkonicek + + + facebook-github-bot-6 +
+
+ + +
Dec 17, 2015
+
+
+
+ +
+ + + +
+ +
+
+
229
+
/**
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @caabernathy + + + Facebook Github Bot 4 +
+
+ + +
Jun 23, 2016
+
+
+
+ +
+ + + +
+ +
+
+
230
+
* Boolean value that determines whether scrolling is enabled in the
+
+
+
231
+
* `WebView`. The default value is `true`.
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @mkonicek + + + facebook-github-bot-6 +
+
+ + +
Dec 17, 2015
+
+
+
+ +
+ + + +
+ +
+
+
232
+
* @platform ios
+
+
+
233
+
*/
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @lwansbrough + +
+
+ + +
Apr 20, 2015
+
+
+
+ +
+ + + +
+ +
+
+
234
+
scrollEnabled: PropTypes.bool,
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @caabernathy + + + Facebook Github Bot 4 +
+
+ + +
Jun 23, 2016
+
+
+
+ +
+ + + +
+ +
+
+
235
+
/**
+
+
+
236
+
* Controls whether to adjust the content inset for web views that are
+
+
+
237
+
* placed behind a navigation bar, tab bar, or toolbar. The default value
+
+
+
238
+
* is `true`.
+
+
+
239
+
*/
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
240
+
automaticallyAdjustContentInsets: PropTypes.bool,
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @caabernathy + + + Facebook Github Bot 4 +
+
+ + +
Jun 23, 2016
+
+
+
+ +
+ + + +
+ +
+
+
241
+
/**
+
+
+
242
+
* The amount by which the web view content is inset from the edges of
+
+
+
243
+
* the scroll view. Defaults to {top: 0, left: 0, bottom: 0, right: 0}.
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @paulbrittain + + + + @facebook-github-bot + +
+
+ + +
Oct 7, 2017
+
+
+
+ +
+ + + +
+ +
+
+
244
+
* @platform ios
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @caabernathy + + + Facebook Github Bot 4 +
+
+ + +
Jun 23, 2016
+
+
+
+ +
+ + + +
+ +
+
+
245
+
*/
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
246
+
contentInset: EdgeInsetsPropType,
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @caabernathy + + + Facebook Github Bot 4 +
+
+ + +
Jun 23, 2016
+
+
+
+ +
+ + + +
+ +
+
+
247
+
/**
+
+
+
248
+
* Function that is invoked when the `WebView` loading starts or ends.
+
+
+
249
+
*/
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
250
+
onNavigationStateChange: PropTypes.func,
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
251
+
/**
+
+
+
252
+
* A function that is invoked when the webview calls `window.postMessage`.
+
+
+
253
+
* Setting this property will inject a `postMessage` global into your
+
+
+
254
+
* webview, but will still call pre-existing values of `postMessage`.
+
+
+
255
+
*
+
+
+
256
+
* `window.postMessage` accepts one argument, `data`, which will be
+
+
+
257
+
* available on the event object, `event.nativeEvent.data`. `data`
+
+
+
258
+
* must be a string.
+
+
+
259
+
*/
+
+
+
260
+
onMessage: PropTypes.func,
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @caabernathy + + + Facebook Github Bot 4 +
+
+ + +
Jun 23, 2016
+
+
+
+ +
+ + + +
+ +
+
+
261
+
/**
+
+
+
262
+
* Boolean value that forces the `WebView` to show the loading view
+
+
+
263
+
* on the first load.
+
+
+
264
+
*/
+
+
+
265
+
startInLoadingState: PropTypes.bool,
+
+
+
266
+
/**
+
+
+
267
+
* The style to apply to the `WebView`.
+
+
+
268
+
*/
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @bvaughn + + + + @facebook-github-bot + +
+
+ + +
Mar 24, 2017
+
+
+
+ +
+ + + +
+ +
+
+
269
+
style: ViewPropTypes.style,
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @Crash-- + + + facebook-github-bot-4 +
+
+ + +
Nov 19, 2015
+
+
+
+ +
+ + + +
+ +
+
+
270
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + yueshuaijie + + Facebook Github Bot 6 +
+
+ + +
Jul 13, 2016
+
+
+
+ +
+ + + +
+ +
+
+
271
+
/**
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @cbrevik + + + + @facebook-github-bot + +
+
+ + +
Sep 19, 2017
+
+
+
+ +
+ + + +
+ +
+
+
272
+
* Determines the types of data converted to clickable URLs in the web view's content.
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + yueshuaijie + + Facebook Github Bot 6 +
+
+ + +
Jul 13, 2016
+
+
+
+ +
+ + + +
+ +
+
+
273
+
* By default only phone numbers are detected.
+
+
+
274
+
*
+
+
+
275
+
* You can provide one type or an array of many types.
+
+
+
276
+
*
+
+
+
277
+
* Possible values for `dataDetectorTypes` are:
+
+
+
278
+
*
+
+
+
279
+
* - `'phoneNumber'`
+
+
+
280
+
* - `'link'`
+
+
+
281
+
* - `'address'`
+
+
+
282
+
* - `'calendarEvent'`
+
+
+
283
+
* - `'none'`
+
+
+
284
+
* - `'all'`
+
+
+
285
+
*
+
+
+
286
+
* @platform ios
+
+
+
287
+
*/
+
+
+
288
+
dataDetectorTypes: PropTypes.oneOfType([
+
+
+
289
+
PropTypes.oneOf(DataDetectorTypes),
+
+
+
290
+
PropTypes.arrayOf(PropTypes.oneOf(DataDetectorTypes)),
+
+
+
291
+
]),
+
+
+
292
+
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
293
+
/**
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @caabernathy + + + Facebook Github Bot 4 +
+
+ + +
Jun 23, 2016
+
+
+
+ +
+ + + +
+ +
+
+
294
+
* Boolean value to enable JavaScript in the `WebView`. Used on Android only
+
+
+
295
+
* as JavaScript is enabled by default on iOS. The default value is `true`.
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @Crash-- + + + facebook-github-bot-4 +
+
+ + +
Nov 19, 2015
+
+
+
+ +
+ + + +
+ +
+
+
296
+
* @platform android
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
297
+
*/
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @odino + + + facebook-github-bot-0 +
+
+ + +
Jan 5, 2016
+
+
+
+ +
+ + + +
+ +
+
+
298
+
javaScriptEnabled: PropTypes.bool,
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @Crash-- + + + facebook-github-bot-4 +
+
+ + +
Nov 19, 2015
+
+
+
+ +
+ + + +
+ +
+
+
299
+
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
300
+
/**
+
+
+
301
+
* Boolean value to enable third party cookies in the `WebView`. Used on
+
+
+
302
+
* Android Lollipop and above only as third party cookies are enabled by
+
+
+
303
+
* default on Android Kitkat and below and on iOS. The default value is `true`.
+
+
+
304
+
* @platform android
+
+
+
305
+
*/
+
+
+
306
+
thirdPartyCookiesEnabled: PropTypes.bool,
+
+
+
307
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @odino + + + facebook-github-bot-4 +
+
+ + +
Dec 31, 2015
+
+
+
+ +
+ + + +
+ +
+
+
308
+
/**
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @caabernathy + + + Facebook Github Bot 4 +
+
+ + +
Jun 23, 2016
+
+
+
+ +
+ + + +
+ +
+
+
309
+
* Boolean value to control whether DOM Storage is enabled. Used only in
+
+
+
310
+
* Android.
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @odino + + + facebook-github-bot-4 +
+
+ + +
Dec 31, 2015
+
+
+
+ +
+ + + +
+ +
+
+
311
+
* @platform android
+
+
+
312
+
*/
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @odino + + + facebook-github-bot-0 +
+
+ + +
Jan 5, 2016
+
+
+
+ +
+ + + +
+ +
+
+
313
+
domStorageEnabled: PropTypes.bool,
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @odino + + + facebook-github-bot-4 +
+
+ + +
Dec 31, 2015
+
+
+
+ +
+ + + +
+ +
+
+
314
+
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
315
+
/**
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @caabernathy + + + Facebook Github Bot 4 +
+
+ + +
Jun 23, 2016
+
+
+
+ +
+ + + +
+ +
+
+
316
+
* Set this to provide JavaScript that will be injected into the web page
+
+
+
317
+
* when the view loads.
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
318
+
*/
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + Hedger Wang +
+
+ + +
Jul 7, 2015
+
+
+
+ +
+ + + +
+ +
+
+
319
+
injectedJavaScript: PropTypes.string,
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
320
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @chiraggshah + + + Facebook Github Bot +
+
+ + +
Jun 18, 2016
+
+
+
+ +
+ + + +
+ +
+
+
321
+
/**
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @caabernathy + + + Facebook Github Bot 4 +
+
+ + +
Jun 23, 2016
+
+
+
+ +
+ + + +
+ +
+
+
322
+
* Sets the user-agent for the `WebView`.
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @chiraggshah + + + Facebook Github Bot +
+
+ + +
Jun 18, 2016
+
+
+
+ +
+ + + +
+ +
+
+
323
+
* @platform android
+
+
+
324
+
*/
+
+
+
325
+
userAgent: PropTypes.string,
+
+
+
326
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @alvaromb + +
+
+ + +
Jun 17, 2015
+
+
+
+ +
+ + + +
+ +
+
+
327
+
/**
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @caabernathy + + + Facebook Github Bot 4 +
+
+ + +
Jun 23, 2016
+
+
+
+ +
+ + + +
+ +
+
+
328
+
* Boolean that controls whether the web content is scaled to fit
+
+
+
329
+
* the view and enables the user to change the scale. The default value
+
+
+
330
+
* is `true`.
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @alvaromb + +
+
+ + +
Jun 17, 2015
+
+
+
+ +
+ + + +
+ +
+
+
331
+
*/
+
+
+
332
+
scalesPageToFit: PropTypes.bool,
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @javache + + + facebook-github-bot-4 +
+
+ + +
Nov 4, 2015
+
+
+
+ +
+ + + +
+ +
+
+
333
+
+
+
+
334
+
/**
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @caabernathy + + + Facebook Github Bot 4 +
+
+ + +
Jun 23, 2016
+
+
+
+ +
+ + + +
+ +
+
+
335
+
* Function that allows custom handling of any web view requests. Return
+
+
+
336
+
* `true` from the function to continue loading the request and `false`
+
+
+
337
+
* to stop loading.
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @Crash-- + + + facebook-github-bot-4 +
+
+ + +
Nov 19, 2015
+
+
+
+ +
+ + + +
+ +
+
+
338
+
* @platform ios
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @javache + + + facebook-github-bot-4 +
+
+ + +
Nov 4, 2015
+
+
+
+ +
+ + + +
+ +
+
+
339
+
*/
+
+
+
340
+
onShouldStartLoadWithRequest: PropTypes.func,
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @Crash-- + + + facebook-github-bot-4 +
+
+ + +
Nov 19, 2015
+
+
+
+ +
+ + + +
+ +
+
+
341
+
+
+
+
342
+
/**
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @caabernathy + + + Facebook Github Bot 4 +
+
+ + +
Jun 23, 2016
+
+
+
+ +
+ + + +
+ +
+
+
343
+
* Boolean that determines whether HTML5 videos play inline or use the
+
+
+
344
+
* native full-screen controller. The default value is `false`.
+
+
+
345
+
*
+
+
+
346
+
* **NOTE** : In order for video to play inline, not only does this
+
+
+
347
+
* property need to be set to `true`, but the video element in the HTML
+
+
+
348
+
* document must also include the `webkit-playsinline` attribute.
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @Crash-- + + + facebook-github-bot-4 +
+
+ + +
Nov 19, 2015
+
+
+
+ +
+ + + +
+ +
+
+
349
+
* @platform ios
+
+
+
350
+
*/
+
+
+
351
+
allowsInlineMediaPlayback: PropTypes.bool,
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @Thomas101 + + + Facebook Github Bot 5 +
+
+ + +
Mar 16, 2016
+
+
+
+ +
+ + + +
+ +
+
+
352
+
+
+
+
353
+
/**
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @caabernathy + + + Facebook Github Bot 4 +
+
+ + +
Jun 23, 2016
+
+
+
+ +
+ + + +
+ +
+
+
354
+
* Boolean that determines whether HTML5 audio and video requires the user
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @ios122 + + + Facebook Github Bot 4 +
+
+ + +
Aug 3, 2016
+
+
+
+ +
+ + + +
+ +
+
+
355
+
* to tap them before they start playing. The default value is `true`.
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @Thomas101 + + + Facebook Github Bot 5 +
+
+ + +
Mar 16, 2016
+
+
+
+ +
+ + + +
+ +
+
+
356
+
*/
+
+
+
357
+
mediaPlaybackRequiresUserAction: PropTypes.bool,
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @lukemiles + + + + @facebook-github-bot + +
+
+ + +
Mar 2, 2017
+
+
+
+ +
+ + + +
+ +
+
+
358
+
+
+
+
359
+
/**
+
+
+
360
+
* Function that accepts a string that will be passed to the WebView and
+
+
+
361
+
* executed immediately as JavaScript.
+
+
+
362
+
*/
+
+
+
363
+
injectJavaScript: PropTypes.func,
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @prabakarviji + + + + @facebook-github-bot + +
+
+ + +
Mar 8, 2017
+
+
+
+ +
+ + + +
+ +
+
+
364
+
+
+
+
365
+
/**
+
+
+
366
+
* Specifies the mixed content mode. i.e WebView will allow a secure origin to load content from any other origin.
+
+
+
367
+
*
+
+
+
368
+
* Possible values for `mixedContentMode` are:
+
+
+
369
+
*
+
+
+
370
+
* - `'never'` (default) - WebView will not allow a secure origin to load content from an insecure origin.
+
+
+
371
+
* - `'always'` - WebView will allow a secure origin to load content from any other origin, even if that origin is insecure.
+
+
+
372
+
* - `'compatibility'` - WebView will attempt to be compatible with the approach of a modern web browser with regard to mixed content.
+
+
+
373
+
* @platform android
+
+
+
374
+
*/
+
+
+
375
+
mixedContentMode: PropTypes.oneOf([
+
+
+
376
+
'never',
+
+
+
377
+
'always',
+
+
+
378
+
'compatibility'
+
+
+
379
+
]),
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @janicduplessis + + + + @facebook-github-bot + +
+
+ + +
Oct 9, 2017
+
+
+
+ +
+ + + +
+ +
+
+
380
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @cbrevik + + + + @facebook-github-bot + +
+
+ + +
Sep 19, 2017
+
+
+
+ +
+ + + +
+ +
+
+
381
+
/**
+
+
+
382
+
* Override the native component used to render the WebView. Enables a custom native
+
+
+
383
+
* WebView which uses the same JavaScript as the original WebView.
+
+
+
384
+
*/
+
+
+
385
+
nativeConfig: PropTypes.shape({
+
+
+
386
+
/*
+
+
+
387
+
* The native component used to render the WebView.
+
+
+
388
+
*/
+
+
+
389
+
component: PropTypes.any,
+
+
+
390
+
/*
+
+
+
391
+
* Set props directly on the native component WebView. Enables custom props which the
+
+
+
392
+
* original WebView doesn't pass through.
+
+
+
393
+
*/
+
+
+
394
+
props: PropTypes.object,
+
+
+
395
+
/*
+
+
+
396
+
* Set the ViewManager to use for communcation with the native side.
+
+
+
397
+
* @platform ios
+
+
+
398
+
*/
+
+
+
399
+
viewManager: PropTypes.object,
+
+
+
400
+
}),
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sophiebits + + + Facebook Github Bot 8 +
+
+ + +
Jul 26, 2016
+
+
+
+ +
+ + + +
+ +
+
+
401
+
};
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
402
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @peterp + + + + @facebook-github-bot + +
+
+ + +
Jun 29, 2017
+
+
+
+ +
+ + + +
+ +
+
+
403
+
static defaultProps = {
+
+
+
404
+
scalesPageToFit: true,
+
+
+
405
+
};
+
+
+
406
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sophiebits + + + Facebook Github Bot 8 +
+
+ + +
Jul 26, 2016
+
+
+
+ +
+ + + +
+ +
+
+
407
+
state = {
+
+
+
408
+
viewState: WebViewState.IDLE,
+
+
+
409
+
lastErrorEvent: (null: ?ErrorEvent),
+
+
+
410
+
startInLoadingState: true,
+
+
+
411
+
};
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
412
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sophiebits + + + Facebook Github Bot 8 +
+
+ + +
Jul 26, 2016
+
+
+
+ +
+ + + +
+ +
+
+
413
+
componentWillMount() {
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
414
+
if (this.props.startInLoadingState) {
+
+
+
415
+
this.setState({viewState: WebViewState.LOADING});
+
+
+
416
+
}
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sophiebits + + + Facebook Github Bot 8 +
+
+ + +
Jul 26, 2016
+
+
+
+ +
+ + + +
+ +
+
+
417
+
}
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
418
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sophiebits + + + Facebook Github Bot 8 +
+
+ + +
Jul 26, 2016
+
+
+
+ +
+ + + +
+ +
+
+
419
+
render() {
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
420
+
var otherView = null;
+
+
+
421
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @donyu + +
+
+ + +
Mar 31, 2015
+
+
+
+ +
+ + + +
+ +
+
+
422
+
if (this.state.viewState === WebViewState.LOADING) {
+
+
+
423
+
otherView = (this.props.renderLoading || defaultRenderLoading)();
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
424
+
} else if (this.state.viewState === WebViewState.ERROR) {
+
+
+
425
+
var errorEvent = this.state.lastErrorEvent;
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @bhosmer + +
+
+ + +
Mar 25, 2015
+
+
+
+ +
+ + + +
+ +
+
+
426
+
invariant(
+
+
+
427
+
errorEvent != null,
+
+
+
428
+
'lastErrorEvent expected to be non-null'
+
+
+
429
+
);
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @donyu + +
+
+ + +
Mar 31, 2015
+
+
+
+ +
+ + + +
+ +
+
+
430
+
otherView = (this.props.renderError || defaultRenderError)(
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
431
+
errorEvent.domain,
+
+
+
432
+
errorEvent.code,
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @donyu + +
+
+ + +
Mar 31, 2015
+
+
+
+ +
+ + + +
+ +
+
+
433
+
errorEvent.description
+
+
+
434
+
);
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
435
+
} else if (this.state.viewState !== WebViewState.IDLE) {
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @donyu + +
+
+ + +
Mar 31, 2015
+
+
+
+ +
+ + + +
+ +
+
+
436
+
console.error(
+
+
+
437
+
'RCTWebView invalid state encountered: ' + this.state.loading
+
+
+
438
+
);
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
439
+
}
+
+
+
440
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @lwansbrough + +
+
+ + +
Apr 20, 2015
+
+
+
+ +
+ + + +
+ +
+
+
441
+
var webViewStyles = [styles.container, styles.webView, this.props.style];
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
442
+
if (this.state.viewState === WebViewState.LOADING ||
+
+
+
443
+
this.state.viewState === WebViewState.ERROR) {
+
+
+
444
+
// if we're in either LOADING or ERROR states, don't show the webView
+
+
+
445
+
webViewStyles.push(styles.hidden);
+
+
+
446
+
}
+
+
+
447
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @cbrevik + + + + @facebook-github-bot + +
+
+ + +
Sep 19, 2017
+
+
+
+ +
+ + + +
+ +
+
+
448
+
const nativeConfig = this.props.nativeConfig || {};
+
+
+
449
+
+
+
+
450
+
const viewManager = nativeConfig.viewManager || RCTWebViewManager;
+
+
+
451
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @javache + + + facebook-github-bot-4 +
+
+ + +
Nov 4, 2015
+
+
+
+ +
+ + + +
+ +
+
+
452
+
var onShouldStartLoadWithRequest = this.props.onShouldStartLoadWithRequest && ((event: Event) => {
+
+
+
453
+
var shouldStart = this.props.onShouldStartLoadWithRequest &&
+
+
+
454
+
this.props.onShouldStartLoadWithRequest(event.nativeEvent);
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @cbrevik + + + + @facebook-github-bot + +
+
+ + +
Sep 19, 2017
+
+
+
+ +
+ + + +
+ +
+
+
455
+
viewManager.startLoadWithResult(!!shouldStart, event.nativeEvent.lockIdentifier);
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @javache + + + facebook-github-bot-4 +
+
+ + +
Nov 4, 2015
+
+
+
+ +
+ + + +
+ +
+
+
456
+
});
+
+
+
457
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @aflanagan + + + facebook-github-bot-4 +
+
+ + +
Jan 28, 2016
+
+
+
+ +
+ + + +
+ +
+
+
458
+
var decelerationRate = processDecelerationRate(this.props.decelerationRate);
+
+
+
459
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + + + facebook-github-bot-1 +
+
+ + +
Feb 1, 2016
+
+
+
+ +
+ + + +
+ +
+
+
460
+
var source = this.props.source || {};
+
+
+
461
+
if (this.props.html) {
+
+
+
462
+
source.html = this.props.html;
+
+
+
463
+
} else if (this.props.url) {
+
+
+
464
+
source.uri = this.props.url;
+
+
+
465
+
}
+
+
+
466
+
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
467
+
const messagingEnabled = typeof this.props.onMessage === 'function';
+
+
+
468
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @cbrevik + + + + @facebook-github-bot + +
+
+ + +
Sep 19, 2017
+
+
+
+ +
+ + + +
+ +
+
+
469
+
const NativeWebView = nativeConfig.component || RCTWebView;
+
+
+
470
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
471
+
var webView =
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @cbrevik + + + + @facebook-github-bot + +
+
+ + +
Sep 19, 2017
+
+
+
+ +
+ + + +
+ +
+
+
472
+
<NativeWebView
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sahrens + +
+
+ + +
Mar 17, 2015
+
+
+
+ +
+ + + +
+ +
+
+
473
+
ref={RCT_WEBVIEW_REF}
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
474
+
key="webViewKey"
+
+
+
475
+
style={webViewStyles}
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + + + facebook-github-bot-7 +
+
+ + +
Feb 3, 2016
+
+
+
+ +
+ + + +
+ +
+
+
476
+
source={resolveAssetSource(source)}
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + Hedger Wang +
+
+ + +
Jul 7, 2015
+
+
+
+ +
+ + + +
+ +
+
+
477
+
injectedJavaScript={this.props.injectedJavaScript}
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @lwansbrough + +
+
+ + +
Apr 20, 2015
+
+
+
+ +
+ + + +
+ +
+
+
478
+
bounces={this.props.bounces}
+
+
+
479
+
scrollEnabled={this.props.scrollEnabled}
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @aflanagan + + + facebook-github-bot-4 +
+
+ + +
Jan 28, 2016
+
+
+
+ +
+ + + +
+ +
+
+
480
+
decelerationRate={decelerationRate}
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
481
+
contentInset={this.props.contentInset}
+
+
+
482
+
automaticallyAdjustContentInsets={this.props.automaticallyAdjustContentInsets}
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
483
+
onLoadingStart={this._onLoadingStart}
+
+
+
484
+
onLoadingFinish={this._onLoadingFinish}
+
+
+
485
+
onLoadingError={this._onLoadingError}
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
486
+
messagingEnabled={messagingEnabled}
+
+
+
487
+
onMessage={this._onMessage}
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @javache + + + facebook-github-bot-4 +
+
+ + +
Nov 4, 2015
+
+
+
+ +
+ + + +
+ +
+
+
488
+
onShouldStartLoadWithRequest={onShouldStartLoadWithRequest}
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @alvaromb + +
+
+ + +
Jun 17, 2015
+
+
+
+ +
+ + + +
+ +
+
+
489
+
scalesPageToFit={this.props.scalesPageToFit}
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @Crash-- + + + facebook-github-bot-4 +
+
+ + +
Nov 19, 2015
+
+
+
+ +
+ + + +
+ +
+
+
490
+
allowsInlineMediaPlayback={this.props.allowsInlineMediaPlayback}
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @Thomas101 + + + Facebook Github Bot 5 +
+
+ + +
Mar 16, 2016
+
+
+
+ +
+ + + +
+ +
+
+
491
+
mediaPlaybackRequiresUserAction={this.props.mediaPlaybackRequiresUserAction}
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + yueshuaijie + + Facebook Github Bot 6 +
+
+ + +
Jul 13, 2016
+
+
+
+ +
+ + + +
+ +
+
+
492
+
dataDetectorTypes={this.props.dataDetectorTypes}
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @cbrevik + + + + @facebook-github-bot + +
+
+ + +
Sep 19, 2017
+
+
+
+ +
+ + + +
+ +
+
+
493
+
{...nativeConfig.props}
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
494
+
/>;
+
+
+
495
+
+
+
+
496
+
return (
+
+
+
497
+
<View style={styles.container}>
+
+
+
498
+
{webView}
+
+
+
499
+
{otherView}
+
+
+
500
+
</View>
+
+
+
501
+
);
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sophiebits + + + Facebook Github Bot 8 +
+
+ + +
Jul 26, 2016
+
+
+
+ +
+ + + +
+ +
+
+
502
+
}
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
503
+
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
504
+
/**
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @caabernathy + + + Facebook Github Bot 4 +
+
+ + +
Jun 23, 2016
+
+
+
+ +
+ + + +
+ +
+
+
505
+
* Go forward one page in the web view's history.
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
506
+
*/
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sophiebits + + + Facebook Github Bot 8 +
+
+ + +
Jul 26, 2016
+
+
+
+ +
+ + + +
+ +
+
+
507
+
goForward = () => {
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + + + facebook-github-bot-7 +
+
+ + +
Jan 6, 2016
+
+
+
+ +
+ + + +
+ +
+
+
508
+
UIManager.dispatchViewManagerCommand(
+
+
+
509
+
this.getWebViewHandle(),
+
+
+
510
+
UIManager.RCTWebView.Commands.goForward,
+
+
+
511
+
null
+
+
+
512
+
);
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sophiebits + + + Facebook Github Bot 8 +
+
+ + +
Jul 26, 2016
+
+
+
+ +
+ + + +
+ +
+
+
513
+
};
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
514
+
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
515
+
/**
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @caabernathy + + + Facebook Github Bot 4 +
+
+ + +
Jun 23, 2016
+
+
+
+ +
+ + + +
+ +
+
+
516
+
* Go back one page in the web view's history.
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
517
+
*/
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sophiebits + + + Facebook Github Bot 8 +
+
+ + +
Jul 26, 2016
+
+
+
+ +
+ + + +
+ +
+
+
518
+
goBack = () => {
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + + + facebook-github-bot-7 +
+
+ + +
Jan 6, 2016
+
+
+
+ +
+ + + +
+ +
+
+
519
+
UIManager.dispatchViewManagerCommand(
+
+
+
520
+
this.getWebViewHandle(),
+
+
+
521
+
UIManager.RCTWebView.Commands.goBack,
+
+
+
522
+
null
+
+
+
523
+
);
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sophiebits + + + Facebook Github Bot 8 +
+
+ + +
Jul 26, 2016
+
+
+
+ +
+ + + +
+ +
+
+
524
+
};
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
525
+
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
526
+
/**
+
+
+
527
+
* Reloads the current page.
+
+
+
528
+
*/
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sophiebits + + + Facebook Github Bot 8 +
+
+ + +
Jul 26, 2016
+
+
+
+ +
+ + + +
+ +
+
+
529
+
reload = () => {
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @stereodenis + + + Facebook Github Bot +
+
+ + +
Jun 21, 2016
+
+
+
+ +
+ + + +
+ +
+
+
530
+
this.setState({viewState: WebViewState.LOADING});
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + + + facebook-github-bot-7 +
+
+ + +
Jan 6, 2016
+
+
+
+ +
+ + + +
+ +
+
+
531
+
UIManager.dispatchViewManagerCommand(
+
+
+
532
+
this.getWebViewHandle(),
+
+
+
533
+
UIManager.RCTWebView.Commands.reload,
+
+
+
534
+
null
+
+
+
535
+
);
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sophiebits + + + Facebook Github Bot 8 +
+
+ + +
Jul 26, 2016
+
+
+
+ +
+ + + +
+ +
+
+
536
+
};
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
537
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @caabernathy + + + Facebook Github Bot 4 +
+
+ + +
Jun 23, 2016
+
+
+
+ +
+ + + +
+ +
+
+
538
+
/**
+
+
+
539
+
* Stop loading the current page.
+
+
+
540
+
*/
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sophiebits + + + Facebook Github Bot 8 +
+
+ + +
Jul 26, 2016
+
+
+
+ +
+ + + +
+ +
+
+
541
+
stopLoading = () => {
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + Andrew Gray + + Facebook Github Bot 0 +
+
+ + +
Apr 22, 2016
+
+
+
+ +
+ + + +
+ +
+
+
542
+
UIManager.dispatchViewManagerCommand(
+
+
+
543
+
this.getWebViewHandle(),
+
+
+
544
+
UIManager.RCTWebView.Commands.stopLoading,
+
+
+
545
+
null
+
+
+
546
+
);
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sophiebits + + + Facebook Github Bot 8 +
+
+ + +
Jul 26, 2016
+
+
+
+ +
+ + + +
+ +
+
+
547
+
};
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + Andrew Gray + + Facebook Github Bot 0 +
+
+ + +
Apr 22, 2016
+
+
+
+ +
+ + + +
+ +
+
+
548
+
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
549
+
/**
+
+
+
550
+
* Posts a message to the web view, which will emit a `message` event.
+
+
+
551
+
* Accepts one argument, `data`, which must be a string.
+
+
+
552
+
*
+
+
+
553
+
* In your webview, you'll need to something like the following.
+
+
+
554
+
*
+
+
+
555
+
* ```js
+
+
+
556
+
* document.addEventListener('message', e => { document.title = e.data; });
+
+
+
557
+
* ```
+
+
+
558
+
*/
+
+
+
559
+
postMessage = (data) => {
+
+
+
560
+
UIManager.dispatchViewManagerCommand(
+
+
+
561
+
this.getWebViewHandle(),
+
+
+
562
+
UIManager.RCTWebView.Commands.postMessage,
+
+
+
563
+
[String(data)]
+
+
+
564
+
);
+
+
+
565
+
};
+
+
+
566
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @lukemiles + + + + @facebook-github-bot + +
+
+ + +
Jan 6, 2017
+
+
+
+ +
+ + + +
+ +
+
+
567
+
/**
+
+
+
568
+
* Injects a javascript string into the referenced WebView. Deliberately does not
+
+
+
569
+
* return a response because using eval() to return a response breaks this method
+
+
+
570
+
* on pages with a Content Security Policy that disallows eval(). If you need that
+
+
+
571
+
* functionality, look into postMessage/onMessage.
+
+
+
572
+
*/
+
+
+
573
+
injectJavaScript = (data) => {
+
+
+
574
+
UIManager.dispatchViewManagerCommand(
+
+
+
575
+
this.getWebViewHandle(),
+
+
+
576
+
UIManager.RCTWebView.Commands.injectJavaScript,
+
+
+
577
+
[data]
+
+
+
578
+
);
+
+
+
579
+
};
+
+
+
580
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
581
+
/**
+
+
+
582
+
* We return an event with a bunch of fields including:
+
+
+
583
+
* url, title, loading, canGoBack, canGoForward
+
+
+
584
+
*/
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sophiebits + + + Facebook Github Bot 8 +
+
+ + +
Jul 26, 2016
+
+
+
+ +
+ + + +
+ +
+
+
585
+
_updateNavigationState = (event: Event) => {
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
586
+
if (this.props.onNavigationStateChange) {
+
+
+
587
+
this.props.onNavigationStateChange(event.nativeEvent);
+
+
+
588
+
}
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sophiebits + + + Facebook Github Bot 8 +
+
+ + +
Jul 26, 2016
+
+
+
+ +
+ + + +
+ +
+
+
589
+
};
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
590
+
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
591
+
/**
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @caabernathy + + + Facebook Github Bot 4 +
+
+ + +
Jun 23, 2016
+
+
+
+ +
+ + + +
+ +
+
+
592
+
* Returns the native `WebView` node.
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
593
+
*/
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sophiebits + + + Facebook Github Bot 8 +
+
+ + +
Jul 26, 2016
+
+
+
+ +
+ + + +
+ +
+
+
594
+
getWebViewHandle = (): any => {
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sebmarkbage + + + Facebook Github Bot 5 +
+
+ + +
Apr 7, 2016
+
+
+
+ +
+ + + +
+ +
+
+
595
+
return ReactNative.findNodeHandle(this.refs[RCT_WEBVIEW_REF]);
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sophiebits + + + Facebook Github Bot 8 +
+
+ + +
Jul 26, 2016
+
+
+
+ +
+ + + +
+ +
+
+
596
+
};
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
597
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sophiebits + + + Facebook Github Bot 8 +
+
+ + +
Jul 26, 2016
+
+
+
+ +
+ + + +
+ +
+
+
598
+
_onLoadingStart = (event: Event) => {
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + Horcrux + + facebook-github-bot-3 +
+
+ + +
Jan 15, 2016
+
+
+
+ +
+ + + +
+ +
+
+
599
+
var onLoadStart = this.props.onLoadStart;
+
+
+
600
+
onLoadStart && onLoadStart(event);
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
601
+
this._updateNavigationState(event);
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sophiebits + + + Facebook Github Bot 8 +
+
+ + +
Jul 26, 2016
+
+
+
+ +
+ + + +
+ +
+
+
602
+
};
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
603
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sophiebits + + + Facebook Github Bot 8 +
+
+ + +
Jul 26, 2016
+
+
+
+ +
+ + + +
+ +
+
+
604
+
_onLoadingError = (event: Event) => {
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
605
+
event.persist(); // persist this event because we need to store it
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + Horcrux + + facebook-github-bot-3 +
+
+ + +
Jan 15, 2016
+
+
+
+ +
+ + + +
+ +
+
+
606
+
var {onError, onLoadEnd} = this.props;
+
+
+
607
+
onError && onError(event);
+
+
+
608
+
onLoadEnd && onLoadEnd(event);
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Aug 27, 2015
+
+
+
+ +
+ + + +
+ +
+
+
609
+
console.warn('Encountered an error loading page', event.nativeEvent);
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
610
+
+
+
+
611
+
this.setState({
+
+
+
612
+
lastErrorEvent: event.nativeEvent,
+
+
+
613
+
viewState: WebViewState.ERROR
+
+
+
614
+
});
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sophiebits + + + Facebook Github Bot 8 +
+
+ + +
Jul 26, 2016
+
+
+
+ +
+ + + +
+ +
+
+
615
+
};
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
616
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sophiebits + + + Facebook Github Bot 8 +
+
+ + +
Jul 26, 2016
+
+
+
+ +
+ + + +
+ +
+
+
617
+
_onLoadingFinish = (event: Event) => {
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + Horcrux + + facebook-github-bot-3 +
+
+ + +
Jan 15, 2016
+
+
+
+ +
+ + + +
+ +
+
+
618
+
var {onLoad, onLoadEnd} = this.props;
+
+
+
619
+
onLoad && onLoad(event);
+
+
+
620
+
onLoadEnd && onLoadEnd(event);
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
621
+
this.setState({
+
+
+
622
+
viewState: WebViewState.IDLE,
+
+
+
623
+
});
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
624
+
this._updateNavigationState(event);
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sophiebits + + + Facebook Github Bot 8 +
+
+ + +
Jul 26, 2016
+
+
+
+ +
+ + + +
+ +
+
+
625
+
};
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
626
+
+
+
+
627
+
_onMessage = (event: Event) => {
+
+
+
628
+
var {onMessage} = this.props;
+
+
+
629
+
onMessage && onMessage(event);
+
+
+
630
+
}
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @sophiebits + + + Facebook Github Bot 8 +
+
+ + +
Jul 26, 2016
+
+
+
+ +
+ + + +
+ +
+
+
631
+
}
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
632
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @cbrevik + + + + @facebook-github-bot + +
+
+ + +
Sep 19, 2017
+
+
+
+ +
+ + + +
+ +
+
+
633
+
var RCTWebView = requireNativeComponent('RCTWebView', WebView, WebView.extraNativeComponentConfig);
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
634
+
+
+
+
635
+
var styles = StyleSheet.create({
+
+
+
636
+
container: {
+
+
+
637
+
flex: 1,
+
+
+
638
+
},
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @donyu + +
+
+ + +
Mar 31, 2015
+
+
+
+ +
+ + + +
+ +
+
+
639
+
errorContainer: {
+
+
+
640
+
flex: 1,
+
+
+
641
+
justifyContent: 'center',
+
+
+
642
+
alignItems: 'center',
+
+
+
643
+
backgroundColor: BGWASH,
+
+
+
644
+
},
+
+
+
645
+
errorText: {
+
+
+
646
+
fontSize: 14,
+
+
+
647
+
textAlign: 'center',
+
+
+
648
+
marginBottom: 2,
+
+
+
649
+
},
+
+
+
650
+
errorTextTitle: {
+
+
+
651
+
fontSize: 15,
+
+
+
652
+
fontWeight: '500',
+
+
+
653
+
marginBottom: 10,
+
+
+
654
+
},
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
655
+
hidden: {
+
+
+
656
+
height: 0,
+
+
+
657
+
flex: 0, // disable 'flex:1' when hiding a View
+
+
+
658
+
},
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @donyu + +
+
+ + +
Mar 31, 2015
+
+
+
+ +
+ + + +
+ +
+
+
659
+
loadingView: {
+
+
+
660
+
backgroundColor: BGWASH,
+
+
+
661
+
flex: 1,
+
+
+
662
+
justifyContent: 'center',
+
+
+
663
+
alignItems: 'center',
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + + + facebook-github-bot-7 +
+
+ + +
Feb 3, 2016
+
+
+
+ +
+ + + +
+ +
+
+
664
+
height: 100,
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @donyu + +
+
+ + +
Mar 31, 2015
+
+
+
+ +
+ + + +
+ +
+
+
665
+
},
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @lwansbrough + +
+
+ + +
Apr 20, 2015
+
+
+
+ +
+ + + +
+ +
+
+
666
+
webView: {
+
+
+
667
+
backgroundColor: '#ffffff',
+
+
+
668
+
}
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + @nicklockwood + +
+
+ + +
Mar 14, 2015
+
+
+
+ +
+
+ +
+
+
669
+
});
+
+
+
670
+
+
+
+
671
+
module.exports = WebView;
+
+
+
+
+
+ +
+ + +
+ +
+ +
+
+ +
+ + + + + + +
+ + + You can't perform that action at this time. +
+ + + + + + + + + + +
+ + You signed in with another tab or window. Reload to refresh your session. + You signed out in another tab or window. Reload to refresh your session. +
+ + + + + + + diff --git a/__tests__/github-mention-test.js b/__tests__/github-mention-test.js index 2c65833..617c5b5 100644 --- a/__tests__/github-mention-test.js +++ b/__tests__/github-mention-test.js @@ -51,7 +51,7 @@ describe('Github Mention', function() { const reactNativePR = { repoName: 'https://github.com/facebook/react-native', - prNumber: 3238, + prNumber: 17759, prUser: 'mention-bot', prBaseBranch: 'master', privateRepo: false, @@ -77,7 +77,7 @@ describe('Github Mention', function() { }, github ).then(function(owners) { - expect(owners).toEqual(['corbt', 'vjeux', 'sahrens']); + expect(owners).toEqual(['motiz88', 'cosmith', 'sahrens']); }); }); @@ -89,7 +89,7 @@ describe('Github Mention', function() { cb(null, [ {login: 'sahrens'}, {login: 'not-vjeux'}, - {login: 'corbt'} + {login: 'cosmith'} ]); }) } @@ -118,7 +118,7 @@ describe('Github Mention', function() { page: 0, per_page: 100 }); - expect(owners).toEqual(['corbt', 'sahrens']); + expect(owners).toEqual(['cosmith', 'sahrens']); }); }); @@ -136,7 +136,7 @@ describe('Github Mention', function() { //Second call to the github api returns 2 results var onCall2 = [ {login: 'vjeux'}, - {login: 'corbt'} + {login: 'cosmith'} ]; var githubMock = { @@ -179,7 +179,7 @@ describe('Github Mention', function() { page: 1, per_page: 100 }); - expect(owners).toEqual(['corbt', 'vjeux', 'sahrens']); + expect(owners).toEqual(['cosmith', 'sahrens', 'vjeux']); }); }); @@ -209,7 +209,7 @@ describe('Github Mention', function() { githubMock ).then(function(owners) { expect(githubMock.orgs.getMembers.mock.calls.length).toBe(0); - expect(owners).toEqual(['corbt', 'vjeux', 'sahrens']); + expect(owners).toEqual(['motiz88', 'cosmith', 'sahrens']); }); }); @@ -231,7 +231,7 @@ describe('Github Mention', function() { findPotentialReviewers: false, alwaysNotifyForPaths: [{ name: 'jcsmorais', - files: ['website/server/*'] + files: ['Libraries/Image/*'] }] }, github @@ -526,177 +526,682 @@ describe('Github Mention', function() { it('ParseBlame1', function() { var parsed = mentionBot.parseBlame( - // https://github.com/facebook/react-native/blame/master/Libraries/Components/MapView/MapView.js - getFile('MapView.js.blame') + // https://github.com/facebook/react-native/blame/master/Libraries/Components/WebView/WebView.ios.js + getFile('WebView.ios.js.blame') ); expect(parsed).toEqual([ - 'tadeuzagallo', - 'vjeux', 'vjeux', 'vjeux', 'vjeux', 'vjeux', 'vjeux', - 'tadeuzagallo', 'tadeuzagallo', - 'bhosmer', - 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', - 'shtefanntz', - 'nicklockwood', 'nicklockwood', - 'davidaurelio', - 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', - 'janicduplessis', - 'nicklockwood', 'nicklockwood', 'nicklockwood', - 'tadeuzagallo', - 'bhosmer', 'bhosmer', - 'caabernathy', - 'mkonicek', - 'caabernathy', - 'browniefed', - 'caabernathy', 'caabernathy', 'caabernathy', - 'davidaurelio', - 'caabernathy', 'caabernathy', 'caabernathy', - 'davidaurelio', - 'caabernathy', 'caabernathy', 'caabernathy', - 'davidaurelio', - 'caabernathy', 'caabernathy', 'caabernathy', - 'davidaurelio', - 'caabernathy', 'caabernathy', 'caabernathy', - 'davidaurelio', - 'browniefed', 'browniefed', - 'benhoyt', - 'mkonicek', 'mkonicek', 'mkonicek', 'mkonicek', 'mkonicek', 'mkonicek', 'mkonicek', 'mkonicek', 'mkonicek', - 'caabernathy', 'caabernathy', 'caabernathy', 'caabernathy', 'caabernathy', 'caabernathy', 'caabernathy', 'caabernathy', 'caabernathy', 'caabernathy', 'caabernathy', 'caabernathy', 'caabernathy', 'caabernathy', 'caabernathy', 'caabernathy', 'caabernathy', 'caabernathy', 'caabernathy', 'caabernathy', - 'benhoyt', 'benhoyt', - 'nicklockwood', - 'browniefed', - 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', - 'kmagiera', - 'tadeuzagallo', - 'caabernathy', - 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', - 'Crash--', 'Crash--', - 'tadeuzagallo', - 'caabernathy', - 'Crash--', - 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', - 'Crash--', 'Crash--', 'Crash--', 'Crash--', 'Crash--', - 'janicduplessis', - 'Crash--', - 'Andr3wHur5t', 'Andr3wHur5t', 'Andr3wHur5t', 'Andr3wHur5t', 'Andr3wHur5t', 'Andr3wHur5t', - 'caabernathy', - 'gilchenzion', 'gilchenzion', 'gilchenzion', 'gilchenzion', 'gilchenzion', - 'donyu', 'donyu', 'donyu', 'donyu', 'donyu', 'donyu', 'donyu', - 'tadeuzagallo', - 'ultralame', - 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', - 'davidaurelio', - 'caabernathy', 'caabernathy', 'caabernathy', - 'davidaurelio', - 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', - 'davidaurelio', - 'caabernathy', 'caabernathy', - 'davidaurelio', - 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', - 'dvcrn', - 'caabernathy', 'caabernathy', 'caabernathy', 'caabernathy', 'caabernathy', - 'dvcrn', 'dvcrn', 'dvcrn', 'dvcrn', 'dvcrn', 'dvcrn', - 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', - 'jutaz', - 'tadeuzagallo', 'tadeuzagallo', - 'nicklockwood', 'nicklockwood', - 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', - 'caabernathy', - 'ginamdar', 'ginamdar', 'ginamdar', 'ginamdar', 'ginamdar', 'ginamdar', 'ginamdar', 'ginamdar', 'ginamdar', - 'dvcrn', 'dvcrn', 'dvcrn', - 'janicduplessis', - 'browniefed', 'browniefed', 'browniefed', 'browniefed', 'browniefed', 'browniefed', 'browniefed', - 'janicduplessis', - 'browniefed', - 'dvcrn', 'dvcrn', - 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', - 'caabernathy', - 'ginamdar', 'ginamdar', 'ginamdar', - 'gabelevi', - 'dvcrn', - 'nicklockwood', - 'dvcrn', - 'nicklockwood', 'nicklockwood', 'nicklockwood', - 'gabelevi', - 'dvcrn', - 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', - 'jutaz', - 'nicklockwood', 'nicklockwood', - 'shtefanntz', - 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', - 'trave7er', - 'timfpark', - 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', - 'timfpark', 'timfpark', 'timfpark', - 'gabelevi', - 'nicklockwood', 'nicklockwood', 'nicklockwood', - 'janicduplessis', 'janicduplessis', 'janicduplessis', 'janicduplessis', 'janicduplessis', 'janicduplessis', 'janicduplessis', 'janicduplessis', 'janicduplessis', 'janicduplessis', 'janicduplessis', 'janicduplessis', 'janicduplessis', 'janicduplessis', 'janicduplessis', 'janicduplessis', - 'timfpark', 'timfpark', 'timfpark', 'timfpark', 'timfpark', 'timfpark', 'timfpark', 'timfpark', 'timfpark', 'timfpark', 'timfpark', 'timfpark', 'timfpark', - 'dvcrn', - 'timfpark', 'timfpark', 'timfpark', 'timfpark', - 'shtefanntz', 'shtefanntz', - 'timfpark', 'timfpark', 'timfpark', 'timfpark', 'timfpark', - 'ginamdar', 'ginamdar', 'ginamdar', - 'caabernathy', - 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', - 'caabernathy', - 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', - 'dvcrn', 'dvcrn', - 'caabernathy', - 'dvcrn', 'dvcrn', - 'kmagiera', 'kmagiera', 'kmagiera', 'kmagiera', 'kmagiera', - 'tadeuzagallo', 'tadeuzagallo', - 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', - 'Crash--', - 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', - 'gabelevi', - 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', - 'gabelevi', - 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', - 'janicduplessis', - 'davidaurelio', - 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', - 'davidaurelio', 'davidaurelio', - 'timfpark', 'timfpark', 'timfpark', 'timfpark', - 'nicklockwood', 'nicklockwood', - 'timfpark', - 'dvcrn', - 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', - 'nicklockwood', - 'jerolimov', - 'timfpark', - 'jerolimov', - 'nicklockwood', - 'jerolimov', - 'nicklockwood', 'nicklockwood', 'nicklockwood', - 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', - 'nicklockwood', - 'dvcrn', 'dvcrn', - 'nicklockwood', - 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', - 'browniefed', - 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', - 'browniefed', - 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', 'jerolimov', - 'nicklockwood', - 'dvcrn', - 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', - 'dvcrn', 'dvcrn', - 'Crash--', 'Crash--', 'Crash--', 'Crash--', 'Crash--', - 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', - 'Crash--', - 'timfpark', - 'nicklockwood', 'nicklockwood', - 'browniefed', - 'jerolimov', 'jerolimov', - 'nicklockwood', 'nicklockwood', - 'tadeuzagallo', 'tadeuzagallo', 'tadeuzagallo', - 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', 'nicklockwood', - 'browniefed', 'browniefed', - 'jerolimov', 'jerolimov', - 'browniefed', 'browniefed', 'browniefed', - 'kmagiera', - 'tadeuzagallo', 'tadeuzagallo' + "nicklockwood", + "vjeux", + "vjeux", + "vjeux", + "vjeux", + "vjeux", + "vjeux", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "janicduplessis", + "nicklockwood", + "nicklockwood", + "facebook-github-bot", + "yungsters", + "nicklockwood", + "donyu", + "nicklockwood", + "nicklockwood", + "facebook-github-bot", + "facebook-github-bot", + "nicklockwood", + "nicklockwood", + "davidaurelio", + "davidaurelio", + "nicklockwood", + "sahrens", + "nicklockwood", + "nicklockwood", + "sahrens", + "nicklockwood", + "donyu", + "sahrens", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "bhosmer", + "davidaurelio", + "davidaurelio", + "davidaurelio", + "bhosmer", + "bhosmer", + "bhosmer", + "bhosmer", + "bhosmer", + "bhosmer", + "bhosmer", + "bhosmer", + "bhosmer", + "bhosmer", + "bhosmer", + "bhosmer", + "bhosmer", + "donyu", + "donyu", + "janicduplessis", + "donyu", + "donyu", + "donyu", + "donyu", + "donyu", + "donyu", + "donyu", + "donyu", + "donyu", + "donyu", + "donyu", + "donyu", + "donyu", + "donyu", + "donyu", + "donyu", + "donyu", + "donyu", + "donyu", + "mkonicek", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "mkonicek", + "sophiebits", + "sophiebits", + "sophiebits", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "nicklockwood", + "sophiebits", + "facebook-github-bot", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "caabernathy", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "mkonicek", + "mkonicek", + "mkonicek", + "donyu", + "mkonicek", + "mkonicek", + "mkonicek", + "mkonicek", + "mkonicek", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "mkonicek", + "caabernathy", + "caabernathy", + "mkonicek", + "mkonicek", + "lwansbrough", + "aflanagan", + "aflanagan", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "nicklockwood", + "caabernathy", + "aflanagan", + "aflanagan", + "aflanagan", + "mkonicek", + "caabernathy", + "caabernathy", + "mkonicek", + "mkonicek", + "lwansbrough", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "nicklockwood", + "caabernathy", + "caabernathy", + "caabernathy", + "facebook-github-bot", + "caabernathy", + "nicklockwood", + "caabernathy", + "caabernathy", + "caabernathy", + "nicklockwood", + "jacobp100", + "jacobp100", + "jacobp100", + "jacobp100", + "jacobp100", + "jacobp100", + "jacobp100", + "jacobp100", + "jacobp100", + "jacobp100", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "facebook-github-bot", + "Crash--", + "Crash--", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "kmagiera", + "caabernathy", + "caabernathy", + "Crash--", + "kmagiera", + "odino", + "Crash--", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "odino", + "caabernathy", + "caabernathy", + "odino", + "odino", + "odino", + "odino", + "odino", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "chiraggshah", + "caabernathy", + "chiraggshah", + "chiraggshah", + "chiraggshah", + "chiraggshah", + "alvaromb", + "caabernathy", + "caabernathy", + "caabernathy", + "alvaromb", + "alvaromb", + "javache", + "javache", + "caabernathy", + "caabernathy", + "caabernathy", + "Crash--", + "javache", + "javache", + "Crash--", + "Crash--", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "caabernathy", + "Crash--", + "Crash--", + "Crash--", + "Thomas101", + "Thomas101", + "caabernathy", + "ios122", + "Thomas101", + "Thomas101", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "sophiebits", + "nicklockwood", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "sophiebits", + "sophiebits", + "sophiebits", + "sophiebits", + "sophiebits", + "nicklockwood", + "sophiebits", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "sophiebits", + "nicklockwood", + "sophiebits", + "nicklockwood", + "nicklockwood", + "donyu", + "donyu", + "nicklockwood", + "nicklockwood", + "bhosmer", + "bhosmer", + "bhosmer", + "bhosmer", + "donyu", + "nicklockwood", + "nicklockwood", + "donyu", + "donyu", + "nicklockwood", + "donyu", + "donyu", + "donyu", + "nicklockwood", + "nicklockwood", + "lwansbrough", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "javache", + "javache", + "javache", + "facebook-github-bot", + "javache", + "javache", + "aflanagan", + "aflanagan", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "jacobp100", + "jacobp100", + "facebook-github-bot", + "facebook-github-bot", + "nicklockwood", + "facebook-github-bot", + "sahrens", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "lwansbrough", + "lwansbrough", + "aflanagan", + "nicklockwood", + "nicklockwood", + "janicduplessis", + "janicduplessis", + "janicduplessis", + "jacobp100", + "jacobp100", + "javache", + "alvaromb", + "Crash--", + "Thomas101", + "Thomas101", + "facebook-github-bot", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "sophiebits", + "nicklockwood", + "janicduplessis", + "caabernathy", + "janicduplessis", + "sophiebits", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "sophiebits", + "nicklockwood", + "janicduplessis", + "caabernathy", + "janicduplessis", + "sophiebits", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "sophiebits", + "nicklockwood", + "janicduplessis", + "janicduplessis", + "janicduplessis", + "sophiebits", + "stereodenis", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "sophiebits", + "nicklockwood", + "caabernathy", + "caabernathy", + "caabernathy", + "sophiebits", + "sophiebits", + "sophiebits", + "sophiebits", + "sophiebits", + "sophiebits", + "sophiebits", + "sophiebits", + "jacobp100", + "jacobp100", + "jacobp100", + "jacobp100", + "jacobp100", + "jacobp100", + "jacobp100", + "jacobp100", + "jacobp100", + "jacobp100", + "jacobp100", + "jacobp100", + "jacobp100", + "jacobp100", + "jacobp100", + "jacobp100", + "jacobp100", + "jacobp100", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "facebook-github-bot", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "sophiebits", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "sophiebits", + "nicklockwood", + "janicduplessis", + "caabernathy", + "janicduplessis", + "sophiebits", + "sebmarkbage", + "sophiebits", + "nicklockwood", + "sophiebits", + "sophiebits", + "sophiebits", + "janicduplessis", + "sophiebits", + "nicklockwood", + "sophiebits", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "sophiebits", + "nicklockwood", + "sophiebits", + "sophiebits", + "sophiebits", + "sophiebits", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "janicduplessis", + "sophiebits", + "jacobp100", + "jacobp100", + "jacobp100", + "jacobp100", + "jacobp100", + "sophiebits", + "nicklockwood", + "facebook-github-bot", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "donyu", + "donyu", + "donyu", + "donyu", + "donyu", + "donyu", + "donyu", + "donyu", + "donyu", + "donyu", + "donyu", + "donyu", + "donyu", + "donyu", + "donyu", + "donyu", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "nicklockwood", + "donyu", + "donyu", + "donyu", + "donyu", + "donyu", + "nicklockwood", + "donyu", + "lwansbrough", + "lwansbrough", + "lwansbrough", + "nicklockwood", + "nicklockwood", + "nicklockwood" ]); }); }); diff --git a/cache/https---github.com-facebook-react-native-blame-master-Libraries-Image-Image.ios.js b/cache/https---github.com-facebook-react-native-blame-master-Libraries-Image-Image.ios.js new file mode 100644 index 0000000..0d5a095 --- /dev/null +++ b/cache/https---github.com-facebook-react-native-blame-master-Libraries-Image-Image.ios.js @@ -0,0 +1,7353 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + react-native/Libraries/Image/Image.ios.js at master · facebook/react-native · GitHub + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Skip to content +
+ + + + + + + + + +
+ +
+ +
+
+ + + +
+
+
+ + + + + + + + + + + +
+
+ + + +
+ + Permalink + + + +
+ Newer +
    +
  1. +
  2. +
  3. +
  4. +
  5. +
  6. +
  7. +
  8. +
  9. +
  10. +
+ Older +
+ +
+
+
+ +
+ + + +
+ + 100644 + + 269 lines (251 sloc) + + 7.9 KB +
+
+ +
+
+ +
+ + + +
+
+ +
+
+
1
+
/**
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
2
+
* Copyright (c) 2015-present, Facebook, Inc.
+
+
+
3
+
* All rights reserved.
+
+
+
4
+
*
+
+
+
5
+
* This source code is licensed under the BSD-style license found in the
+
+
+
6
+
* LICENSE file in the root directory of this source tree. An additional grant
+
+
+
7
+
* of patent rights can be found in the PATENTS file in the same directory.
+
+
+
+ +
+ + + +
+
+ +
+
+
8
+
*
+
+
+
9
+
* @providesModule Image
+
+
+
+ +
+ +
+
+ +
+ + @bhosmer + +
Mar 26, 2015
+
+
+
+ +
+ + + +
+ +
+
+
10
+
* @flow
+
+
+
+ +
+ +
+
+ +
+ + @shergin + +
Jan 15, 2018
+
+
+
+ +
+ + + +
+ +
+
+
11
+
* @format
+
+
+
+ +
+ + + +
+
+ +
+
+
12
+
*/
+
+
+
13
+
'use strict';
+
+
+
14
+
+
+
+
+ +
+ +
+
+ +
+ + @nicklockwood + +
Jun 7, 2016
+
+
+
+ +
+ + + +
+ +
+
+
15
+
const EdgeInsetsPropType = require('EdgeInsetsPropType');
+
+
+
16
+
const ImageResizeMode = require('ImageResizeMode');
+
+
+
17
+
const ImageSourcePropType = require('ImageSourcePropType');
+
+
+
18
+
const ImageStylePropTypes = require('ImageStylePropTypes');
+
+
+
+ +
+ +
+
+ +
+ + @davidaurelio + +
Nov 4, 2016
+
+
+
+ +
+ + + +
+ +
+
+
19
+
const NativeMethodsMixin = require('NativeMethodsMixin');
+
+
+
+ +
+ +
+
+ +
+ + @nicklockwood + +
Jun 7, 2016
+
+
+
+ +
+ + + +
+ +
+
+
20
+
const NativeModules = require('NativeModules');
+
+
+
21
+
const React = require('React');
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
22
+
const PropTypes = require('prop-types');
+
+
+
+ +
+ +
+
+ +
+ + @nicklockwood + +
Jun 7, 2016
+
+
+
+ +
+ + + +
+ +
+
+
23
+
const ReactNativeViewAttributes = require('ReactNativeViewAttributes');
+
+
+
24
+
const StyleSheet = require('StyleSheet');
+
+
+
25
+
const StyleSheetPropType = require('StyleSheetPropType');
+
+
+
26
+
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
27
+
const createReactClass = require('create-react-class');
+
+
+
+ +
+ +
+
+ +
+ + @nicklockwood + +
Jun 7, 2016
+
+
+
+ +
+ + + +
+ +
+
+
28
+
const flattenStyle = require('flattenStyle');
+
+
+
29
+
const requireNativeComponent = require('requireNativeComponent');
+
+
+
30
+
const resolveAssetSource = require('resolveAssetSource');
+
+
+
31
+
+
+
+
32
+
const ImageViewManager = NativeModules.ImageViewManager;
+
+
+
+ +
+ +
+
+ +
+ + @nicklockwood + +
Jan 1, 2016
+
+
+
+ +
+ + + +
+ +
+
+
33
+
+
+
+
+ +
+ + + +
+
+ +
+
+
34
+
/**
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
35
+
* A React component for displaying different types of images,
+
+
+
+ +
+ + + +
+
+ +
+
+
36
+
* including network images, static resources, temporary local images, and
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
37
+
* images from local disk, such as the camera roll.
+
+
+
+ +
+ + + +
+
+ +
+
+
38
+
*
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
39
+
* See https://facebook.github.io/react-native/docs/image.html
+
+
+
+ +
+ + + +
+
+ +
+
+
40
+
*/
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
41
+
const Image = createReactClass({
+
+
+
42
+
displayName: 'Image',
+
+
+
+ +
+ + + +
+
+ +
+
+
43
+
propTypes: {
+
+
+
+ +
+ +
+
+ +
+ + @JoelMarcey + +
Jun 24, 2016
+
+
+
+ +
+ + + +
+ +
+
+
44
+
/**
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
45
+
* See https://facebook.github.io/react-native/docs/image.html#style
+
+
+
+ +
+ +
+
+ +
+ + @JoelMarcey + +
Jun 24, 2016
+
+
+
+ +
+ + + +
+ +
+
+
46
+
*/
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
47
+
style: StyleSheetPropType(ImageStylePropTypes),
+
+
+
+ +
+ +
+
+ +
+ + @vjeux + +
Apr 1, 2015
+
+
+
+ +
+ + + +
+ +
+
+
48
+
/**
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
49
+
* The image source (either a remote URL or a local file resource).
+
+
+
+ +
+ +
+
+ +
+ + + +
Jul 28, 2016
+
+
+
+ +
+ + + +
+ +
+
+
50
+
*
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
51
+
* See https://facebook.github.io/react-native/docs/image.html#source
+
+
+
+ +
+ +
+
+ +
+ + @vjeux + +
Apr 1, 2015
+
+
+
+ +
+ + + +
+ +
+
+
52
+
*/
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
53
+
source: ImageSourcePropType,
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
54
+
/**
+
+
+
+ +
+ +
+
+ +
+ + @nicklockwood + +
Dec 8, 2015
+
+
+
+ +
+ + + +
+ +
+
+
55
+
* A static image to display while loading the image source.
+
+
+
+ +
+ +
+
+ +
+ + @JoelMarcey + +
Jun 24, 2016
+
+
+
+ +
+ + + +
+ +
+
+
56
+
*
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
57
+
* See https://facebook.github.io/react-native/docs/image.html#defaultsource
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
58
+
*/
+
+
+
+ +
+ +
+
+ +
+ + @nicklockwood + +
Dec 8, 2015
+
+
+
+ +
+ + + +
+ +
+
+
59
+
defaultSource: PropTypes.oneOfType([
+
+
+
60
+
PropTypes.shape({
+
+
+
61
+
uri: PropTypes.string,
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
62
+
width: PropTypes.number,
+
+
+
63
+
height: PropTypes.number,
+
+
+
64
+
scale: PropTypes.number,
+
+
+
+ +
+ +
+
+ +
+ + @nicklockwood + +
Dec 8, 2015
+
+
+
+ +
+ + + +
+ +
+
+
65
+
}),
+
+
+
66
+
PropTypes.number,
+
+
+
67
+
]),
+
+
+
+ +
+ + + +
+
+ +
+
+
68
+
/**
+
+
+
+ +
+ +
+
+ +
+ + @mkonicek + +
Jul 24, 2015
+
+
+
+ +
+ + + +
+ +
+
+
69
+
* When true, indicates the image is an accessibility element.
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
70
+
*
+
+
+
71
+
* See https://facebook.github.io/react-native/docs/image.html#accessible
+
+
+
+ +
+ + + +
+
+ +
+
+
72
+
*/
+
+
+
73
+
accessible: PropTypes.bool,
+
+
+
74
+
/**
+
+
+
+ +
+ +
+
+ +
+ + @mkonicek + +
Jul 24, 2015
+
+
+
+ +
+ + + +
+ +
+
+
75
+
* The text that's read by the screen reader when the user interacts with
+
+
+
76
+
* the image.
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
77
+
*
+
+
+
78
+
* See https://facebook.github.io/react-native/docs/image.html#accessibilitylabel
+
+
+
+ +
+ + + +
+
+ +
+
+
79
+
*/
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
80
+
accessibilityLabel: PropTypes.node,
+
+
+
+ +
+ +
+
+ +
+ + + +
Mar 17, 2016
+
+
+
+ +
+ + + +
+ +
+
+
81
+
/**
+
+
+
+ +
+ +
+
+ +
+ + @shergin + +
Jan 15, 2018
+
+
+
+ +
+ + + +
+ +
+
+
82
+
* blurRadius: the blur radius of the blur filter added to the image
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
83
+
*
+
+
+
84
+
* See https://facebook.github.io/react-native/docs/image.html#blurradius
+
+
+
+ +
+ +
+
+ +
+ + @shergin + +
Jan 15, 2018
+
+
+
+ +
+ + + +
+ +
+
+
85
+
*/
+
+
+
+ +
+ +
+
+ +
+ + + +
Mar 17, 2016
+
+
+
+ +
+ + + +
+ +
+
+
86
+
blurRadius: PropTypes.number,
+
+
+
+ +
+ + + +
+
+ +
+
+
87
+
/**
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
88
+
* See https://facebook.github.io/react-native/docs/image.html#capinsets
+
+
+
+ +
+ + + +
+
+ +
+
+
89
+
*/
+
+
+
90
+
capInsets: EdgeInsetsPropType,
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
91
+
/**
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
92
+
* See https://facebook.github.io/react-native/docs/image.html#resizemethod
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
93
+
*/
+
+
+
94
+
resizeMethod: PropTypes.oneOf(['auto', 'resize', 'scale']),
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
95
+
/**
+
+
+
96
+
* Determines how to resize the image when the frame doesn't match the raw
+
+
+
97
+
* image dimensions.
+
+
+
+ +
+ +
+
+ +
+ + @qbig + +
Dec 16, 2015
+
+
+
+ +
+ + + +
+ +
+
+
98
+
*
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
99
+
* See https://facebook.github.io/react-native/docs/image.html#resizemode
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
100
+
*/
+
+
+
+ +
+ +
+
+ +
+ + @shergin + +
Jan 15, 2018
+
+
+
+ +
+ + + +
+ +
+
+
101
+
resizeMode: PropTypes.oneOf([
+
+
+
102
+
'cover',
+
+
+
103
+
'contain',
+
+
+
104
+
'stretch',
+
+
+
105
+
'repeat',
+
+
+
106
+
'center',
+
+
+
107
+
]),
+
+
+
+ +
+ + + +
+
+ +
+
+
108
+
/**
+
+
+
+ +
+ +
+
+ +
+ + @vjeux + +
Apr 1, 2015
+
+
+
+ +
+ + + +
+ +
+
+
109
+
* A unique identifier for this element to be used in UI Automation
+
+
+
+ +
+ + + +
+
+ +
+
+
110
+
* testing scripts.
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
111
+
*
+
+
+
112
+
* See https://facebook.github.io/react-native/docs/image.html#testid
+
+
+
+ +
+ + + +
+
+ +
+
+
113
+
*/
+
+
+
114
+
testID: PropTypes.string,
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
115
+
/**
+
+
+
116
+
* Invoked on mount and layout changes with
+
+
+
+ +
+ +
+
+ +
+ + @mkonicek + +
Jul 24, 2015
+
+
+
+ +
+ + + +
+ +
+
+
117
+
* `{nativeEvent: {layout: {x, y, width, height}}}`.
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
118
+
*
+
+
+
119
+
* See https://facebook.github.io/react-native/docs/image.html#onlayout
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
120
+
*/
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
121
+
onLayout: PropTypes.func,
+
+
+
122
+
/**
+
+
+
+ +
+ +
+
+ +
+ + @JoelMarcey + +
Jun 24, 2016
+
+
+
+ +
+ + + +
+ +
+
+
123
+
* Invoked on load start.
+
+
+
124
+
*
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
125
+
* See https://facebook.github.io/react-native/docs/image.html#onloadstart
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
126
+
*/
+
+
+
127
+
onLoadStart: PropTypes.func,
+
+
+
128
+
/**
+
+
+
+ +
+ +
+
+ +
+ + @JoelMarcey + +
Jun 24, 2016
+
+
+
+ +
+ + + +
+ +
+
+
129
+
* Invoked on download progress with `{nativeEvent: {loaded, total}}`.
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
130
+
*
+
+
+
131
+
* See https://facebook.github.io/react-native/docs/image.html#onprogress
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
132
+
*/
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
133
+
onProgress: PropTypes.func,
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
134
+
/**
+
+
+
+ +
+ +
+
+ +
+ + @JoelMarcey + +
Jun 24, 2016
+
+
+
+ +
+ + + +
+ +
+
+
135
+
* Invoked on load error with `{nativeEvent: {error}}`.
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
136
+
*
+
+
+
137
+
* See https://facebook.github.io/react-native/docs/image.html#onerror
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
138
+
*/
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
139
+
onError: PropTypes.func,
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
140
+
/**
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
141
+
* Invoked when a partial load of the image is complete.
+
+
+
142
+
*
+
+
+
143
+
* See https://facebook.github.io/react-native/docs/image.html#onpartialload
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
144
+
*/
+
+
+
145
+
onPartialLoad: PropTypes.func,
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
146
+
/**
+
+
+
+ +
+ +
+
+ +
+ + @JoelMarcey + +
Jun 24, 2016
+
+
+
+ +
+ + + +
+ +
+
+
147
+
* Invoked when load completes successfully.
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
148
+
*
+
+
+
149
+
* See https://facebook.github.io/react-native/docs/image.html#onload
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
150
+
*/
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
151
+
onLoad: PropTypes.func,
+
+
+
152
+
/**
+
+
+
+ +
+ +
+
+ +
+ + @JoelMarcey + +
Jun 24, 2016
+
+
+
+ +
+ + + +
+ +
+
+
153
+
* Invoked when load either succeeds or fails.
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
154
+
*
+
+
+
155
+
* See https://facebook.github.io/react-native/docs/image.html#onloadend
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
156
+
*/
+
+
+
157
+
onLoadEnd: PropTypes.func,
+
+
+
+ +
+ + + +
+
+ +
+
+
158
+
},
+
+
+
159
+
+
+
+
160
+
statics: {
+
+
+
161
+
resizeMode: ImageResizeMode,
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
162
+
/**
+
+
+
163
+
* Retrieve the width and height (in pixels) of an image prior to displaying it.
+
+
+
164
+
*
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
165
+
* See https://facebook.github.io/react-native/docs/image.html#getsize
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
166
+
*/
+
+
+
167
+
getSize: function(
+
+
+
168
+
uri: string,
+
+
+
169
+
success: (width: number, height: number) => void,
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
170
+
failure?: (error: any) => void,
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
171
+
) {
+
+
+
+ +
+ +
+
+ +
+ + @shergin + +
Jan 15, 2018
+
+
+
+ +
+ + + +
+ +
+
+
172
+
ImageViewManager.getSize(
+
+
+
173
+
uri,
+
+
+
174
+
success,
+
+
+
175
+
failure ||
+
+
+
176
+
function() {
+
+
+
177
+
console.warn('Failed to get size for image: ' + uri);
+
+
+
178
+
},
+
+
+
179
+
);
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
180
+
},
+
+
+
181
+
/**
+
+
+
182
+
* Prefetches a remote image for later use by downloading it to the disk
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
183
+
* cache.
+
+
+
+ +
+ +
+
+ +
+ + @JoelMarcey + +
Jun 24, 2016
+
+
+
+ +
+ + + +
+ +
+
+
184
+
*
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
185
+
* See https://facebook.github.io/react-native/docs/image.html#prefetch
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
186
+
*/
+
+
+
187
+
prefetch(url: string) {
+
+
+
+ +
+ +
+
+ +
+ + @nicklockwood + +
Jun 7, 2016
+
+
+
+ +
+ + + +
+ +
+
+
188
+
return ImageViewManager.prefetchImage(url);
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
189
+
},
+
+
+
+ +
+ +
+
+ +
+ + @rigdern + +
Nov 15, 2016
+
+
+
+ +
+ + + +
+ +
+
+
190
+
/**
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
191
+
* Resolves an asset reference into an object.
+
+
+
192
+
*
+
+
+
193
+
* See https://facebook.github.io/react-native/docs/image.html#resolveassetsource
+
+
+
+ +
+ +
+
+ +
+ + @rigdern + +
Nov 15, 2016
+
+
+
+ +
+ + + +
+ +
+
+
194
+
*/
+
+
+
195
+
resolveAssetSource: resolveAssetSource,
+
+
+
+ +
+ + + +
+
+ +
+
+
196
+
},
+
+
+
197
+
+
+
+
198
+
mixins: [NativeMethodsMixin],
+
+
+
199
+
+
+
+
200
+
/**
+
+
+
201
+
* `NativeMethodsMixin` will look for this when invoking `setNativeProps`. We
+
+
+
202
+
* make `this` look like an actual native component class.
+
+
+
203
+
*/
+
+
+
204
+
viewConfig: {
+
+
+
205
+
uiViewClassName: 'UIView',
+
+
+
+ +
+ +
+
+ +
+ + @shergin + +
Jan 15, 2018
+
+
+
+ +
+ + + +
+ +
+
+
206
+
validAttributes: ReactNativeViewAttributes.UIView,
+
+
+
+ +
+ + + +
+
+ +
+
+
207
+
},
+
+
+
208
+
+
+
+
209
+
render: function() {
+
+
+
+ +
+ +
+
+ +
+ + @shergin + +
Jan 15, 2018
+
+
+
+ +
+ + + +
+ +
+
+
210
+
const source = resolveAssetSource(this.props.source) || {
+
+
+
211
+
uri: undefined,
+
+
+
212
+
width: undefined,
+
+
+
213
+
height: undefined,
+
+
+
214
+
};
+
+
+
+ +
+ +
+
+ +
+ + + +
Jun 6, 2016
+
+
+
+ +
+ + + +
+ +
+
+
215
+
+
+
+
+ +
+ +
+
+ +
+ + + +
Jul 28, 2016
+
+
+
+ +
+ + + +
+ +
+
+
216
+
let sources;
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
217
+
let style;
+
+
+
+ +
+ +
+
+ +
+ + + +
Jul 28, 2016
+
+
+
+ +
+ + + +
+ +
+
+
218
+
if (Array.isArray(source)) {
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
219
+
style = flattenStyle([styles.base, this.props.style]) || {};
+
+
+
+ +
+ +
+
+ +
+ + + +
Jul 28, 2016
+
+
+
+ +
+ + + +
+ +
+
+
220
+
sources = source;
+
+
+
221
+
} else {
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
222
+
const {width, height, uri} = source;
+
+
+
+ +
+ +
+
+ +
+ + @shergin + +
Jan 15, 2018
+
+
+
+ +
+ + + +
+ +
+
+
223
+
style =
+
+
+
224
+
flattenStyle([{width, height}, styles.base, this.props.style]) || {};
+
+
+
+ +
+ +
+
+ +
+ + + +
Jul 28, 2016
+
+
+
+ +
+ + + +
+ +
+
+
225
+
sources = [source];
+
+
+
226
+
+
+
+
227
+
if (uri === '') {
+
+
+
228
+
console.warn('source.uri should not be an empty string');
+
+
+
229
+
}
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
230
+
}
+
+
+
+ +
+ +
+
+ +
+ + + +
Jun 6, 2016
+
+
+
+ +
+ + + +
+ +
+
+
231
+
+
+
+
+ +
+ +
+
+ +
+ + @shergin + +
Jan 15, 2018
+
+
+
+ +
+ + + +
+ +
+
+
232
+
const resizeMode =
+
+
+
233
+
this.props.resizeMode || (style || {}).resizeMode || 'cover'; // Workaround for flow bug t7737108
+
+
+
+ +
+ +
+
+ +
+ + + +
Jul 28, 2016
+
+
+
+ +
+ + + +
+ +
+
+
234
+
const tintColor = (style || {}).tintColor; // Workaround for flow bug t7737108
+
+
+
235
+
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
236
+
if (this.props.src) {
+
+
+
+ +
+ +
+
+ +
+ + @shergin + +
Jan 15, 2018
+
+
+
+ +
+ + + +
+ +
+
+
237
+
console.warn(
+
+
+
238
+
'The <Image> component requires a `source` property rather than `src`.',
+
+
+
239
+
);
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
240
+
}
+
+
+
241
+
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
242
+
if (this.props.children) {
+
+
+
+ +
+ +
+
+ +
+ + @shergin + +
Jan 15, 2018
+
+
+
+ +
+ + + +
+ +
+
+
243
+
throw new Error(
+
+
+
244
+
'The <Image> component cannot contain children. If you want to render content on top of the image, consider using the <ImageBackground> component or absolute positioning.',
+
+
+
245
+
);
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
246
+
}
+
+
+
247
+
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
248
+
return (
+
+
+
+ +
+ +
+
+ +
+ + @nicklockwood + +
Jun 7, 2016
+
+
+
+ +
+ + + +
+ +
+
+
249
+
<RCTImageView
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
250
+
{...this.props}
+
+
+
251
+
style={style}
+
+
+
252
+
resizeMode={resizeMode}
+
+
+
253
+
tintColor={tintColor}
+
+
+
+ +
+ +
+
+ +
+ + + +
Jul 28, 2016
+
+
+
+ +
+ + + +
+ +
+
+
254
+
source={sources}
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
255
+
/>
+
+
+
256
+
);
+
+
+
+ +
+ +
+
+ +
+ + @nicklockwood + +
Jan 1, 2016
+
+
+
+ +
+ + + +
+ +
+
+
257
+
},
+
+
+
+ +
+ + + +
+
+ +
+
+
258
+
});
+
+
+
259
+
+
+
+
+ +
+ +
+
+ +
+ + @nicklockwood + +
Jun 7, 2016
+
+
+
+ +
+ + + +
+ +
+
+
260
+
const styles = StyleSheet.create({
+
+
+
+ +
+ + + +
+
+ +
+
+
261
+
base: {
+
+
+
262
+
overflow: 'hidden',
+
+
+
263
+
},
+
+
+
264
+
});
+
+
+
265
+
+
+
+
+ +
+ +
+
+ +
+ + @nicklockwood + +
Jun 7, 2016
+
+
+
+ +
+ + + +
+ +
+
+
266
+
const RCTImageView = requireNativeComponent('RCTImageView', Image);
+
+
+
+ +
+ +
+
+ +
+ + @nicklockwood + +
Jan 1, 2016
+
+
+
+ +
+ + + +
+ +
+
+
267
+
+
+
+
+ +
+ + + +
+
+ +
+
+
268
+
module.exports = Image;
+
+
+
+
+
+ +
+ + +
+ +
+ +
+
+ +
+ + + + + + +
+ + + You can't perform that action at this time. +
+ + + + + + + + + + +
+ + You signed in with another tab or window. Reload to refresh your session. + You signed out in another tab or window. Reload to refresh your session. +
+ + + + + + + diff --git a/cache/https---github.com-facebook-react-native-blame-master-RNTester-js-ImageExample.js b/cache/https---github.com-facebook-react-native-blame-master-RNTester-js-ImageExample.js new file mode 100644 index 0000000..721d7f3 --- /dev/null +++ b/cache/https---github.com-facebook-react-native-blame-master-RNTester-js-ImageExample.js @@ -0,0 +1,9675 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + react-native/RNTester/js/ImageExample.js at master · facebook/react-native · GitHub + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Skip to content +
+ + + + + + + + + +
+ +
+ +
+
+ + + +
+
+
+ + + + + + + + + + + +
+
+ + + +
+ + Permalink + + + +
+ Newer +
    +
  1. +
  2. +
  3. +
  4. +
  5. +
  6. +
  7. +
  8. +
  9. +
  10. +
+ Older +
+ +
+
+
+ +
+ + + +
+ + 100644 + + 788 lines (772 sloc) + + 23.2 KB +
+
+ +
+
+ +
+ + + +
+
+ +
+
+
1
+
/**
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
2
+
* Copyright (c) 2015-present, Facebook, Inc.
+
+
+
+ +
+ +
+
+ +
+ + @alonsch + +
Mar 19, 2016
+
+
+
+ +
+ + + +
+ +
+
+
3
+
* All rights reserved.
+
+
+
4
+
*
+
+
+
5
+
* This source code is licensed under the BSD-style license found in the
+
+
+
6
+
* LICENSE file in the root directory of this source tree. An additional grant
+
+
+
7
+
* of patent rights can be found in the PATENTS file in the same directory.
+
+
+
8
+
*
+
+
+
+ +
+ +
+
+ +
+ + @bhosmer + +
Mar 24, 2015
+
+
+
+ +
+ + + +
+ +
+
+
9
+
* @flow
+
+
+
+ +
+ +
+
+ +
+ + @voideanvalue + +
Feb 25, 2017
+
+
+
+ +
+ + + +
+ +
+
+
10
+
* @providesModule ImageExample
+
+
+
+ +
+ + + +
+
+ +
+
+
11
+
*/
+
+
+
12
+
'use strict';
+
+
+
13
+
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
14
+
var React = require('react');
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
15
+
var createReactClass = require('create-react-class');
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
16
+
var ReactNative = require('react-native');
+
+
+
+ +
+ + + +
+
+ +
+
+
17
+
var {
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
18
+
ActivityIndicator,
+
+
+
+ +
+ + + +
+
+ +
+
+
19
+
Image,
+
+
+
+ +
+ +
+
+ +
+ + @nicklockwood + +
Apr 5, 2016
+
+
+
+ +
+ + + +
+ +
+
+
20
+
Platform,
+
+
+
+ +
+ + + +
+
+ +
+
+
21
+
StyleSheet,
+
+
+
22
+
Text,
+
+
+
23
+
View,
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
24
+
ImageBackground,
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
25
+
} = ReactNative;
+
+
+
+ +
+ + + +
+
+ +
+
+
26
+
+
+
+
+ +
+ +
+
+ +
+ + @nicklockwood + +
Oct 19, 2015
+
+
+
+ +
+ + + +
+ +
+
+
27
+
var base64Icon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAQAAACSR7JhAAADtUlEQVR4Ac3YA2Bj6QLH0XPT1Fzbtm29tW3btm3bfLZtv7e2ObZnms7d8Uw098tuetPzrxv8wiISrtVudrG2JXQZ4VOv+qUfmqCGGl1mqLhoA52oZlb0mrjsnhKpgeUNEs91Z0pd1kvihA3ULGVHiQO2narKSHKkEMulm9VgUyE60s1aWoMQUbpZOWE+kaqs4eLEjdIlZTcFZB0ndc1+lhB1lZrIuk5P2aib1NBpZaL+JaOGIt0ls47SKzLC7CqrlGF6RZ09HGoNy1lYl2aRSWL5GuzqWU1KafRdoRp0iOQEiDzgZPnG6DbldcomadViflnl/cL93tOoVbsOLVM2jylvdWjXolWX1hmfZbGR/wjypDjFLSZIRov09BgYmtUqPQPlQrPapecLgTIy0jMgPKtTeob2zWtrGH3xvjUkPCtNg/tm1rjwrMa+mdUkPd3hWbH0jArPGiU9ufCsNNWFZ40wpwn+62/66R2RUtoso1OB34tnLOcy7YB1fUdc9e0q3yru8PGM773vXsuZ5YIZX+5xmHwHGVvlrGPN6ZSiP1smOsMMde40wKv2VmwPPVXNut4sVpUreZiLBHi0qln/VQeI/LTMYXpsJtFiclUN+5HVZazim+Ky+7sAvxWnvjXrJFneVtLWLyPJu9K3cXLWeOlbMTlrIelbMDlrLenrjEQOtIF+fuI9xRp9ZBFp6+b6WT8RrxEpdK64BuvHgDk+vUy+b5hYk6zfyfs051gRoNO1usU12WWRWL73/MMEy9pMi9qIrR4ZpV16Rrvduxazmy1FSvuFXRkqTnE7m2kdb5U8xGjLw/spRr1uTov4uOgQE+0N/DvFrG/Jt7i/FzwxbA9kDanhf2w+t4V97G8lrT7wc08aA2QNUkuTfW/KimT01wdlfK4yEw030VfT0RtZbzjeMprNq8m8tnSTASrTLti64oBNdpmMQm0eEwvfPwRbUBywG5TzjPCsdwk3IeAXjQblLCoXnDVeoAz6SfJNk5TTzytCNZk/POtTSV40NwOFWzw86wNJRpubpXsn60NJFlHeqlYRbslqZm2jnEZ3qcSKgm0kTli3zZVS7y/iivZTweYXJ26Y+RTbV1zh3hYkgyFGSTKPfRVbRqWWVReaxYeSLarYv1Qqsmh1s95S7G+eEWK0f3jYKTbV6bOwepjfhtafsvUsqrQvrGC8YhmnO9cSCk3yuY984F1vesdHYhWJ5FvASlacshUsajFt2mUM9pqzvKGcyNJW0arTKN1GGGzQlH0tXwLDgQTurS8eIQAAAABJRU5ErkJggg==';
+
+
+
28
+
+
+
+
+ +
+ + + +
+
+ +
+
+
29
+
var ImageCapInsetsExample = require('./ImageCapInsetsExample');
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
30
+
const IMAGE_PREFETCH_URL = 'http://origami.design/public/images/bird-logo.png?r=1&t=' + Date.now();
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
31
+
var prefetchTask = Image.prefetch(IMAGE_PREFETCH_URL);
+
+
+
+ +
+ + + +
+
+ +
+
+
32
+
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
33
+
/* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an error
+
+
+
34
+
* found when Flow v0.63 was deployed. To see the error delete this comment and
+
+
+
35
+
* run Flow. */
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
36
+
var NetworkImageCallbackExample = createReactClass({
+
+
+
37
+
displayName: 'NetworkImageCallbackExample',
+
+
+
+ +
+ +
+
+ +
+ + @brentvatne + +
Nov 26, 2015
+
+
+
+ +
+ + + +
+ +
+
+
38
+
getInitialState: function() {
+
+
+
39
+
return {
+
+
+
40
+
events: [],
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
41
+
startLoadPrefetched: false,
+
+
+
+ +
+ +
+
+ +
+ + @gabelevi + +
Dec 2, 2015
+
+
+
+ +
+ + + +
+ +
+
+
42
+
mountTime: new Date(),
+
+
+
+ +
+ +
+
+ +
+ + @brentvatne + +
Nov 26, 2015
+
+
+
+ +
+ + + +
+ +
+
+
43
+
};
+
+
+
44
+
},
+
+
+
45
+
+
+
+
46
+
componentWillMount() {
+
+
+
47
+
this.setState({mountTime: new Date()});
+
+
+
48
+
},
+
+
+
49
+
+
+
+
50
+
render: function() {
+
+
+
51
+
var { mountTime } = this.state;
+
+
+
52
+
+
+
+
53
+
return (
+
+
+
54
+
<View>
+
+
+
55
+
<Image
+
+
+
56
+
source={this.props.source}
+
+
+
57
+
style={[styles.base, {overflow: 'visible'}]}
+
+
+
58
+
onLoadStart={() => this._loadEventFired(`✔ onLoadStart (+${new Date() - mountTime}ms)`)}
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
59
+
onLoad={(event) => {
+
+
+
60
+
// Currently this image source feature is only available on iOS.
+
+
+
61
+
if (event.nativeEvent.source) {
+
+
+
62
+
const url = event.nativeEvent.source.url;
+
+
+
63
+
this._loadEventFired(`✔ onLoad (+${new Date() - mountTime}ms) for URL ${url}`);
+
+
+
64
+
} else {
+
+
+
65
+
this._loadEventFired(`✔ onLoad (+${new Date() - mountTime}ms)`);
+
+
+
66
+
}
+
+
+
67
+
}}
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
68
+
onLoadEnd={() => {
+
+
+
69
+
this._loadEventFired(`✔ onLoadEnd (+${new Date() - mountTime}ms)`);
+
+
+
70
+
this.setState({startLoadPrefetched: true}, () => {
+
+
+
71
+
prefetchTask.then(() => {
+
+
+
72
+
this._loadEventFired(`✔ Prefetch OK (+${new Date() - mountTime}ms)`);
+
+
+
73
+
}, error => {
+
+
+
74
+
this._loadEventFired(`✘ Prefetch failed (+${new Date() - mountTime}ms)`);
+
+
+
75
+
});
+
+
+
76
+
});
+
+
+
77
+
}}
+
+
+
+ +
+ +
+
+ +
+ + @brentvatne + +
Nov 26, 2015
+
+
+
+ +
+ + + +
+ +
+
+
78
+
/>
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
79
+
{this.state.startLoadPrefetched ?
+
+
+
80
+
<Image
+
+
+
81
+
source={this.props.prefetchedSource}
+
+
+
82
+
style={[styles.base, {overflow: 'visible'}]}
+
+
+
83
+
onLoadStart={() => this._loadEventFired(`✔ (prefetched) onLoadStart (+${new Date() - mountTime}ms)`)}
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
84
+
onLoad={(event) => {
+
+
+
85
+
// Currently this image source feature is only available on iOS.
+
+
+
86
+
if (event.nativeEvent.source) {
+
+
+
87
+
const url = event.nativeEvent.source.url;
+
+
+
88
+
this._loadEventFired(`✔ (prefetched) onLoad (+${new Date() - mountTime}ms) for URL ${url}`);
+
+
+
89
+
} else {
+
+
+
90
+
this._loadEventFired(`✔ (prefetched) onLoad (+${new Date() - mountTime}ms)`);
+
+
+
91
+
}
+
+
+
92
+
}}
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
93
+
onLoadEnd={() => this._loadEventFired(`✔ (prefetched) onLoadEnd (+${new Date() - mountTime}ms)`)}
+
+
+
94
+
/>
+
+
+
95
+
: null}
+
+
+
+ +
+ +
+
+ +
+ + @brentvatne + +
Nov 26, 2015
+
+
+
+ +
+ + + +
+ +
+
+
96
+
<Text style={{marginTop: 20}}>
+
+
+
97
+
{this.state.events.join('\n')}
+
+
+
98
+
</Text>
+
+
+
99
+
</View>
+
+
+
100
+
);
+
+
+
101
+
},
+
+
+
102
+
+
+
+
103
+
_loadEventFired(event) {
+
+
+
104
+
this.setState((state) => {
+
+
+
105
+
return state.events = [...state.events, event];
+
+
+
106
+
});
+
+
+
107
+
}
+
+
+
108
+
});
+
+
+
109
+
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
110
+
var NetworkImageExample = createReactClass({
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
111
+
getInitialState: function() {
+
+
+
112
+
return {
+
+
+
113
+
error: false,
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
114
+
loading: false,
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
115
+
progress: 0
+
+
+
116
+
};
+
+
+
117
+
},
+
+
+
118
+
render: function() {
+
+
+
119
+
var loader = this.state.loading ?
+
+
+
120
+
<View style={styles.progress}>
+
+
+
121
+
<Text>{this.state.progress}%</Text>
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
122
+
<ActivityIndicator style={{marginLeft:5}} />
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
123
+
</View> : null;
+
+
+
124
+
return this.state.error ?
+
+
+
125
+
<Text>{this.state.error}</Text> :
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
126
+
<ImageBackground
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
127
+
source={this.props.source}
+
+
+
128
+
style={[styles.base, {overflow: 'visible'}]}
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
129
+
onLoadStart={(e) => this.setState({loading: true})}
+
+
+
130
+
onError={(e) => this.setState({error: e.nativeEvent.error, loading: false})}
+
+
+
131
+
onProgress={(e) => this.setState({progress: Math.round(100 * e.nativeEvent.loaded / e.nativeEvent.total)})}
+
+
+
132
+
onLoad={() => this.setState({loading: false, error: false})}>
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
133
+
{loader}
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
134
+
</ImageBackground>;
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
135
+
}
+
+
+
136
+
});
+
+
+
137
+
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
138
+
var ImageSizeExample = createReactClass({
+
+
+
+ +
+ +
+
+ +
+ + @nicklockwood + +
Jan 1, 2016
+
+
+
+ +
+ + + +
+ +
+
+
139
+
getInitialState: function() {
+
+
+
140
+
return {
+
+
+
141
+
width: 0,
+
+
+
142
+
height: 0,
+
+
+
143
+
};
+
+
+
144
+
},
+
+
+
145
+
componentDidMount: function() {
+
+
+
146
+
Image.getSize(this.props.source.uri, (width, height) => {
+
+
+
147
+
this.setState({width, height});
+
+
+
148
+
});
+
+
+
149
+
},
+
+
+
150
+
render: function() {
+
+
+
151
+
return (
+
+
+
152
+
<View style={{flexDirection: 'row'}}>
+
+
+
153
+
<Image
+
+
+
154
+
style={{
+
+
+
155
+
width: 60,
+
+
+
156
+
height: 60,
+
+
+
157
+
backgroundColor: 'transparent',
+
+
+
158
+
marginRight: 10,
+
+
+
159
+
}}
+
+
+
160
+
source={this.props.source} />
+
+
+
161
+
<Text>
+
+
+
162
+
Actual dimensions:{'\n'}
+
+
+
163
+
Width: {this.state.width}, Height: {this.state.height}
+
+
+
164
+
</Text>
+
+
+
165
+
</View>
+
+
+
166
+
);
+
+
+
167
+
},
+
+
+
168
+
});
+
+
+
169
+
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
170
+
var MultipleSourcesExample = createReactClass({
+
+
+
+ +
+ +
+
+ +
+ + @andreicoman11 + +
Jun 13, 2016
+
+
+
+ +
+ + + +
+ +
+
+
171
+
getInitialState: function() {
+
+
+
172
+
return {
+
+
+
173
+
width: 30,
+
+
+
174
+
height: 30,
+
+
+
175
+
};
+
+
+
176
+
},
+
+
+
177
+
render: function() {
+
+
+
178
+
return (
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
179
+
<View>
+
+
+
+ +
+ +
+
+ +
+ + @andreicoman11 + +
Jun 13, 2016
+
+
+
+ +
+ + + +
+ +
+
+
180
+
<View style={{flexDirection: 'row', justifyContent: 'space-between'}}>
+
+
+
181
+
<Text
+
+
+
182
+
style={styles.touchableText}
+
+
+
183
+
onPress={this.decreaseImageSize} >
+
+
+
184
+
Decrease image size
+
+
+
185
+
</Text>
+
+
+
186
+
<Text
+
+
+
187
+
style={styles.touchableText}
+
+
+
188
+
onPress={this.increaseImageSize} >
+
+
+
189
+
Increase image size
+
+
+
190
+
</Text>
+
+
+
191
+
</View>
+
+
+
192
+
<Text>Container image size: {this.state.width}x{this.state.height} </Text>
+
+
+
193
+
<View
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
194
+
style={{height: this.state.height, width: this.state.width}} >
+
+
+
+ +
+ +
+
+ +
+ + @andreicoman11 + +
Jun 13, 2016
+
+
+
+ +
+ + + +
+ +
+
+
195
+
<Image
+
+
+
196
+
style={{flex: 1}}
+
+
+
197
+
source={[
+
+
+
+ +
+ +
+
+ +
+ + @gusgard + +
Dec 7, 2017
+
+
+
+ +
+ + + +
+ +
+
+
198
+
{uri: 'https://facebook.github.io/react-native/img/favicon.png', width: 38, height: 38},
+
+
+
199
+
{uri: 'https://facebook.github.io/react-native/img/favicon.png', width: 76, height: 76},
+
+
+
200
+
{uri: 'https://facebook.github.io/react-native/img/opengraph.png', width: 400, height: 400}
+
+
+
+ +
+ +
+
+ +
+ + @andreicoman11 + +
Jun 13, 2016
+
+
+
+ +
+ + + +
+ +
+
+
201
+
]}
+
+
+
202
+
/>
+
+
+
203
+
</View>
+
+
+
204
+
</View>
+
+
+
205
+
);
+
+
+
206
+
},
+
+
+
207
+
increaseImageSize: function() {
+
+
+
208
+
if (this.state.width >= 100) {
+
+
+
209
+
return;
+
+
+
210
+
}
+
+
+
211
+
this.setState({
+
+
+
212
+
width: this.state.width + 10,
+
+
+
213
+
height: this.state.height + 10,
+
+
+
214
+
});
+
+
+
215
+
},
+
+
+
216
+
decreaseImageSize: function() {
+
+
+
217
+
if (this.state.width <= 10) {
+
+
+
218
+
return;
+
+
+
219
+
}
+
+
+
220
+
this.setState({
+
+
+
221
+
width: this.state.width - 10,
+
+
+
222
+
height: this.state.height - 10,
+
+
+
223
+
});
+
+
+
224
+
},
+
+
+
225
+
});
+
+
+
226
+
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
227
+
exports.displayName = (undefined: ?string);
+
+
+
+ +
+ + + +
+
+ +
+
+
228
+
exports.framework = 'React';
+
+
+
229
+
exports.title = '<Image>';
+
+
+
230
+
exports.description = 'Base component for displaying different types of images.';
+
+
+
231
+
+
+
+
232
+
exports.examples = [
+
+
+
233
+
{
+
+
+
234
+
title: 'Plain Network Image',
+
+
+
235
+
description: 'If the `source` prop `uri` property is prefixed with ' +
+
+
+
236
+
'"http", then it will be downloaded from the network.',
+
+
+
237
+
render: function() {
+
+
+
238
+
return (
+
+
+
239
+
<Image
+
+
+
+ +
+ +
+
+ +
+ + @gusgard + +
Dec 7, 2017
+
+
+
+ +
+ + + +
+ +
+
+
240
+
source={fullImage}
+
+
+
+ +
+ + + +
+
+ +
+
+
241
+
style={styles.base}
+
+
+
242
+
/>
+
+
+
243
+
);
+
+
+
244
+
},
+
+
+
245
+
},
+
+
+
246
+
{
+
+
+
247
+
title: 'Plain Static Image',
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
248
+
description: 'Static assets should be placed in the source code tree, and ' +
+
+
+
249
+
'required in the same way as JavaScript modules.',
+
+
+
+ +
+ + + +
+
+ +
+
+
250
+
render: function() {
+
+
+
251
+
return (
+
+
+
252
+
<View style={styles.horizontal}>
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
253
+
<Image source={require('./uie_thumb_normal.png')} style={styles.icon} />
+
+
+
254
+
<Image source={require('./uie_thumb_selected.png')} style={styles.icon} />
+
+
+
255
+
<Image source={require('./uie_comment_normal.png')} style={styles.icon} />
+
+
+
256
+
<Image source={require('./uie_comment_highlighted.png')} style={styles.icon} />
+
+
+
+ +
+ + + +
+
+ +
+
+
257
+
</View>
+
+
+
258
+
);
+
+
+
259
+
},
+
+
+
260
+
},
+
+
+
+ +
+ +
+
+ +
+ + @brentvatne + +
Nov 26, 2015
+
+
+
+ +
+ + + +
+ +
+
+
261
+
{
+
+
+
262
+
title: 'Image Loading Events',
+
+
+
263
+
render: function() {
+
+
+
264
+
return (
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
265
+
<NetworkImageCallbackExample source={{uri: 'http://origami.design/public/images/bird-logo.png?r=1&t=' + Date.now()}}
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
266
+
prefetchedSource={{uri: IMAGE_PREFETCH_URL}}/>
+
+
+
+ +
+ +
+
+ +
+ + @brentvatne + +
Nov 26, 2015
+
+
+
+ +
+ + + +
+ +
+
+
267
+
);
+
+
+
268
+
},
+
+
+
269
+
},
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
270
+
{
+
+
+
271
+
title: 'Error Handler',
+
+
+
272
+
render: function() {
+
+
+
273
+
return (
+
+
+
+ +
+ +
+
+ +
+ + @gusgard + +
Oct 4, 2017
+
+
+
+ +
+ + + +
+ +
+
+
274
+
<NetworkImageExample source={{uri: 'https://TYPO_ERROR_facebook.github.io/react/logo-og.png'}} />
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
275
+
);
+
+
+
276
+
},
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
277
+
platform: 'ios',
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
278
+
},
+
+
+
279
+
{
+
+
+
280
+
title: 'Image Download Progress',
+
+
+
281
+
render: function() {
+
+
+
282
+
return (
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
283
+
<NetworkImageExample source={{uri: 'http://origami.design/public/images/bird-logo.png?r=1'}}/>
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
284
+
);
+
+
+
285
+
},
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
286
+
platform: 'ios',
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
287
+
},
+
+
+
+ +
+ +
+
+ +
+ + @brentvatne + +
Feb 1, 2016
+
+
+
+ +
+ + + +
+ +
+
+
288
+
{
+
+
+
289
+
title: 'defaultSource',
+
+
+
290
+
description: 'Show a placeholder image when a network image is loading',
+
+
+
291
+
render: function() {
+
+
+
292
+
return (
+
+
+
293
+
<Image
+
+
+
294
+
defaultSource={require('./bunny.png')}
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
295
+
source={{uri: 'https://facebook.github.io/origami/public/images/birds.jpg'}}
+
+
+
+ +
+ +
+
+ +
+ + @brentvatne + +
Feb 1, 2016
+
+
+
+ +
+ + + +
+ +
+
+
296
+
style={styles.base}
+
+
+
297
+
/>
+
+
+
298
+
);
+
+
+
299
+
},
+
+
+
300
+
platform: 'ios',
+
+
+
301
+
},
+
+
+
+ +
+ +
+
+ +
+ + @salanki + +
Jan 18, 2017
+
+
+
+ +
+ + + +
+ +
+
+
302
+
{
+
+
+
303
+
title: 'Cache Policy',
+
+
+
304
+
description: 'First image has never been loaded before and is instructed not to load unless in cache.' +
+
+
+
305
+
'Placeholder image from above will stay. Second image is the same but forced to load regardless of' +
+
+
+
306
+
' local cache state.',
+
+
+
307
+
render: function () {
+
+
+
308
+
return (
+
+
+
309
+
<View style={styles.horizontal}>
+
+
+
310
+
<Image
+
+
+
311
+
defaultSource={require('./bunny.png')}
+
+
+
312
+
source={{
+
+
+
313
+
uri: smallImage.uri + '?cacheBust=notinCache' + Date.now(),
+
+
+
314
+
cache: 'only-if-cached'
+
+
+
315
+
}}
+
+
+
316
+
style={styles.base}
+
+
+
317
+
/>
+
+
+
318
+
<Image
+
+
+
319
+
defaultSource={require('./bunny.png')}
+
+
+
320
+
source={{
+
+
+
321
+
uri: smallImage.uri + '?cacheBust=notinCache' + Date.now(),
+
+
+
322
+
cache: 'reload'
+
+
+
323
+
}}
+
+
+
324
+
style={styles.base}
+
+
+
325
+
/>
+
+
+
326
+
</View>
+
+
+
327
+
);
+
+
+
328
+
},
+
+
+
329
+
platform: 'ios',
+
+
+
330
+
},
+
+
+
+ +
+ + + +
+
+ +
+
+
331
+
{
+
+
+
332
+
title: 'Border Color',
+
+
+
333
+
render: function() {
+
+
+
334
+
return (
+
+
+
335
+
<View style={styles.horizontal}>
+
+
+
336
+
<Image
+
+
+
337
+
source={smallImage}
+
+
+
338
+
style={[
+
+
+
339
+
styles.base,
+
+
+
340
+
styles.background,
+
+
+
341
+
{borderWidth: 3, borderColor: '#f099f0'}
+
+
+
342
+
]}
+
+
+
343
+
/>
+
+
+
344
+
</View>
+
+
+
345
+
);
+
+
+
346
+
},
+
+
+
347
+
},
+
+
+
348
+
{
+
+
+
349
+
title: 'Border Width',
+
+
+
350
+
render: function() {
+
+
+
351
+
return (
+
+
+
352
+
<View style={styles.horizontal}>
+
+
+
353
+
<Image
+
+
+
354
+
source={smallImage}
+
+
+
355
+
style={[
+
+
+
356
+
styles.base,
+
+
+
357
+
styles.background,
+
+
+
358
+
{borderWidth: 5, borderColor: '#f099f0'}
+
+
+
359
+
]}
+
+
+
360
+
/>
+
+
+
361
+
</View>
+
+
+
362
+
);
+
+
+
363
+
},
+
+
+
364
+
},
+
+
+
365
+
{
+
+
+
366
+
title: 'Border Radius',
+
+
+
367
+
render: function() {
+
+
+
368
+
return (
+
+
+
369
+
<View style={styles.horizontal}>
+
+
+
370
+
<Image
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
371
+
style={[styles.base, {borderRadius: 5}]}
+
+
+
372
+
source={fullImage}
+
+
+
+ +
+ + + +
+
+ +
+
+
373
+
/>
+
+
+
374
+
<Image
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
375
+
style={[styles.base, styles.leftMargin, {borderRadius: 19}]}
+
+
+
376
+
source={fullImage}
+
+
+
+ +
+ + + +
+
+ +
+
+
377
+
/>
+
+
+
378
+
</View>
+
+
+
379
+
);
+
+
+
380
+
},
+
+
+
381
+
},
+
+
+
382
+
{
+
+
+
383
+
title: 'Background Color',
+
+
+
384
+
render: function() {
+
+
+
385
+
return (
+
+
+
386
+
<View style={styles.horizontal}>
+
+
+
387
+
<Image source={smallImage} style={styles.base} />
+
+
+
388
+
<Image
+
+
+
389
+
style={[
+
+
+
390
+
styles.base,
+
+
+
391
+
styles.leftMargin,
+
+
+
392
+
{backgroundColor: 'rgba(0, 0, 100, 0.25)'}
+
+
+
393
+
]}
+
+
+
394
+
source={smallImage}
+
+
+
395
+
/>
+
+
+
396
+
<Image
+
+
+
397
+
style={[styles.base, styles.leftMargin, {backgroundColor: 'red'}]}
+
+
+
398
+
source={smallImage}
+
+
+
399
+
/>
+
+
+
400
+
<Image
+
+
+
401
+
style={[styles.base, styles.leftMargin, {backgroundColor: 'black'}]}
+
+
+
402
+
source={smallImage}
+
+
+
403
+
/>
+
+
+
404
+
</View>
+
+
+
405
+
);
+
+
+
406
+
},
+
+
+
407
+
},
+
+
+
408
+
{
+
+
+
409
+
title: 'Opacity',
+
+
+
410
+
render: function() {
+
+
+
411
+
return (
+
+
+
412
+
<View style={styles.horizontal}>
+
+
+
413
+
<Image
+
+
+
414
+
style={[styles.base, {opacity: 1}]}
+
+
+
415
+
source={fullImage}
+
+
+
416
+
/>
+
+
+
417
+
<Image
+
+
+
418
+
style={[styles.base, styles.leftMargin, {opacity: 0.8}]}
+
+
+
419
+
source={fullImage}
+
+
+
420
+
/>
+
+
+
421
+
<Image
+
+
+
422
+
style={[styles.base, styles.leftMargin, {opacity: 0.6}]}
+
+
+
423
+
source={fullImage}
+
+
+
424
+
/>
+
+
+
425
+
<Image
+
+
+
426
+
style={[styles.base, styles.leftMargin, {opacity: 0.4}]}
+
+
+
427
+
source={fullImage}
+
+
+
428
+
/>
+
+
+
429
+
<Image
+
+
+
430
+
style={[styles.base, styles.leftMargin, {opacity: 0.2}]}
+
+
+
431
+
source={fullImage}
+
+
+
432
+
/>
+
+
+
433
+
<Image
+
+
+
434
+
style={[styles.base, styles.leftMargin, {opacity: 0}]}
+
+
+
435
+
source={fullImage}
+
+
+
436
+
/>
+
+
+
437
+
</View>
+
+
+
438
+
);
+
+
+
439
+
},
+
+
+
440
+
},
+
+
+
441
+
{
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
442
+
title: 'Nesting content inside <Image> component',
+
+
+
443
+
render: function() {
+
+
+
444
+
return (
+
+
+
445
+
<View style={{width: 60, height: 60}}>
+
+
+
446
+
<Image
+
+
+
447
+
style={{...StyleSheet.absoluteFillObject}}
+
+
+
448
+
source={fullImage}/>
+
+
+
449
+
<Text style={styles.nestedText}>
+
+
+
450
+
React
+
+
+
451
+
</Text>
+
+
+
452
+
</View>
+
+
+
453
+
);
+
+
+
454
+
},
+
+
+
455
+
},
+
+
+
456
+
{
+
+
+
457
+
title: 'Nesting content inside <ImageBackground> component',
+
+
+
+ +
+ + + +
+
+ +
+
+
458
+
render: function() {
+
+
+
459
+
return (
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
460
+
<ImageBackground
+
+
+
+ +
+ + + +
+
+ +
+
+
461
+
style={{width: 60, height: 60, backgroundColor: 'transparent'}}
+
+
+
462
+
source={fullImage}>
+
+
+
463
+
<Text style={styles.nestedText}>
+
+
+
464
+
React
+
+
+
465
+
</Text>
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
466
+
</ImageBackground>
+
+
+
+ +
+ + + +
+
+ +
+
+
467
+
);
+
+
+
468
+
},
+
+
+
469
+
},
+
+
+
470
+
{
+
+
+
471
+
title: 'Tint Color',
+
+
+
472
+
description: 'The `tintColor` style prop changes all the non-alpha ' +
+
+
+
473
+
'pixels to the tint color.',
+
+
+
474
+
render: function() {
+
+
+
475
+
return (
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
476
+
<View>
+
+
+
477
+
<View style={styles.horizontal}>
+
+
+
478
+
<Image
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
479
+
source={require('./uie_thumb_normal.png')}
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
480
+
style={[styles.icon, {borderRadius: 5, tintColor: '#5ac8fa' }]}
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
481
+
/>
+
+
+
482
+
<Image
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
483
+
source={require('./uie_thumb_normal.png')}
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
484
+
style={[styles.icon, styles.leftMargin, {borderRadius: 5, tintColor: '#4cd964' }]}
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
485
+
/>
+
+
+
486
+
<Image
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
487
+
source={require('./uie_thumb_normal.png')}
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
488
+
style={[styles.icon, styles.leftMargin, {borderRadius: 5, tintColor: '#ff2d55' }]}
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
489
+
/>
+
+
+
490
+
<Image
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
491
+
source={require('./uie_thumb_normal.png')}
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
492
+
style={[styles.icon, styles.leftMargin, {borderRadius: 5, tintColor: '#8e8e93' }]}
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
493
+
/>
+
+
+
494
+
</View>
+
+
+
495
+
<Text style={styles.sectionText}>
+
+
+
496
+
It also works with downloaded images:
+
+
+
497
+
</Text>
+
+
+
498
+
<View style={styles.horizontal}>
+
+
+
499
+
<Image
+
+
+
500
+
source={smallImage}
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
501
+
style={[styles.base, {borderRadius: 5, tintColor: '#5ac8fa' }]}
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
502
+
/>
+
+
+
503
+
<Image
+
+
+
504
+
source={smallImage}
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
505
+
style={[styles.base, styles.leftMargin, {borderRadius: 5, tintColor: '#4cd964' }]}
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
506
+
/>
+
+
+
507
+
<Image
+
+
+
508
+
source={smallImage}
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
509
+
style={[styles.base, styles.leftMargin, {borderRadius: 5, tintColor: '#ff2d55' }]}
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
510
+
/>
+
+
+
511
+
<Image
+
+
+
512
+
source={smallImage}
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
513
+
style={[styles.base, styles.leftMargin, {borderRadius: 5, tintColor: '#8e8e93' }]}
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
514
+
/>
+
+
+
515
+
</View>
+
+
+
+ +
+ + + +
+
+ +
+
+
516
+
</View>
+
+
+
517
+
);
+
+
+
518
+
},
+
+
+
519
+
},
+
+
+
520
+
{
+
+
+
521
+
title: 'Resize Mode',
+
+
+
522
+
description: 'The `resizeMode` style prop controls how the image is ' +
+
+
+
523
+
'rendered within the frame.',
+
+
+
524
+
render: function() {
+
+
+
525
+
return (
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
526
+
<View>
+
+
+
527
+
{[smallImage, fullImage].map((image, index) => {
+
+
+
+ +
+ +
+
+ +
+ + @alonsch + +
Mar 19, 2016
+
+
+
+ +
+ + + +
+ +
+
+
528
+
return (
+
+
+
529
+
<View key={index}>
+
+
+
530
+
<View style={styles.horizontal}>
+
+
+
531
+
<View>
+
+
+
532
+
<Text style={[styles.resizeModeText]}>
+
+
+
533
+
Contain
+
+
+
534
+
</Text>
+
+
+
535
+
<Image
+
+
+
536
+
style={styles.resizeMode}
+
+
+
537
+
resizeMode={Image.resizeMode.contain}
+
+
+
538
+
source={image}
+
+
+
539
+
/>
+
+
+
540
+
</View>
+
+
+
541
+
<View style={styles.leftMargin}>
+
+
+
542
+
<Text style={[styles.resizeModeText]}>
+
+
+
543
+
Cover
+
+
+
544
+
</Text>
+
+
+
545
+
<Image
+
+
+
546
+
style={styles.resizeMode}
+
+
+
547
+
resizeMode={Image.resizeMode.cover}
+
+
+
548
+
source={image}
+
+
+
549
+
/>
+
+
+
550
+
</View>
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
551
+
</View>
+
+
+
+ +
+ +
+
+ +
+ + @alonsch + +
Mar 19, 2016
+
+
+
+ +
+ + + +
+ +
+
+
552
+
<View style={styles.horizontal}>
+
+
+
553
+
<View>
+
+
+
554
+
<Text style={[styles.resizeModeText]}>
+
+
+
555
+
Stretch
+
+
+
556
+
</Text>
+
+
+
557
+
<Image
+
+
+
558
+
style={styles.resizeMode}
+
+
+
559
+
resizeMode={Image.resizeMode.stretch}
+
+
+
560
+
source={image}
+
+
+
561
+
/>
+
+
+
562
+
</View>
+
+
+
+ +
+ +
+
+ +
+ + @janicduplessis + +
Jun 22, 2016
+
+
+
+ +
+ + + +
+ +
+
+
563
+
{ Platform.OS === 'ios' ?
+
+
+
564
+
<View style={styles.leftMargin}>
+
+
+
565
+
<Text style={[styles.resizeModeText]}>
+
+
+
566
+
Repeat
+
+
+
567
+
</Text>
+
+
+
568
+
<Image
+
+
+
569
+
style={styles.resizeMode}
+
+
+
570
+
resizeMode={Image.resizeMode.repeat}
+
+
+
571
+
source={image}
+
+
+
572
+
/>
+
+
+
573
+
</View>
+
+
+
574
+
: null }
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
575
+
<View style={styles.leftMargin}>
+
+
+
576
+
<Text style={[styles.resizeModeText]}>
+
+
+
577
+
Center
+
+
+
578
+
</Text>
+
+
+
579
+
<Image
+
+
+
580
+
style={styles.resizeMode}
+
+
+
581
+
resizeMode={Image.resizeMode.center}
+
+
+
582
+
source={image}
+
+
+
583
+
/>
+
+
+
584
+
</View>
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
585
+
</View>
+
+
+
586
+
</View>
+
+
+
+ +
+ +
+
+ +
+ + @alonsch + +
Mar 19, 2016
+
+
+
+ +
+ + + +
+ +
+
+
587
+
);
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
588
+
})}
+
+
+
+ +
+ + + +
+
+ +
+
+
589
+
</View>
+
+
+
590
+
);
+
+
+
591
+
},
+
+
+
592
+
},
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
593
+
{
+
+
+
594
+
title: 'Animated GIF',
+
+
+
595
+
render: function() {
+
+
+
596
+
return (
+
+
+
597
+
<Image
+
+
+
598
+
style={styles.gif}
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
599
+
source={{uri: 'https://38.media.tumblr.com/9e9bd08c6e2d10561dd1fb4197df4c4e/tumblr_mfqekpMktw1rn90umo1_500.gif'}}
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
600
+
/>
+
+
+
601
+
);
+
+
+
602
+
},
+
+
+
603
+
platform: 'ios',
+
+
+
604
+
},
+
+
+
+ +
+ +
+
+ +
+ + @nicklockwood + +
Oct 19, 2015
+
+
+
+ +
+ + + +
+ +
+
+
605
+
{
+
+
+
606
+
title: 'Base64 image',
+
+
+
607
+
render: function() {
+
+
+
608
+
return (
+
+
+
609
+
<Image
+
+
+
610
+
style={styles.base64}
+
+
+
611
+
source={{uri: base64Icon, scale: 3}}
+
+
+
612
+
/>
+
+
+
613
+
);
+
+
+
614
+
},
+
+
+
615
+
platform: 'ios',
+
+
+
616
+
},
+
+
+
+ +
+ + + +
+
+ +
+
+
617
+
{
+
+
+
618
+
title: 'Cap Insets',
+
+
+
619
+
description:
+
+
+
620
+
'When the image is resized, the corners of the size specified ' +
+
+
+
621
+
'by capInsets will stay a fixed size, but the center content and ' +
+
+
+
622
+
'borders of the image will be stretched. This is useful for creating ' +
+
+
+
623
+
'resizable rounded buttons, shadows, and other resizable assets.',
+
+
+
624
+
render: function() {
+
+
+
625
+
return <ImageCapInsetsExample />;
+
+
+
626
+
},
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
627
+
platform: 'ios',
+
+
+
+ +
+ + + +
+
+ +
+
+
628
+
},
+
+
+
+ +
+ +
+
+ +
+ + @nicklockwood + +
Jan 1, 2016
+
+
+
+ +
+ + + +
+ +
+
+
629
+
{
+
+
+
630
+
title: 'Image Size',
+
+
+
631
+
render: function() {
+
+
+
+ +
+ +
+
+ +
+ + @alonsch + +
Mar 19, 2016
+
+
+
+ +
+ + + +
+ +
+
+
632
+
return <ImageSizeExample source={fullImage} />;
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
633
+
},
+
+
+
+ +
+ +
+
+ +
+ + @nicklockwood + +
Jan 1, 2016
+
+
+
+ +
+ + + +
+ +
+
+
634
+
},
+
+
+
+ +
+ +
+
+ +
+ + @andreicoman11 + +
Jun 13, 2016
+
+
+
+ +
+ + + +
+ +
+
+
635
+
{
+
+
+
636
+
title: 'MultipleSourcesExample',
+
+
+
637
+
description:
+
+
+
638
+
'The `source` prop allows passing in an array of uris, so that native to choose which image ' +
+
+
+
639
+
'to diplay based on the size of the of the target image',
+
+
+
640
+
render: function() {
+
+
+
641
+
return <MultipleSourcesExample />;
+
+
+
642
+
},
+
+
+
643
+
},
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
644
+
{
+
+
+
645
+
title: 'Legacy local image',
+
+
+
646
+
description:
+
+
+
647
+
'Images shipped with the native bundle, but not managed ' +
+
+
+
648
+
'by the JS packager',
+
+
+
649
+
render: function() {
+
+
+
650
+
return (
+
+
+
651
+
<Image
+
+
+
+ +
+ +
+
+ +
+ + @frantic + +
Nov 23, 2016
+
+
+
+ +
+ + + +
+ +
+
+
652
+
source={{uri: 'legacy_image', width: 120, height: 120}}
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
653
+
/>
+
+
+
654
+
);
+
+
+
655
+
},
+
+
+
656
+
},
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
657
+
{
+
+
+
658
+
title: 'Bundled images',
+
+
+
659
+
description:
+
+
+
660
+
'Images shipped in a separate native bundle',
+
+
+
661
+
render: function() {
+
+
+
662
+
return (
+
+
+
663
+
<View style={{flexDirection: 'row'}}>
+
+
+
664
+
<Image
+
+
+
665
+
source={{
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
666
+
uri: 'ImageInBundle',
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
667
+
bundle: 'RNTesterBundle',
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
668
+
width: 100,
+
+
+
669
+
height: 100,
+
+
+
670
+
}}
+
+
+
671
+
style={{borderColor: 'yellow', borderWidth: 4}}
+
+
+
672
+
/>
+
+
+
673
+
<Image
+
+
+
674
+
source={{
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
675
+
uri: 'ImageInAssetCatalog',
+
+
+
+ +
+ + + +
+ + + +
+ +
+
+
676
+
bundle: 'RNTesterBundle',
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
677
+
width: 100,
+
+
+
678
+
height: 100,
+
+
+
679
+
}}
+
+
+
680
+
style={{marginLeft: 10, borderColor: 'blue', borderWidth: 4}}
+
+
+
681
+
/>
+
+
+
682
+
</View>
+
+
+
683
+
);
+
+
+
684
+
},
+
+
+
+ +
+ +
+
+ +
+ + @andreicoman11 + +
Sep 29, 2016
+
+
+
+ +
+ + + +
+ +
+
+
685
+
platform: 'ios',
+
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
686
+
},
+
+
+
+ +
+ +
+
+ +
+ + + +
Mar 2, 2017
+
+
+
+ +
+ + + +
+ +
+
+
687
+
{
+
+
+
688
+
title: 'Blur Radius',
+
+
+
689
+
render: function() {
+
+
+
690
+
return (
+
+
+
691
+
<View style={styles.horizontal}>
+
+
+
692
+
<Image
+
+
+
693
+
style={[styles.base,]}
+
+
+
694
+
source={fullImage}
+
+
+
695
+
blurRadius={0}
+
+
+
696
+
/>
+
+
+
697
+
<Image
+
+
+
698
+
style={[styles.base, styles.leftMargin]}
+
+
+
699
+
source={fullImage}
+
+
+
700
+
blurRadius={5}
+
+
+
701
+
/>
+
+
+
702
+
<Image
+
+
+
703
+
style={[styles.base, styles.leftMargin]}
+
+
+
704
+
source={fullImage}
+
+
+
705
+
blurRadius={10}
+
+
+
706
+
/>
+
+
+
707
+
<Image
+
+
+
708
+
style={[styles.base, styles.leftMargin]}
+
+
+
709
+
source={fullImage}
+
+
+
710
+
blurRadius={15}
+
+
+
711
+
/>
+
+
+
712
+
<Image
+
+
+
713
+
style={[styles.base, styles.leftMargin]}
+
+
+
714
+
source={fullImage}
+
+
+
715
+
blurRadius={20}
+
+
+
716
+
/>
+
+
+
717
+
<Image
+
+
+
718
+
style={[styles.base, styles.leftMargin]}
+
+
+
719
+
source={fullImage}
+
+
+
720
+
blurRadius={25}
+
+
+
721
+
/>
+
+
+
722
+
</View>
+
+
+
723
+
);
+
+
+
724
+
},
+
+
+
725
+
},
+
+
+
+ +
+ + + +
+
+ +
+
+
726
+
];
+
+
+
727
+
+
+
+
+ +
+ +
+
+ +
+ + @gusgard + +
Dec 7, 2017
+
+
+
+ +
+ + + +
+ +
+
+
728
+
var fullImage = {uri: 'https://facebook.github.io/react-native/img/opengraph.png'};
+
+
+
729
+
var smallImage = {uri: 'https://facebook.github.io/react-native/img/favicon.png'};
+
+
+
+ +
+ + + +
+
+ +
+
+
730
+
+
+
+
731
+
var styles = StyleSheet.create({
+
+
+
732
+
base: {
+
+
+
733
+
width: 38,
+
+
+
734
+
height: 38,
+
+
+
735
+
},
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
736
+
progress: {
+
+
+
737
+
flex: 1,
+
+
+
738
+
alignItems: 'center',
+
+
+
739
+
flexDirection: 'row',
+
+
+
740
+
width: 100
+
+
+
741
+
},
+
+
+
+ +
+ + + +
+
+ +
+
+
742
+
leftMargin: {
+
+
+
743
+
marginLeft: 10,
+
+
+
744
+
},
+
+
+
745
+
background: {
+
+
+
746
+
backgroundColor: '#222222'
+
+
+
747
+
},
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
748
+
sectionText: {
+
+
+
749
+
marginVertical: 6,
+
+
+
750
+
},
+
+
+
+ +
+ + + +
+
+ +
+
+
751
+
nestedText: {
+
+
+
752
+
marginLeft: 12,
+
+
+
753
+
marginTop: 20,
+
+
+
754
+
backgroundColor: 'transparent',
+
+
+
755
+
color: 'white'
+
+
+
756
+
},
+
+
+
757
+
resizeMode: {
+
+
+
758
+
width: 90,
+
+
+
759
+
height: 60,
+
+
+
760
+
borderWidth: 0.5,
+
+
+
761
+
borderColor: 'black'
+
+
+
762
+
},
+
+
+
763
+
resizeModeText: {
+
+
+
764
+
fontSize: 11,
+
+
+
765
+
marginBottom: 3,
+
+
+
766
+
},
+
+
+
767
+
icon: {
+
+
+
768
+
width: 15,
+
+
+
769
+
height: 15,
+
+
+
770
+
},
+
+
+
771
+
horizontal: {
+
+
+
772
+
flexDirection: 'row',
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+
+
773
+
},
+
+
+
774
+
gif: {
+
+
+
775
+
flex: 1,
+
+
+
776
+
height: 200,
+
+
+
777
+
},
+
+
+
+ +
+ +
+
+ +
+ + @nicklockwood + +
Oct 19, 2015
+
+
+
+ +
+ + + +
+ +
+
+
778
+
base64: {
+
+
+
779
+
flex: 1,
+
+
+
780
+
height: 50,
+
+
+
781
+
resizeMode: 'contain',
+
+
+
782
+
},
+
+
+
+ +
+ +
+
+ +
+ + @andreicoman11 + +
Jun 13, 2016
+
+
+
+ +
+ + + +
+ +
+
+
783
+
touchableText: {
+
+
+
784
+
fontWeight: '500',
+
+
+
785
+
color: 'blue',
+
+
+
786
+
},
+
+
+
+ +
+ + + +
+
+ +
+
+
787
+
});
+
+
+
+
+
+ +
+ + +
+ +
+ +
+
+ +
+ + + + + + +
+ + + You can't perform that action at this time. +
+ + + + + + + + + + +
+ + You signed in with another tab or window. Reload to refresh your session. + You signed out in another tab or window. Reload to refresh your session. +
+ + + + + + + diff --git a/cache/https---github.com-facebook-react-native-pull-17759.diff b/cache/https---github.com-facebook-react-native-pull-17759.diff new file mode 100644 index 0000000..2fafaac --- /dev/null +++ b/cache/https---github.com-facebook-react-native-pull-17759.diff @@ -0,0 +1,48 @@ +diff --git a/Libraries/Image/Image.ios.js b/Libraries/Image/Image.ios.js +index fd99b986b88..f8ae5a17211 100644 +--- a/Libraries/Image/Image.ios.js ++++ b/Libraries/Image/Image.ios.js +@@ -241,6 +241,10 @@ const Image = createReactClass({ + * + * - `repeat`: Repeat the image to cover the frame of the view. The + * image will keep it's size and aspect ratio. (iOS only) ++ * ++ * - 'center': Scale the image down so that it is completely visible, ++ * if bigger than the area of the view. ++ * The image will not be scaled up. + */ + resizeMode: PropTypes.oneOf([ + 'cover', +diff --git a/RNTester/js/ImageExample.js b/RNTester/js/ImageExample.js +index 6e677890404..7577b5b349c 100644 +--- a/RNTester/js/ImageExample.js ++++ b/RNTester/js/ImageExample.js +@@ -572,18 +572,16 @@ exports.examples = [ + /> + + : null } +- { Platform.OS === 'android' ? +- +- +- Center +- +- +- +- : null } ++ ++ ++ Center ++ ++ ++ + + + ); diff --git a/mention-bot.js b/mention-bot.js index dbe7167..8d691ad 100644 --- a/mention-bot.js +++ b/mention-bot.js @@ -138,7 +138,7 @@ function parseBlame(blame: string): Array { // The way the document is structured is that commits and lines are // interleaved. So every time we see a commit we grab the author's name // and every time we see a line we log the last seen author. - var re = /(