import * as React from "react"; import { Text, View, StyleSheet, Animated, ScrollView } from "react-native"; import { TrainDataView } from "./TrainDataView"; const Max_Header_Height = 200; const Min_Header_Height = 80; const Scroll_Distance = Max_Header_Height - Min_Header_Height; export const DynamicHeader = ({ animHeaderValue, currentTrainData, currentPosition, nearTrainIDList, openTrainInfo, }) => { const animatedHeaderHeight = animHeaderValue.interpolate({ inputRange: [0, Scroll_Distance], outputRange: [Max_Header_Height, 0], extrapolate: "clamp", }); const animatedHeaderHeight2 = animHeaderValue.interpolate({ inputRange: [0, Scroll_Distance], outputRange: [0, Min_Header_Height], extrapolate: "clamp", }); const animateHeaderBackgroundColor = animHeaderValue.interpolate({ inputRange: [0, Max_Header_Height - Min_Header_Height], outputRange: ["blue", "red"], extrapolate: "clamp", }); return ( <> setActionSheetHorizonalScroll(true)} //onScrollEndDrag={() => setActionSheetHorizonalScroll(false)} //onScrollBeginDrag={() => console.log("onScrollBeginDrag")} style={{ flexDirection: "row", //width: widthPercentageToDP("200%"), // minHeight: 200, //height: heightPercentageToDP("20%"), }} horizontal pagingEnabled > {/* 行先 岡山 車両案内 宇多津でうずしお号と連結 編成(使用車両:2700系) {"[<自][自>][アン自|指>][アン指|G>]"} */} setActionSheetHorizonalScroll(true)} //onScrollEndDrag={() => setActionSheetHorizonalScroll(false)} //onScrollBeginDrag={() => console.log("onScrollBeginDrag")} style={{ flexDirection: "row", flex: 1, //width: widthPercentageToDP("200%"), // minHeight: 200, //height: heightPercentageToDP("20%"), }} horizontal pagingEnabled > {/* 行先 岡山 車両案内 宇多津でうずしお号と連結 編成(使用車両:2700系) {"[<自][自>][アン自|指>][アン指|G>]"} */} ); }; const styles = StyleSheet.create({ header: { justifyContent: "center", alignItems: "center", left: 0, right: 0, //paddingTop: 10, }, headerText: { color: "#fff", fontSize: 25, fontWeight: "bold", textAlign: "center", }, });