Fixed header jumping on ProximoListScreen.js

This commit is contained in:
Arnaud Vergnet 2020-04-20 20:51:32 +02:00
parent 02f3ff0ff9
commit 6b04447535

View file

@ -10,7 +10,6 @@ import ProximoListItem from "../../components/Lists/Proximo/ProximoListItem";
import MaterialHeaderButtons, {Item} from "../../components/Overrides/CustomHeaderButton";
import {withCollapsible} from "../../utils/withCollapsible";
import CustomTabBar from "../../components/Tabbar/CustomTabBar";
import AutoHideHandler from "../../utils/AutoHideHandler";
function sortPrice(a, b) {
return a.price - b.price;
@ -59,7 +58,6 @@ class ProximoListScreen extends React.Component<Props, State> {
modalRef: Object;
listData: Array<Object>;
shouldFocusSearchBar: boolean;
hideHandler: AutoHideHandler;
constructor(props) {
super(props);
@ -70,8 +68,6 @@ class ProximoListScreen extends React.Component<Props, State> {
currentSortMode: 3,
modalCurrentDisplayItem: null,
};
this.hideHandler = new AutoHideHandler(false);
this.hideHandler.addListener(this.onHideChange);
}
@ -301,17 +297,8 @@ class ProximoListScreen extends React.Component<Props, State> {
itemLayout = (data, index) => ({length: LIST_ITEM_HEIGHT, offset: LIST_ITEM_HEIGHT * index, index});
onScroll = (event: Object) => {
this.hideHandler.onScroll(event);
};
onHideChange = (shouldHide: boolean) => {
this.props.navigation.setParams({hideTabBar: shouldHide});
}
render() {
const {containerPaddingTop, scrollIndicatorInsetTop, onScrollWithListener} = this.props.collapsibleStack;
const {containerPaddingTop, scrollIndicatorInsetTop, onScroll} = this.props.collapsibleStack;
return (
<View style={{
height: '100%'
@ -330,7 +317,7 @@ class ProximoListScreen extends React.Component<Props, State> {
getItemLayout={this.itemLayout}
initialNumToRender={10}
// Animations
onScroll={onScrollWithListener(this.onScroll)}
onScroll={onScroll}
contentContainerStyle={{
paddingTop: containerPaddingTop,
paddingBottom: CustomTabBar.TAB_BAR_HEIGHT