diff --git a/components/ActionSheetComponents/EachTrainInfo.js b/components/ActionSheetComponents/EachTrainInfo.js index 97b436b..0151b6f 100644 --- a/components/ActionSheetComponents/EachTrainInfo.js +++ b/components/ActionSheetComponents/EachTrainInfo.js @@ -460,13 +460,12 @@ export const EachTrainInfo = (props) => { openTrainInfo={openTrainInfo} /> )} - { > + + - 停車駅 - - - {!isNaN(currentTrainData?.delay) && - currentTrainData?.delay != 0 && ( - - (定刻) - - )} - - 見込 - - + + 停車駅 + + + {!isNaN(currentTrainData?.delay) && + currentTrainData?.delay != 0 && ( + + (定刻) + + )} + + 見込 + + + + {headStation && !isConcatNear && ( openBackTrainInfo(headStation)} diff --git a/components/ActionSheetComponents/EachTrainInfo/DynamicHeader.js b/components/ActionSheetComponents/EachTrainInfo/DynamicHeader.js index fc2170f..d02dc7b 100644 --- a/components/ActionSheetComponents/EachTrainInfo/DynamicHeader.js +++ b/components/ActionSheetComponents/EachTrainInfo/DynamicHeader.js @@ -1,6 +1,10 @@ import * as React from "react"; import { Text, View, StyleSheet, Animated, ScrollView } from "react-native"; import { TrainDataView } from "./TrainDataView"; +import { + heightPercentageToDP, + widthPercentageToDP, +} from "react-native-responsive-screen"; const Max_Header_Height = 200; const Min_Header_Height = 80; @@ -13,28 +17,36 @@ export const DynamicHeader = ({ openTrainInfo, }) => { const animatedHeaderHeight = animHeaderValue.interpolate({ - inputRange: [0, Scroll_Distance], + inputRange: [Min_Header_Height, Scroll_Distance], outputRange: [Max_Header_Height, 0], extrapolate: "clamp", }); const animatedHeaderHeight2 = animHeaderValue.interpolate({ inputRange: [0, Scroll_Distance], - outputRange: [0, Min_Header_Height], + outputRange: [Max_Header_Height, Min_Header_Height], extrapolate: "clamp", }); - const animateHeaderBackgroundColor = animHeaderValue.interpolate({ - inputRange: [0, Max_Header_Height - Min_Header_Height], - outputRange: ["blue", "red"], + const animatedHeaderVisible = animHeaderValue.interpolate({ + inputRange: [Min_Header_Height, Scroll_Distance], + outputRange: [1, 0], + extrapolate: "clamp", + }); + const animatedHeaderVisible2 = animHeaderValue.interpolate({ + inputRange: [Min_Header_Height, Scroll_Distance], + outputRange: [0, 1], extrapolate: "clamp", }); return ( - <> + @@ -145,8 +157,10 @@ export const DynamicHeader = ({ styles.header, { height: animatedHeaderHeight2, - //backgroundColor: animateHeaderBackgroundColor, + backgroundColor: "#0099CC", margin: 0, + top: 0, + opacity: animatedHeaderVisible2, }, ]} > @@ -254,7 +268,7 @@ export const DynamicHeader = ({ */} - + ); }; const styles = StyleSheet.create({ @@ -264,6 +278,9 @@ const styles = StyleSheet.create({ left: 0, right: 0, //paddingTop: 10, + position: "absolute", + zIndex: 1, + backgroundColor: "f0f0f0", }, headerText: { color: "#fff",