Skip to content

Instantly share code, notes, and snippets.

View bogoslavskiy's full-sized avatar

Artem Bogoslavskiy bogoslavskiy

View GitHub Profile
getOpacitySearchBar() {
return {
opacity: this.scrollY.interpolate({
inputRange: [...],
outputRange: [1, 0],
extrapolate: 'clamp',
})
};
}
export default class SearchBar extends Component {
blurInputs() {
this.inputSearch.blur();
this.inputLocation.blur();
this.props.changeInputFocus(false);
}
render() {
const { animation, changeInputFocus, renderTabBar } = this.props;
_onScrollEndDrag = e => {
let velocity = e.nativeEvent.velocity.y;
if(velocity == 0 || (isAndroid() && Math.abs(Math.round(velocity)) <= 2)) {
this.props.animation.handleIntermediateState(this.scrollToOffset);
}
};
render() {
return (
<SearchBarProvider currentTab={this.state.currentTab}>
{(animation, { canJumpToTab }) =>
<View style={initialLayout}>
{Platform.OS === 'android' &&
<StatusBar
translucent={true}
backgroundColor="transparent"
/>