Skip to content

Commit

Permalink
Deprecate PullToRefreshViewAndroid and remove it from the website
Browse files Browse the repository at this point in the history
Summary:I forgot to add a deprecation warning to PullToRefreshViewAndroid when I worked on RefreshControl. This adds one as well as remove it from the website and remove the UIExplorer example. Now that we have versioned doc I think it is fine to remove deprecated stuff from the website so it is easier for users to know what component they should use. Last thing, I enabled flow in RefreshControl and fixed the one warning.
Closes #6055

Differential Revision: D2959502

Pulled By: mkonicek

fb-gh-sync-id: 9b23f84ea35c770bfe2a83d0fd3ec7e439669c33
shipit-source-id: 9b23f84ea35c770bfe2a83d0fd3ec7e439669c33
  • Loading branch information
janicduplessis authored and facebook-github-bot-2 committed Feb 22, 2016
1 parent 89ea985 commit 91788d2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 134 deletions.
128 changes: 0 additions & 128 deletions Examples/UIExplorer/PullToRefreshViewAndroidExample.android.js

This file was deleted.

1 change: 0 additions & 1 deletion Examples/UIExplorer/UIExplorerList.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ var COMPONENTS = [
require('./ListViewExample'),
require('./PickerAndroidExample'),
require('./ProgressBarAndroidExample'),
require('./PullToRefreshViewAndroidExample.android'),
require('./RefreshControlExample'),
require('./ScrollViewSimpleExample'),
require('./StatusBarExample'),
Expand Down
7 changes: 4 additions & 3 deletions Libraries/Components/RefreshControl/RefreshControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule RefreshControl
* @flow
*/
'use strict';

Expand All @@ -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: {}};
}

/**
Expand Down
8 changes: 7 additions & 1 deletion Libraries/PullToRefresh/PullToRefreshViewAndroid.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`).
*/
Expand Down Expand Up @@ -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];
},
Expand Down
1 change: 0 additions & 1 deletion website/server/extractDocs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 91788d2

Please sign in to comment.