崩れの修正
This commit is contained in:
parent
f6a88f09e4
commit
d627617ca0
4
App.js
4
App.js
@ -239,7 +239,9 @@ function MenuPage({
|
|||||||
AS.getItem("favoriteStation")
|
AS.getItem("favoriteStation")
|
||||||
.then((d) => {
|
.then((d) => {
|
||||||
const returnData = JSON.parse(d);
|
const returnData = JSON.parse(d);
|
||||||
setFavoriteStation(returnData);
|
if (favoriteStation.toString() != d) {
|
||||||
|
setFavoriteStation(returnData);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((d) => console.log(d));
|
.catch((d) => console.log(d));
|
||||||
});
|
});
|
||||||
|
@ -48,7 +48,6 @@ export default function Sign(props) {
|
|||||||
setNexPrePosition(0);
|
setNexPrePosition(0);
|
||||||
return () => {};
|
return () => {};
|
||||||
}
|
}
|
||||||
LayoutAnimation.easeInEaseOut();
|
|
||||||
setNexPrePosition(
|
setNexPrePosition(
|
||||||
nexPrePosition + 1 == currentStation.length ? 0 : nexPrePosition + 1
|
nexPrePosition + 1 == currentStation.length ? 0 : nexPrePosition + 1
|
||||||
);
|
);
|
||||||
|
30
menu.js
30
menu.js
@ -3,11 +3,11 @@ import Carousel from "react-native-snap-carousel";
|
|||||||
import {
|
import {
|
||||||
Platform,
|
Platform,
|
||||||
View,
|
View,
|
||||||
LayoutAnimation,
|
|
||||||
ScrollView,
|
ScrollView,
|
||||||
Linking,
|
Linking,
|
||||||
Text,
|
Text,
|
||||||
TouchableOpacity,
|
TouchableOpacity,
|
||||||
|
ToastAndroid,
|
||||||
} from "react-native";
|
} from "react-native";
|
||||||
import Constants from "expo-constants";
|
import Constants from "expo-constants";
|
||||||
import { ListItem } from "native-base";
|
import { ListItem } from "native-base";
|
||||||
@ -126,7 +126,6 @@ export default function Menu(props) {
|
|||||||
pre.push(...current);
|
pre.push(...current);
|
||||||
return pre;
|
return pre;
|
||||||
}, []);
|
}, []);
|
||||||
LayoutAnimation.easeInEaseOut();
|
|
||||||
if (returnDataBase.length) {
|
if (returnDataBase.length) {
|
||||||
let currentStation = currentStation == undefined ? [] : currentStation;
|
let currentStation = currentStation == undefined ? [] : currentStation;
|
||||||
if (currentStation.toString() != returnDataBase.toString()) {
|
if (currentStation.toString() != returnDataBase.toString()) {
|
||||||
@ -142,8 +141,6 @@ export default function Menu(props) {
|
|||||||
const [getTime, setGetTime] = useState(new Date());
|
const [getTime, setGetTime] = useState(new Date());
|
||||||
const [loadingDelayData, setLoadingDelayData] = useState(true);
|
const [loadingDelayData, setLoadingDelayData] = useState(true);
|
||||||
const carouselRef = useRef();
|
const carouselRef = useRef();
|
||||||
const scrollRef = useRef();
|
|
||||||
const [isScroll, setIsScroll] = useState(true);
|
|
||||||
const [selectedCurrentStation, setSelectedCurrentStation] = useState(0);
|
const [selectedCurrentStation, setSelectedCurrentStation] = useState(0);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -152,7 +149,6 @@ export default function Menu(props) {
|
|||||||
)
|
)
|
||||||
.then((response) => response.text())
|
.then((response) => response.text())
|
||||||
.then((data) => setDelayData(data !== "" ? data.split("^") : null))
|
.then((data) => setDelayData(data !== "" ? data.split("^") : null))
|
||||||
.then(LayoutAnimation.easeInEaseOut)
|
|
||||||
.then(() => setGetTime(new Date()))
|
.then(() => setGetTime(new Date()))
|
||||||
.finally(() => setLoadingDelayData(false));
|
.finally(() => setLoadingDelayData(false));
|
||||||
}, [loadingDelayData]);
|
}, [loadingDelayData]);
|
||||||
@ -167,11 +163,8 @@ export default function Menu(props) {
|
|||||||
>
|
>
|
||||||
<StatusbarDetect />
|
<StatusbarDetect />
|
||||||
<TitleBar />
|
<TitleBar />
|
||||||
<FixedContent
|
<ScrollView>
|
||||||
scrollRef={scrollRef}
|
<FixedContentTop navigate={navigate} />
|
||||||
isScroll={isScroll}
|
|
||||||
navigate={navigate}
|
|
||||||
>
|
|
||||||
<Carousel
|
<Carousel
|
||||||
ref={carouselRef}
|
ref={carouselRef}
|
||||||
layout={"default"}
|
layout={"default"}
|
||||||
@ -221,7 +214,9 @@ export default function Menu(props) {
|
|||||||
loadingDelayData={loadingDelayData}
|
loadingDelayData={loadingDelayData}
|
||||||
delayData={delayData}
|
delayData={delayData}
|
||||||
/>
|
/>
|
||||||
</FixedContent>
|
<FixedContentBottom navigate={navigate} />
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
<StationDeteilView
|
<StationDeteilView
|
||||||
StationBoardAcSR={StationBoardAcSR}
|
StationBoardAcSR={StationBoardAcSR}
|
||||||
currentStation={
|
currentStation={
|
||||||
@ -367,7 +362,6 @@ const JRSTraInfoBox = (props) => {
|
|||||||
size={30}
|
size={30}
|
||||||
style={{ margin: 5 }}
|
style={{ margin: 5 }}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
LayoutAnimation.easeInEaseOut();
|
|
||||||
setLoadingDelayData(true);
|
setLoadingDelayData(true);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@ -411,9 +405,9 @@ const JRSTraInfoBox = (props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const FixedContent = (props) => {
|
const FixedContentTop = (props) => {
|
||||||
return (
|
return (
|
||||||
<ScrollView ref={props.scrollRef} scrollEnabled={props.isScroll}>
|
<>
|
||||||
<TopMenuButton />
|
<TopMenuButton />
|
||||||
<TextBox
|
<TextBox
|
||||||
backgroundColor="#0099CC"
|
backgroundColor="#0099CC"
|
||||||
@ -431,6 +425,12 @@ const FixedContent = (props) => {
|
|||||||
列車の運行計画・混雑状況・感染症対策への取り組み
|
列車の運行計画・混雑状況・感染症対策への取り組み
|
||||||
</Text>
|
</Text>
|
||||||
</TextBox>
|
</TextBox>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
const FixedContentBottom = (props) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
{props.children}
|
{props.children}
|
||||||
|
|
||||||
<View style={{ flexDirection: "row" }}>
|
<View style={{ flexDirection: "row" }}>
|
||||||
@ -709,6 +709,6 @@ const FixedContent = (props) => {
|
|||||||
height="200"
|
height="200"
|
||||||
source={require("./assets/トレインビジョン関係/1.svg")}
|
source={require("./assets/トレインビジョン関係/1.svg")}
|
||||||
/> */}
|
/> */}
|
||||||
</ScrollView>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user