import * as React from 'react'; import { StyleSheet, View, Text, Animated, ListRenderItem } from 'react-native'; import { RouteViewPortal, RouteContentProps, NavBarAppearanceCombinedConfig, RouteViewEvents } from 'react-native-ios-navigator'; import { ImageAssets } from '../../functions/ImageCache'; import { iOSVersion } from '../../constants/Constants'; import { RouteHeader } from './RouteHeader'; import { ListHeaderProfile } from './ListHeaderProfile'; import { ListItemPost } from './ListItemPost'; import { POST_ITEMS, PostItem } from './Constants'; const navBarAppearanceConfig: NavBarAppearanceCombinedConfig = ((iOSVersion >= 13)? { mode: 'appearance', standardAppearance: { baseConfig: 'transparentBackground', titleTextAttributes: { opacity: 0, }, backIndicatorImage: { type: 'IMAGE_REQUIRE', imageValue: ImageAssets.IconBackChevron, }, }, } : { mode: 'legacy', navBarPreset: 'clearBackground', titleTextAttributes: { opacity: 0, }, }); type NavigatorShowcase02State = { items: PostItem[]; }; export class NavigatorShowcase02 extends React.Component { scrollY = new Animated.Value(0); listHeaderTitleY = new Animated.Value(0); constructor(props: RouteContentProps){ super(props); this.state = { items: POST_ITEMS.slice(0, 5), }; }; _handleOnRouteDidPush = () => { this.setState({ items: POST_ITEMS }); }; _handleScrollViewOnScroll = Animated.event([{ nativeEvent: { contentOffset: { y: this.scrollY } } }], { useNativeDriver: true }); _handleKeyExtractor = (item: PostItem) => { return `id:${item.id}`; }; _renderRouteHeader = () => { return ( ); }; _renderListHeader = () => { return( ); }; _renderListFooter = () => { return ( {'💚'} ); }; _renderListItem: ListRenderItem = ({item, index}) => { return ( ); }; render(){ return( console.log('FlatList', nativeEvent)} scrollEventThrottle={1} /> ); }; }; const styles = StyleSheet.create({ routeContainerStyle: { backgroundColor: 'rgb(5,5,5)' }, routeHeader: { backgroundColor: 'red', }, listContentContainer: { minHeight: 1000, }, listFooterContainer: { alignItems: 'center', justifyContent: 'center', marginTop: 15, marginBottom: 100, }, listFooterSymbolText: { fontSize: 24, opacity: 0.75, }, });