File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ type Props = {
1212 onTouchBottom : Function ,
1313 children ?: React$Node ,
1414 onLayout ?: Function ,
15+ bottomOffset ?: number ,
1516} ;
1617
1718type DefaultProps = {
@@ -21,6 +22,7 @@ type DefaultProps = {
2122 onDisplay : Function ,
2223 onTouchTop : Function ,
2324 onTouchBottom : Function ,
25+ bottomOffset : number ,
2426} ;
2527
2628type State = {
@@ -30,7 +32,7 @@ type State = {
3032
3133type Context = {
3234 scrollPageY ?: number ,
33- scrollY : Animated . Value ,
35+ scrollY : typeof Animated . Value ,
3436} ;
3537
3638class TriggeringView extends Component < Props , State > {
@@ -55,6 +57,7 @@ class TriggeringView extends Component<Props, State> {
5557 onDisplay : ( ) => { } ,
5658 onTouchTop : ( ) => { } ,
5759 onTouchBottom : ( ) => { } ,
60+ bottomOffset : 0 ,
5861 } ;
5962
6063 constructor ( props : Props ) {
@@ -114,11 +117,11 @@ class TriggeringView extends Component<Props, State> {
114117 this . props . onTouchTop ( false ) ;
115118 }
116119
117- if ( ! this . state . hidden && value >= bottom ) {
120+ if ( ! this . state . hidden && value >= bottom + this . props . bottomOffset ) {
118121 this . setState ( { hidden : true } ) ;
119122 this . props . onHide ( ) ;
120123 this . props . onTouchBottom ( true ) ;
121- } else if ( this . state . hidden && value < bottom ) {
124+ } else if ( this . state . hidden && value < bottom + this . props . bottomOffset ) {
122125 this . setState ( { hidden : false } ) ;
123126 this . props . onBeginDisplayed ( ) ;
124127 this . props . onTouchBottom ( false ) ;
You can’t perform that action at this time.
0 commit comments