This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from "react"; | |
import { | |
StyleSheet, | |
Text, | |
TouchableOpacity, | |
View, | |
ScrollView | |
} from "react-native"; | |
import Modal from "react-native-modal"; | |
import { Viewport, getStatusBarHeight } from '../utils'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { | |
View, | |
Text, | |
StyleSheet, | |
TextInput, | |
Button, | |
FlatList, | |
Keyboard, | |
ActivityIndicator, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { | |
View, | |
Text, | |
StyleSheet, | |
TextInput, | |
InputAccessoryView, | |
Button, | |
ScrollView, | |
Dimensions, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { View, StyleSheet, ActivityIndicator } from 'react-native'; | |
import { FlatList } from '../searchBarAnimation'; | |
import { List, ListItem } from 'react-native-elements'; | |
export default class Tab extends React.PureComponent { | |
constructor(props) { | |
super(props); | |
this.state = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FlatListHelper extends React.PureComponent { | |
[...] | |
_onScrollEndDrag = e => { | |
if(e.nativeEvent.velocity.y == 0) { | |
this.props.animation.handleIntermediateState(this.scrollToOffset); | |
} | |
}; | |
[...] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FlatListHelper extends React.PureComponent { | |
[...] | |
_onMomentumScrollBegin = () => this.props._canJumpToTab(false); | |
_onMomentumScrollEnd = () => this.props._canJumpToTab(true); | |
[...] | |
render() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class SearchBarProvider extends React.Component { | |
constructor(props) { | |
super(props); | |
[...] | |
this.state = { | |
currentTab: null, | |
canJumpToTab: true, | |
contextProvider: { | |
animation: this.searchBarAnimation.animationProps, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[...] | |
_renderHeader = (animation, canJumpToTab) => props => ( | |
<SearchBar | |
animation={animation} | |
changeInputFocus={suggestionFocus => | |
this.setState({suggestionFocus}) | |
} | |
renderTabBar={() => ( | |
<TabBar | |
onTabPress={({route}) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_updateScroll = ({value, manually}) => { | |
if(value && manually) { | |
this._clampedScrollValue = value; | |
} else { | |
const diff = value - this._scrollValue; | |
this._scrollValue = Math.max(value, this.topPartHeight); // Fix normal state | |
this._clampedScrollValue = Math.min( | |
Math.max(this._clampedScrollValue + diff, this.minClamp), | |
this.maxClamp | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_handleIntermediateState = (scrollToOffset) => { | |
let scrollY = this.scrollY._value; | |
if(scrollY < this.topPartHeight) { // Full | |
scrollToOffset(scrollY > (this.topPartHeight / 2) ? this.topPartHeight : 0); | |
} else { // Clamped | |
if( | |
this._clampedScrollValue < this.maxClamp && | |
this._clampedScrollValue > this.minClamp | |
) { | |
let scrollTo; |