@ldn0x7dc/react-native-view-pager
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -31,3 +31,3 @@ import React, { PropTypes, Component } from 'react'; | ||
onPageScroll: PropTypes.func, | ||
} | ||
}; | ||
@@ -39,3 +39,3 @@ static defaultProps = { | ||
pageDataArray: [], | ||
} | ||
}; | ||
@@ -52,3 +52,3 @@ constructor(props) { | ||
this.currentPage = 0; | ||
this.currentPage; //not initialized | ||
this.pageCount = 0; | ||
@@ -101,6 +101,8 @@ this.initialPageSettled = false; | ||
onResponderRelease(evt, gestureState) { | ||
onResponderRelease(evt, gestureState, disableSettle) { | ||
this.activeGesture = false; | ||
this.changePageScrollState('settling'); | ||
this.settlePage(gestureState.vx); | ||
if(!disableSettle) { | ||
this.settlePage(gestureState.vx); | ||
} | ||
} | ||
@@ -111,2 +113,5 @@ | ||
let list = this.props.pageDataArray; | ||
if(!list) { | ||
list = []; | ||
} | ||
this.dataSource = this.dataSource.cloneWithRows(list); | ||
@@ -117,3 +122,3 @@ this.pageCount = list.length; | ||
let gestureResponder = this.gestureResponder; | ||
if(!this.props.scrollEnabled) { | ||
if(!this.props.scrollEnabled || this.pageCount <= 0) { | ||
gestureResponder = {}; | ||
@@ -147,2 +152,3 @@ } | ||
...page.props, | ||
ref: page.ref, | ||
style: [page.props.style, { | ||
@@ -260,2 +266,6 @@ width: this.state.width, | ||
} | ||
getScrollOffsetFromCurrentPage() { | ||
return this.scroller.getCurrX() - this.getScrollOffsetOfPage(this.currentPage); | ||
} | ||
} |
{ | ||
"name": "@ldn0x7dc/react-native-view-pager", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "library/ViewPager.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10222
224