Allow customized refreshControl in ScrollView for Android

Summary:
Original Android's refreshControl in ScrollView is tightly coupled with AndroidSwipeRefreshLayout. If someone use `ref=` for RefreshControl in ScrollView, it does nothing since RefreshControl in Android return null.

This change allows customized  RefreshControl especially for `ref=` as well as making ScrollView's code clearer.
Closes https://github.com/facebook/react-native/pull/5623

Reviewed By: svcscm

Differential Revision: D2890072

Pulled By: nicklockwood

fb-gh-sync-id: a8fc7746bcc050a6e46fedf3583979f4cb9021b6
This commit is contained in:
Kudo Chien
2016-02-02 07:11:41 -08:00
committed by facebook-github-bot-1
parent a0bed63f13
commit 6d65a90017
5 changed files with 17 additions and 24 deletions

View File

@@ -16,7 +16,6 @@ var RefreshLayoutConsts = require('UIManager').AndroidSwipeRefreshLayout.Constan
var View = require('View');
var onlyChild = require('onlyChild');
var processColor = require('processColor');
var requireNativeComponent = require('requireNativeComponent');
var NATIVE_REF = 'native_swiperefreshlayout';
@@ -68,7 +67,7 @@ var PullToRefreshViewAndroid = React.createClass({
render: function() {
return (
<NativePullToRefresh
colors={this.props.colors && this.props.colors.map(processColor)}
colors={this.props.colors}
enabled={this.props.enabled}
onRefresh={this._onRefresh}
progressBackgroundColor={this.props.progressBackgroundColor}