エラー発生時の再試行用ボタンの設置

This commit is contained in:
harukin-DeskMini
2023-01-28 23:56:10 +09:00
parent a56dfc7618
commit 1dc1b9a636
3 changed files with 82 additions and 5 deletions

41
Apps.js
View File

@@ -8,6 +8,7 @@ import {
} from "react-native";
import { WebView } from "react-native-webview";
import Constants from "expo-constants";
import { Ionicons, MaterialCommunityIcons } from "@expo/vector-icons";
import { AS } from "./storageControl";
import { news } from "./config/newsUpdate";
import { getStationList, lineList } from "./lib/getStationList";
@@ -192,6 +193,10 @@ export default function Apps(props) {
top={Platform.OS == "ios" ? Constants.statusBarHeight : 0}
mapSwitch={mapSwitch == "true" ? "flex" : "none"}
/>
<ReloadButton
onPress={() => webview.current.reload()}
top={Platform.OS == "ios" ? Constants.statusBarHeight : 0}
/>
<StationDeteilView
StationBoardAcSR={StationBoardAcSR}
@@ -237,3 +242,39 @@ const MapsButton = ({ onPress, top, mapSwitch }) => {
</TouchableOpacity>
);
};
const ReloadButton = ({ onPress, top, mapSwitch }) => {
const styles = {
touch: {
position: "absolute",
top,
right: 10,
width: 50,
height: 50,
backgroundColor: "#0099CC",
borderColor: "white",
borderStyle: "solid",
borderWidth: 1,
borderRadius: 50,
alignContent: "center",
alignSelf: "center",
alignItems: "center",
display: mapSwitch,
},
text: {
textAlign: "center",
width: "auto",
height: "auto",
textAlignVertical: "center",
fontWeight: "bold",
color: "white",
},
};
return (
<TouchableOpacity onPress={onPress} style={styles.touch}>
<View style={{ flex: 1 }} />
<Ionicons name="reload" color="white" size={30} />
<View style={{ flex: 1 }} />
</TouchableOpacity>
);
};