Authored by chenl

修复了android remove tag。 review by yuliang.

... ... @@ -12,6 +12,8 @@ const {
TouchableOpacity,
StyleSheet,
Dimensions,
Platform,
} = ReactNative;
export default class Banner extends React.Component {
... ... @@ -57,6 +59,26 @@ export default class Banner extends React.Component {
let height = this.props.height;
let data = this.props.data.toArray();
if (data.length == 1) {
return (
<TouchableOpacity
activeOpacity={1}
style={{width: width, height: height}}
onPress={() => {
this.props.onPress && this.props.onPress(data[0].get('url'), 0);
}}
>
<SlicedImage
source={{uri: data[0].get('src').replace('{width}', width).replace('{height}', height).replace('{mode}',2)}}
style={{ width: width, height: height}}
/>
</TouchableOpacity>
);
}
return (
<Swiper
style={styles.banner}
... ... @@ -66,7 +88,7 @@ export default class Banner extends React.Component {
autoplayTimeout={this.props.duration}
paginationStyle={{bottom: 8}}
dot={this.dot}
activeDot={this.activeDot}
activeDot={(Platform.OS === 'ios')?this.activeDot:null}
height={height}
>
{data.map((item, i) => {
... ...
... ... @@ -329,6 +329,12 @@ export default class NewArrival extends Component {
recommend = [topPart.get('brandList')];
}
let featured = topPart.get('featuredList')&&topPart.get('featuredList').size?[topPart.get('featuredList')]:[];
let removeTag = true;
if(Platform.OS !== 'ios' && featured.length > 0 && featured[0] && featured[0].size > 2){
removeTag = false;
}
let dataSource = {
banner,
recommend,
... ... @@ -349,6 +355,8 @@ export default class NewArrival extends Component {
renderRow={this._renderRow}
enableEmptySections={true}
renderSectionHeader={this._renderSectionHeader}
removeClippedSubviews={removeTag}
renderFooter={()=>{
if (endReached) {
return <View style={styles.placeholder} />;
... ...