diff --git a/Examples/UIExplorer/PullToRefreshViewAndroidExample.android.js b/Examples/UIExplorer/PullToRefreshViewAndroidExample.android.js
deleted file mode 100644
index 3d22f7608..000000000
--- a/Examples/UIExplorer/PullToRefreshViewAndroidExample.android.js
+++ /dev/null
@@ -1,128 +0,0 @@
-/**
-* The examples provided by Facebook are for non-commercial testing and
-* evaluation purposes only.
-*
-* Facebook reserves all rights not expressly granted.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
-* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*
-*/
-'use strict';
-
-const React = require('react-native');
-const {
- ScrollView,
- StyleSheet,
- PullToRefreshViewAndroid,
- Text,
- TouchableWithoutFeedback,
- View,
-} = React;
-
-const styles = StyleSheet.create({
- row: {
- borderColor: 'grey',
- borderWidth: 1,
- padding: 20,
- backgroundColor: '#3a5795',
- margin: 5,
- },
- text: {
- alignSelf: 'center',
- color: '#fff',
-
- },
- layout: {
- flex: 1,
- },
- scrollview: {
- flex: 1,
- },
-});
-
-const Row = React.createClass({
- _onClick: function() {
- this.props.onClick(this.props.data);
- },
- render: function() {
- return (
-
-
-
- {this.props.data.text + ' (' + this.props.data.clicks + ' clicks)'}
-
-
-
- );
- },
-});
-const PullToRefreshViewAndroidExample = React.createClass({
- statics: {
- title: '',
- description: 'Container that adds pull-to-refresh support to its child view.'
- },
-
- getInitialState() {
- return {
- isRefreshing: false,
- loaded: 0,
- rowData: Array.from(new Array(20)).map(
- (val, i) => ({text: 'Initial row' + i, clicks: 0})
- ),
- };
- },
-
- _onClick(row) {
- row.clicks++;
- this.setState({
- rowData: this.state.rowData,
- });
- },
-
- render() {
- const rows = this.state.rowData.map((row, ii) => {
- return ;
- });
- return (
-
-
- {rows}
-
-
- );
- },
-
- _onRefresh() {
- this.setState({isRefreshing: true});
- setTimeout(() => {
- // prepend 10 items
- const rowData = Array.from(new Array(10))
- .map((val, i) => ({
- text: 'Loaded row' + (+this.state.loaded + i),
- clicks: 0,
- }))
- .concat(this.state.rowData);
-
- this.setState({
- loaded: this.state.loaded + 10,
- isRefreshing: false,
- rowData: rowData,
- });
- }, 5000);
- },
-
-});
-
-
-module.exports = PullToRefreshViewAndroidExample;
diff --git a/Examples/UIExplorer/UIExplorerList.android.js b/Examples/UIExplorer/UIExplorerList.android.js
index 8959a0919..4cd5649d7 100644
--- a/Examples/UIExplorer/UIExplorerList.android.js
+++ b/Examples/UIExplorer/UIExplorerList.android.js
@@ -27,7 +27,6 @@ var COMPONENTS = [
require('./ListViewExample'),
require('./PickerAndroidExample'),
require('./ProgressBarAndroidExample'),
- require('./PullToRefreshViewAndroidExample.android'),
require('./RefreshControlExample'),
require('./ScrollViewSimpleExample'),
require('./StatusBarExample'),
diff --git a/Libraries/Components/RefreshControl/RefreshControl.js b/Libraries/Components/RefreshControl/RefreshControl.js
index 1ae8119a1..ee285a3c7 100644
--- a/Libraries/Components/RefreshControl/RefreshControl.js
+++ b/Libraries/Components/RefreshControl/RefreshControl.js
@@ -7,6 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule RefreshControl
+ * @flow
*/
'use strict';
@@ -17,10 +18,10 @@ const View = require('View');
const requireNativeComponent = require('requireNativeComponent');
-if (Platform.OS === 'ios') {
- var RefreshLayoutConsts = {SIZE: {}};
-} else if (Platform.OS === 'android') {
+if (Platform.OS === 'android') {
var RefreshLayoutConsts = require('NativeModules').UIManager.AndroidSwipeRefreshLayout.Constants;
+} else {
+ var RefreshLayoutConsts = {SIZE: {}};
}
/**
diff --git a/Libraries/PullToRefresh/PullToRefreshViewAndroid.android.js b/Libraries/PullToRefresh/PullToRefreshViewAndroid.android.js
index c0f498ba2..e784052c3 100644
--- a/Libraries/PullToRefresh/PullToRefreshViewAndroid.android.js
+++ b/Libraries/PullToRefresh/PullToRefreshViewAndroid.android.js
@@ -21,9 +21,11 @@ var requireNativeComponent = require('requireNativeComponent');
var NATIVE_REF = 'native_swiperefreshlayout';
/**
+ * Deprecated. Use `RefreshControl` instead.
+ *
* React view that supports a single scrollable child view (e.g. `ScrollView`). When this child
* view is at `scrollY: 0`, swiping down triggers an `onRefresh` event.
- *
+ *
* The style `{flex: 1}` might be required to ensure the expected behavior of the child component
* (e.g. when the child is expected to scroll with `ScrollView` or `ListView`).
*/
@@ -56,6 +58,10 @@ var PullToRefreshViewAndroid = React.createClass({
size: React.PropTypes.oneOf(RefreshLayoutConsts.SIZE.DEFAULT, RefreshLayoutConsts.SIZE.LARGE),
},
+ componentDidMount: function() {
+ console.warn('`PullToRefreshViewAndroid` is deprecated. Use `RefreshControl` instead.');
+ },
+
getInnerViewNode: function() {
return this.refs[NATIVE_REF];
},
diff --git a/website/server/extractDocs.js b/website/server/extractDocs.js
index 8fd099231..b74c029b7 100644
--- a/website/server/extractDocs.js
+++ b/website/server/extractDocs.js
@@ -203,7 +203,6 @@ var components = [
'../Libraries/Components/Picker/Picker.js',
'../Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js',
'../Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js',
- '../Libraries/PullToRefresh/PullToRefreshViewAndroid.android.js',
'../Libraries/Components/RefreshControl/RefreshControl.js',
'../Libraries/Components/ScrollView/ScrollView.js',
'../Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js',