@ldn0x7dc/react-native-view-pager
Advanced tools
Comparing version 0.0.6 to 0.0.7
import React, { PropTypes, Component } from 'react'; | ||
import { | ||
View, | ||
ListView | ||
ListView, | ||
Platform | ||
} from 'react-native'; | ||
import Image from 'react-native-transformable-image'; | ||
import Scroller from 'react-native-scroller'; | ||
import {createResponder} from 'react-native-gesture-responder'; | ||
import TimerMixin from 'react-timer-mixin'; | ||
import reactMixin from 'react-mixin'; | ||
const MIN_FLING_VELOCITY = 0.5; | ||
@@ -181,3 +184,9 @@ let DEV = false; | ||
this.initialPageSettled = true; | ||
this.scrollToPage(this.props.initialPage, true); | ||
if(Platform.OS === 'ios') { | ||
this.scrollToPage(this.props.initialPage, true); | ||
} else { | ||
//A trick to solve bugs on Android. Delay a little | ||
setTimeout(this.scrollToPage.bind(this, this.props.initialPage, true), 0); | ||
} | ||
} | ||
@@ -273,2 +282,8 @@ } | ||
} | ||
} | ||
} | ||
/** | ||
* Keep in mind that if you use ES6 classes for your React components there is no built-in API for mixins. To use TimerMixin with ES6 classes, we recommend react-mixin. | ||
* Refer to 'https://facebook.github.io/react-native/docs/timers.html#content' | ||
*/ | ||
reactMixin(ViewPager.prototype, TimerMixin); |
{ | ||
"name": "@ldn0x7dc/react-native-view-pager", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "", | ||
@@ -13,4 +13,6 @@ "main": "library/ViewPager.js", | ||
"react-native-gesture-responder": "0.0.8", | ||
"react-native-scroller": "0.0.6" | ||
"react-native-scroller": "0.0.6", | ||
"react-mixin": "^3.0.5", | ||
"react-timer-mixin": "^0.13.3" | ||
} | ||
} |
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
11152
244
4
+ Addedreact-mixin@^3.0.5
+ Addedreact-timer-mixin@^0.13.3
+ Addedobject-assign@4.1.1(transitive)
+ Addedreact-mixin@3.1.1(transitive)
+ Addedreact-timer-mixin@0.13.4(transitive)
+ Addedsmart-mixin@2.0.0(transitive)