Merge commit '9d751866913f6fb743ae3e43a580d7624b333864' into develop

This commit is contained in:
harukin-OneMix4 2023-02-22 20:29:40 +09:00
commit 942b90e6d2
2 changed files with 42 additions and 10 deletions

View File

@ -280,7 +280,7 @@ const Footer = ({
setFinalSwitch,
}) => {
return (
<View style={{ flexDirection: "row", padding: 10 }}>
<View style={{ flexDirection: "row", padding: 10, alignItems: "center" }}>
<Text
style={{
alignItems: "center",
@ -404,7 +404,7 @@ const TrainName = ({ train, trainIDSwitch, d, getTrainType }) => {
<View style={{ flex: 9 }}>
<Text
style={{
fontSize: trainName.length > 6 ? 15 : 20,
fontSize: trainName.length > 6 ? parseInt("13%") : parseInt("18%"),
color: getTrainType.color,
fontWeight: "bold",
}}
@ -422,7 +422,8 @@ const LastStation = ({ d }) => {
<View style={{ flex: 4, flexDirection: "row" }}>
<Text
style={{
fontSize: d.lastStation.length > 4 ? 15 : 20,
fontSize:
d.lastStation.length > 4 ? parseInt("13%") : parseInt("18%"),
color: "white",
fontWeight: "bold",
}}
@ -437,7 +438,7 @@ const DependTime = ({ d }) => {
<View style={{ flex: 3 }}>
<Text
style={{
fontSize: 20,
fontSize: parseInt("18%"),
color: "white",
fontWeight: "bold",
}}
@ -486,9 +487,10 @@ const StatusAndDelay = ({ currentTrain, d, props, trainDescriptionSwitch }) => {
<View style={{ flex: 4 }}>
<Text
style={{
fontSize: 20,
fontSize: parseInt("18%"),
color: "white",
fontWeight: "bold",
paddingLeft: 1,
}}
>
{status}
@ -512,7 +514,7 @@ const Description = ({ train }) => {
<View style={{ flex: 4 }}>
<Text
style={{
fontSize: 20,
fontSize: parseInt("18%"),
color: "green",
fontWeight: "bold",
}}

View File

@ -99,7 +99,6 @@ export default function Sign(props) {
style={{ position: "absolute", right: -15, top: -20 }}
onPress={() => {
if (testButtonStatus) {
lottieRef.current.play(35, 7);
const otherData = favoriteStation.filter((d) => {
const compare = JSON.stringify(d);
const current = JSON.stringify(currentStation);
@ -112,7 +111,6 @@ export default function Sign(props) {
AS.setItem("favoriteStation", JSON.stringify(otherData));
setFavoriteStation(otherData);
} else {
lottieRef.current.play(7, 35);
let ret = favoriteStation;
console.log(currentStation);
ret.push(currentStation);
@ -122,12 +120,12 @@ export default function Sign(props) {
setTestButtonStatus(!testButtonStatus);
}}
>
<LottieView
<LottieDelayView
progress={testButtonStatus ? 1 : 0}
speed={1.4}
style={{ width: 80, height: 80 }}
source={require("../../assets/939-star.json")}
ref={lottieRef}
lottieRef={lottieRef}
loop={false}
/>
</TouchableOpacity>
@ -141,6 +139,37 @@ export default function Sign(props) {
);
}
const LottieDelayView = ({
progress,
speed,
style,
source,
lottieRef,
loop,
}) => {
const [progressState, setProgressState] = useState(undefined);
useEffect(() => {
if (progress == 0) {
lottieRef.current.play(progressState !== undefined ? 35 : 7, 7);
} else {
lottieRef.current.play(progressState !== undefined ? 7 : 35, 35);
}
}, [progress]);
return (
<LottieView
progress={progressState}
speed={speed}
style={style}
source={source}
ref={lottieRef}
loop={loop}
onAnimationFinish={(isCanceled) => {
console.log("finish");
setProgressState(progress);
}}
/>
);
};
const NexPreStationLine = ({ nexStation, preStation }) => {
return (
<View style={styleSheet.下枠フレーム}>
@ -313,6 +342,7 @@ const styleSheet = {
flex: 1,
flexDirection: "row",
alignContent: "center",
alignItems: "center",
},
下枠左右マーク: {
fontWeight: "bold",