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

View File

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