From 8b3f1515baeffe910e0007545fc8c23be33b153a Mon Sep 17 00:00:00 2001 From: Max Huttunen Date: Thu, 17 Dec 2015 11:29:18 +0200 Subject: [PATCH] add simple support for android --- src/index.js | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/src/index.js b/src/index.js index 4d5ec851..5a225df9 100644 --- a/src/index.js +++ b/src/index.js @@ -15,6 +15,8 @@ import React, { ScrollView, TouchableOpacity, Dimensions, + Platform, + ViewPagerAndroid } from 'react-native' // Using bare setTimeout, setInterval, setImmediate @@ -399,6 +401,26 @@ export default React.createClass({ ) }, + renderScrollView(pages) { + if (Platform.OS === 'ios') + return ( + + {pages} + + ); + return ( + + {pages} + + ); + }, + /** * Inject state to ScrollResponder * @param {object} props origin props @@ -466,14 +488,7 @@ export default React.createClass({ width: state.width, height: state.height }]}> - - {pages} - + {this.renderScrollView(pages)} {props.showsPagination && (props.renderPagination ? this.props.renderPagination(state.index, state.total, this) : this.renderPagination())}