レイアウト調整

This commit is contained in:
harukin-OneMix4 2023-12-25 05:43:21 +09:00
parent 2debff6051
commit f1e98344ca
3 changed files with 134 additions and 140 deletions

View File

@ -299,6 +299,7 @@ export const EachTrainInfo = (props) => {
/> />
)} )}
</View> </View>
{from == "AllTrainDiagramView" || (
<ScrollView <ScrollView
style={{ style={{
flexDirection: "row", flexDirection: "row",
@ -364,7 +365,11 @@ export const EachTrainInfo = (props) => {
</> </>
) : ( ) : (
<Text <Text
style={{ fontSize: 28, color: "#0099CC", textAlign: "right" }} style={{
fontSize: 28,
color: "#0099CC",
textAlign: "right",
}}
> >
{data.trainData?.Pos} {data.trainData?.Pos}
</Text> </Text>
@ -497,6 +502,7 @@ export const EachTrainInfo = (props) => {
</View> </View>
</View> */} </View> */}
</ScrollView> </ScrollView>
)}
<ScrollView <ScrollView
style={{ maxHeight: heightPercentageToDP("55%") }} style={{ maxHeight: heightPercentageToDP("55%") }}
nestedScrollEnabled nestedScrollEnabled

View File

@ -23,7 +23,12 @@ export default function AllTrainDiagramView({ navigation: { navigate } }) {
const { areaInfo } = useAreaInfo(); const { areaInfo } = useAreaInfo();
const { allTrainDiagram } = useAllTrainDiagram(); const { allTrainDiagram } = useAllTrainDiagram();
const [originalStationList, setOriginalStationList] = useState(); // 第一要素 const [originalStationList, setOriginalStationList] = useState(); // 第一要素
const [keyList, setKeyList] = useState(); // 第二要素
useEffect(() => getStationList().then(setOriginalStationList), []); useEffect(() => getStationList().then(setOriginalStationList), []);
useEffect(
() => allTrainDiagram && setKeyList(Object.keys(allTrainDiagram)),
[]
);
const openTrainInfo = (d) => { const openTrainInfo = (d) => {
const train = customTrainDataDetector(d); const train = customTrainDataDetector(d);
@ -45,7 +50,7 @@ export default function AllTrainDiagramView({ navigation: { navigate } }) {
}, },
navigate, navigate,
originalStationList, originalStationList,
from: "LED", from: "AllTrainDiagramView",
}; };
SheetManager.show("EachTrainInfo", { SheetManager.show("EachTrainInfo", {
payload, payload,
@ -54,31 +59,10 @@ export default function AllTrainDiagramView({ navigation: { navigate } }) {
return ( return (
<View style={{ backgroundColor: "#0099CC", height: "100%" }}> <View style={{ backgroundColor: "#0099CC", height: "100%" }}>
<ScrollView> <ScrollView>
{allTrainDiagram && {keyList &&
Object.keys(allTrainDiagram).map((key) => { keyList.map((key) => (
return ( <Item openTrainInfo={openTrainInfo} key={key} id={key} />
<TouchableOpacity ))}
style={{
padding: 10,
flexDirection: "row",
borderColor: "white",
borderWidth: 1,
margin: 10,
borderRadius: 5,
alignItems: "center",
}}
onPress={() => openTrainInfo(key)}
>
<View style={{ flex: 1 }} />
<Text
style={{ fontSize: 25, fontWeight: "bold", color: "white" }}
>
{key}
</Text>
<View style={{ flex: 1 }} />
</TouchableOpacity>
);
})}
</ScrollView> </ScrollView>
<TouchableOpacity <TouchableOpacity
@ -102,23 +86,25 @@ export default function AllTrainDiagramView({ navigation: { navigate } }) {
</View> </View>
); );
} }
const UsefulBox = (props) => { const Item = ({ id, openTrainInfo }) => {
const { icon, backgroundColor, flex, onPressButton, children } = props;
return ( return (
<TouchableOpacity <TouchableOpacity
style={{ style={{
flex: flex, padding: 5,
backgroundColor: backgroundColor, flexDirection: "row",
padding: 10, borderColor: "white",
borderWidth: 1,
margin: 5,
borderRadius: 5,
alignItems: "center", alignItems: "center",
margin: 2,
}} }}
onPress={onPressButton} onPress={() => openTrainInfo(id)}
> >
<MaterialCommunityIcons name={icon} color="white" size={50} /> <View style={{ flex: 1 }} />
<Text style={{ color: "white", fontWeight: "bold", fontSize: 18 }}> <Text style={{ fontSize: 25, fontWeight: "bold", color: "white" }}>
{children} {id}
</Text> </Text>
<View style={{ flex: 1 }} />
</TouchableOpacity> </TouchableOpacity>
); );
}; };

26
menu.js
View File

@ -535,18 +535,6 @@ const FixedContentBottom = (props) => {
JR四国グループの施設をご案内 JR四国グループの施設をご案内
</Text> </Text>
</TextBox> </TextBox>
<TextBox
backgroundColor="#0099CC"
flex={1}
onPressButton={() => props.navigate("AllTrainIDList")}
>
<Text style={{ color: "white", fontWeight: "bold", fontSize: 20 }}>
列番検索
</Text>
<Text style={{ color: "white", fontSize: 18 }}>
全列車のダイヤを確認できる機能です
</Text>
</TextBox>
<View style={{ flexDirection: "row" }}> <View style={{ flexDirection: "row" }}>
<TouchableOpacity <TouchableOpacity
style={{ style={{
@ -680,12 +668,26 @@ const FixedContentBottom = (props) => {
))} ))}
</View> </View>
</View> </View>
<Text style={{ fontWeight: "bold", fontSize: 20 }}>上級者向け機能</Text>
<TextBox
backgroundColor="#8c00d6"
flex={1}
onPressButton={() => props.navigate("AllTrainIDList")}
>
<Text style={{ color: "white", fontWeight: "bold", fontSize: 20 }}>
列番探索
</Text>
<Text style={{ color: "white", fontSize: 18 }}>
データベースに存在する全列車のダイヤを確認できる機能です
</Text>
</TextBox>
<Text style={{ fontWeight: "bold", fontSize: 20 }}> <Text style={{ fontWeight: "bold", fontSize: 20 }}>
このアプリについて このアプリについて
</Text> </Text>
<Text> <Text>
このアプリはXprocess(HARUKIN)が製作しているJR四国の完全非公式アシストアプリケーションですこのアプリに関することでのJR四国公式へ問合せすることはお控えください以下のTwitterよりお願いします このアプリはXprocess(HARUKIN)が製作しているJR四国の完全非公式アシストアプリケーションですこのアプリに関することでのJR四国公式へ問合せすることはお控えください以下のTwitterよりお願いします
</Text> </Text>
<TextBox <TextBox
backgroundColor="#CC0000" backgroundColor="#CC0000"
flex={1} flex={1}