一部現代的なコードへの書き換え&これからへの準備

This commit is contained in:
harukin-DeskMini 2022-03-28 03:58:14 +09:00
parent f73d57e93e
commit a251651e10
4 changed files with 182 additions and 140 deletions

35
App.js
View File

@ -1,4 +1,4 @@
import React from 'react';
import React, { useEffect, useRef } from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator,TransitionPresets ,} from '@react-navigation/stack';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
@ -13,30 +13,27 @@ import menu from './menu';
import TestArea from './TestArea.js';
const Stack = createStackNavigator();
const Tab = createBottomTabNavigator();
const navigationRef = React.createRef();
if (Platform.OS === 'android') {
if (UIManager.setLayoutAnimationEnabledExperimental) {
UIManager.setLayoutAnimationEnabledExperimental(true);
}
}
export default class App extends React.Component{
render(){
UpdateAsync();
var platform = Platform.OS === "android" ? 70 : 50;
return(
<NavigationContainer name= "Root" ref={navigationRef} style={{flex:1}}>
<Tab.Navigator>
<Stack.Screen name="login" component={top} options={{ tabBarLabel: '位置情報',headerTransparent:true,gestureEnabled:true,tabBarIcon: ({ color, size }) => (<AntDesign name="barchart" size={32} />),}}/>
<Stack.Screen name="menu" component={menu} options={{ tabBarLabel: 'リンク',headerTransparent:true,gestureEnabled:true,tabBarIcon: ({ color, size }) => (<Ionicons name="ios-radio" size={platform}/>),}}/>
<Stack.Screen name="home" component={tndView} options={{ tabBarLabel: '運行情報',headerTransparent:true,gestureEnabled:true,tabBarIcon: ({ color, size }) => (<Ionicons name="md-train" size={32}/>),}}/>
</Tab.Navigator>
</NavigationContainer>
)
}
export default function App(){
const navigationRef = useRef();
var platform = Platform.OS === "android" ? 70 : 50;
useEffect(()=>UpdateAsync(),[])
return(
<NavigationContainer name= "Root" ref={navigationRef} style={{flex:1}}>
<Tab.Navigator>
<Stack.Screen name="login" component={top} options={{ tabBarLabel: '位置情報',headerTransparent:true,gestureEnabled:true,tabBarIcon: ({ color, size }) => (<AntDesign name="barchart" size={32} />),}}/>
<Stack.Screen name="menu" component={menu} options={{ tabBarLabel: 'リンク',headerTransparent:true,gestureEnabled:true,tabBarIcon: ({ color, size }) => (<Ionicons name="ios-radio" size={platform}/>),}}/>
<Stack.Screen name="home" component={tndView} options={{ tabBarLabel: '運行情報',headerTransparent:true,gestureEnabled:true,tabBarIcon: ({ color, size }) => (<Ionicons name="md-train" size={32}/>),}}/>
</Tab.Navigator>
</NavigationContainer>
)
}
function top(){
return(
<Stack.Navigator>

View File

@ -1,16 +1,17 @@
import React, { useRef } from 'react';
import {View, Platform} from 'react-native';
import {WebView} from 'react-native-webview';
import Constants from 'expo-constants';
import Constants from 'expo-constants';/*
import StatusbarDetect from './StatusbarDetect';
var Status = StatusbarDetect();
var Status = StatusbarDetect(); */
export var webview = null;
export default function Apps ({ navigation: { navigate } }) {
export default function Apps (props) {
const { navigation: { navigate } } = props;
var urlcache="";
const webview = useRef();
return (
<View style={{height:"100%",paddingTop: Constants.statusBarHeight,}}>
{Status}
{/* {Status} */}
<WebView
useWebKit={true}
ref={webview}

View File

@ -1,24 +1,11 @@
import { ToastAndroid, } from 'react-native';
import * as Updates from 'expo-updates';
export function UpdateAsync(){
try {
async function test(){
const update = await Updates.checkForUpdateAsync();
if (update.isAvailable) {
ToastAndroid.showWithGravityAndOffset('アプリのデータを更新しています。',ToastAndroid.LONG,ToastAndroid.BOTTOM,25,50,);
await Updates.fetchUpdateAsync().then(function(){
Updates.reloadAsync();
});
}
else{}
}
test();
}catch(e){
ToastAndroid.showWithGravityAndOffset(e,ToastAndroid.LONG,ToastAndroid.BOTTOM,25,50,);
}
Updates.checkForUpdateAsync().then(update=>{
if (update.isAvailable) {
ToastAndroid.showWithGravityAndOffset('アプリのデータを更新しています。',ToastAndroid.LONG,ToastAndroid.BOTTOM,25,50,);
Updates.fetchUpdateAsync().then(()=>Updates.reloadAsync());
}
}).catch(e=>ToastAndroid.showWithGravityAndOffset(e.toString(),ToastAndroid.LONG,ToastAndroid.BOTTOM,25,50,))
}

253
menu.js
View File

@ -45,16 +45,43 @@ const UchikoLineStation = makeLineStationListValiable(内子線,"(予讃)内子
const TokushimaLineStation = makeLineStationListValiable(徳島線,"徳島線");
const NarutoLineStation = makeLineStationListValiable(鳴門線,"鳴門線");
const stationList = {};
export default function(props) {
const navigation = useNavigation();
return <Menu {...props} navigation={navigation} />;
const UsefulBox = (props) =>{
const { icon, backgroundColor, flex, onPressButton, children } = props;
return(
<TouchableOpacity style={{flex:flex,backgroundColor:backgroundColor,padding:10,alignItems:"center",margin:2}} onPress={onPressButton}>
<MaterialCommunityIcons name={icon} color="white" size={50}/>
<Text style={{color:"white",fontWeight:"bold",fontSize:20}}>{children}</Text>
</TouchableOpacity>
)
}
export function Menu(props) {
const actionSheetRef = useRef(null);
const _handlePressButtonAsync = async (link) => {
let result = await WebBrowser.openBrowserAsync(link);
};
const TicketBox = (props) =>{
const { icon, backgroundColor, flex, onPressButton, children } = props;
return(
<TouchableOpacity style={{flex:flex,backgroundColor:backgroundColor,borderColor:"#0099CC",padding:10,borderWidth:1,margin:2,alignItems:"center"}} onPress={onPressButton}>
<Text style={{color:"white",fontWeight:"bold",fontSize:20}}>{children}</Text>
{icon}
</TouchableOpacity>
)
}
const TextBox = (props) =>{
const { backgroundColor, flex, onPressButton, children } = props;
return(
<TouchableOpacity style={{flex:flex,backgroundColor:backgroundColor,padding:10,height:70,alignItems:"center",alignContent:"center",margin:2}} onPress={onPressButton}>
<View style={{flex:1}} />
{children}
<View style={{flex:1}} />
</TouchableOpacity>
)
}
export default function Menu(props) {
const JRSTraInfoEXAcSR = useRef(null);
const StationBoardAcSR = useRef(null);
const navigation = useNavigation();
const [stationName,setStationName] = useState(undefined);
@ -219,30 +246,19 @@ export function Menu(props) {
const [location, setLocation] = useState(null);
const [errorMsg, setErrorMsg] = useState(null);
useEffect(() => {
(async () => {
let { status } = await Location.requestForegroundPermissionsAsync();
if (status !== 'granted') {
setErrorMsg('Permission to access location was denied');
return;
}
let location = await Location.getCurrentPositionAsync({});
useEffect(async() => {
let { status } = await Location.requestForegroundPermissionsAsync();
if (status !== 'granted') {
setErrorMsg('Permission to access location was denied');
return;
}
Location.getCurrentPositionAsync({}).then(location=>{
console.log(location);
setLocation(location);
loadOfficialStationList().then(()=>getCurrentStation(location.coords));
})();
})
}, []);
let text = 'Waiting..';
if (errorMsg) {
text = errorMsg;
} else if (location) {
text = JSON.stringify(location);
}
const LottieRef = useRef(null);
const LottieRef2 = useRef(null);
@ -250,15 +266,16 @@ export function Menu(props) {
const [delayData,setDelayData] = useState(undefined);
const [getTime,setGetTime] = useState(new Date());
const [loadingDelayData,setLoadingDelayData] = useState(true);
delayData === undefined ? doFetch() : null;
function doFetch(){
useEffect(()=>{
fetch("https://script.google.com/macros/s/AKfycbyKxch7z7l8e07LXulRHqxjVoIiB13kcgvoToLE-rqlxLmLSKdlmqz0FI1F2EuA7Zfg/exec")
.then(response => response.text())
.then(data => {if(data != ""){setDelayData(data.split("^"))}else setDelayData(null)})
.then(data => LayoutAnimation.easeInEaseOut())
.then(()=>setGetTime(new Date()))
.finally(()=>setLoadingDelayData(false));
}
},[loadingDelayData])
useEffect(()=>{
try{
LottieRef?.current.play();
@ -266,7 +283,6 @@ export function Menu(props) {
}catch(e){}
})
const { navigation } = props;
return (
<View style={{height:"100%",paddingTop: Constants.statusBarHeight,backgroundColor:"white"}}>
{Status}
@ -277,27 +293,16 @@ export function Menu(props) {
</View>
<ScrollView>
<View style={{flexDirection:"row"}}>
<TouchableOpacity style={{flex:1,backgroundColor:"#F89038",padding:10,alignItems:"center",margin:2}} onPress={()=>_handlePressButtonAsync("https://www.jr-shikoku.co.jp/01_trainbus/sp/")}>
<MaterialCommunityIcons name="train-car" color="white" size={50}/>
<Text style={{color:"white",fontWeight:"bold",fontSize:20}}>鉄道情報</Text>
</TouchableOpacity>
<TouchableOpacity style={{flex:1,backgroundColor:"#EA4752",padding:10,alignItems:"center",margin:2}} onPress={()=>_handlePressButtonAsync("https://www.jr-shikoku.co.jp/01_trainbus/jikoku/sp/#mainprice-box")}>
<MaterialCommunityIcons name="google-spreadsheet" color="white" size={50}/>
<Text style={{color:"white",fontWeight:"bold",fontSize:20}}>運賃表</Text>
</TouchableOpacity>
<TouchableOpacity style={{flex:1,backgroundColor:"#91C31F",padding:10,alignItems:"center",margin:2}} onPress={()=>_handlePressButtonAsync("https://www.jr-shikoku.co.jp/e5489/")}>
<MaterialCommunityIcons name="clipboard-list-outline" color="white" size={50}/>
<Text style={{color:"white",fontWeight:"bold",fontSize:20}}>予約(e5489)</Text>
</TouchableOpacity>
<UsefulBox backgroundColor={"#F89038"} icon="train-car" flex={1} onPressButton={()=>Linking.openURL("https://www.jr-shikoku.co.jp/01_trainbus/sp/")}>鉄道情報</UsefulBox>
<UsefulBox backgroundColor={"#EA4752"} icon="google-spreadsheet" flex={1} onPressButton={()=>Linking.openURL("https://www.jr-shikoku.co.jp/01_trainbus/jikoku/sp/#mainprice-box")}>運賃表</UsefulBox>
<UsefulBox backgroundColor={"#91C31F"} icon="clipboard-list-outline" flex={1} onPressButton={()=>Linking.openURL("https://www.jr-shikoku.co.jp/e5489/")}>予約</UsefulBox>
</View>
<TouchableOpacity style={{flex:1,backgroundColor:"#0099CC",padding:10,height:70,alignItems:"center",alignContent:"center",margin:2}} onPress={()=>_handlePressButtonAsync("https://www.jr-shikoku.co.jp/02_information/suspension/sp/")}>
<View style={{flex:1}} />
<Text style={{color:"white",fontWeight:"bold",fontSize:20}}>新型コロナウイルスに関するお知らせ</Text>
<Text style={{color:"white",fontSize:18}}>列車の運行計画混雑状況感染症対策への取り組み</Text>
<View style={{flex:1}} />
</TouchableOpacity>
<TextBox backgroundColor="#0099CC" flex={1} onPressButton={()=>Linking.openURL("https://www.jr-shikoku.co.jp/02_information/suspension/sp/")}>
<Text style={{color:"white",fontWeight:"bold",fontSize:20}}>新型コロナウイルスに関するお知らせ</Text>
<Text style={{color:"white",fontSize:18}}>列車の運行計画混雑状況感染症対策への取り組み</Text>
</TextBox>
{stationName ? stationName. ?
<TouchableOpacity style={{ width: wp("80%"), height: wp("80%")/20*9,borderColor:"#2E94BB",borderWidth:1,margin:10,marginHorizontal:wp("10%")}} onPress={()=> !stationName..JrHpUrl || Linking.openURL(stationName..JrHpUrl)}>
<TouchableOpacity style={{ width: wp("80%"), height: wp("80%")/20*9,borderColor:"#2E94BB",borderWidth:1,margin:10,marginHorizontal:wp("10%")}} /* onPress={()=> !stationName.今.JrHpUrl || Linking.openURL(stationName.今.JrHpUrl)} */onPress={() => {StationBoardAcSR.current?.setModalVisible()}}>
<View style={{position:"absolute",bottom:"0%",left:"0%",width:"100%",height:'30%',backgroundColor:"#2E94BB"}} />
<Text style={{position:"absolute",top:"2%",left:"2%",fontWeight:"bold",fontSize:parseInt("30%"),color:"#2E94BB"}}>JR</Text>
<View style={{position:"absolute",alignContent:"center",alignItems:"center",top:"20%",right:'10%',width:wp("10%"),height:wp("10%"),borderColor:"#2E94BB",borderWidth:parseInt("2%"),borderRadius:parseInt("100%")}} >
@ -327,7 +332,7 @@ export function Menu(props) {
<Text style={{fontWeight:"bold",fontSize:parseInt("15%"),color:"white"}}>{stationName..name}</Text>
<Text style={{fontWeight:"bold",fontSize:parseInt("15%"),color:"white"}}>{stationName..en}</Text>
</View>
<TouchableOpacity style={{alignItems:"center"}} onPress={()=>_handlePressButtonAsync(stationName..StationTimeTable)}>
<TouchableOpacity style={{alignItems:"center"}} onPress={()=>Linking.openURL(stationName..StationTimeTable)}>
<Text style={{fontWeight:"bold",fontSize:parseInt("15%"),backgroundColor:"white",color:"#005170",padding:5}}>時刻表</Text>
</TouchableOpacity>
<View style={{flex:1,alignItems:"flex-end"}}>
@ -347,7 +352,7 @@ export function Menu(props) {
{stationName ? stationName. ?
<LED_vision stationName={stationName} />
: null : null}
<TouchableOpacity onPress={() => {actionSheetRef.current?.setModalVisible()}}>
<TouchableOpacity onPress={() => {JRSTraInfoEXAcSR.current?.setModalVisible()}}>
<View style={{backgroundColor:"#0099CC",borderRadius:5,margin:10,borderColor:"black",borderWidth:2,overflow:"hidden"}}>
<ScrollView scrollEnabled={false} style={{backgroundColor:"#0099CC",borderRadius:5,maxHeight:300,}}>
<View style={{padding:10,flexDirection:"row",alignItems:"center"}}>
@ -357,7 +362,7 @@ export function Menu(props) {
<Text style={{fontSize:20,fontWeight:"bold",color:"#0099CC"}}>最新の情報へ更新</Text>
</TouchableOpacity> */}
<Text style={{fontSize:30,fontWeight:"bold",color:"white"}}>{getTime ? getTime.toLocaleTimeString('ja-JP').split(":")[0]+":"+getTime.toLocaleTimeString('ja-JP').split(":")[1]: NaN}</Text>
<Ionicons name="reload" color="white" size={30} style={{margin:5}} onPress={() => {LayoutAnimation.easeInEaseOut(),setLoadingDelayData(true),doFetch()}}/>
<Ionicons name="reload" color="white" size={30} style={{margin:5}} onPress={() => {LayoutAnimation.easeInEaseOut(),setLoadingDelayData(true)}}/>
</View>
<View style={{padding:10,backgroundColor:"white",borderBottomLeftRadius:5,borderBottomRightRadius:5}}>
{loadingDelayData ?
@ -392,45 +397,28 @@ export function Menu(props) {
<View style={{flexDirection:"row"}}>
<TouchableOpacity style={{flex:1,backgroundColor:"#AD7FA8",borderColor:"#0099CC",padding:10,borderWidth:1,margin:2,alignItems:"center"}} onPress={()=>_handlePressButtonAsync("https://www.jr-eki.com/ticket/brand")}>
<Text style={{color:"white",fontWeight:"bold",fontSize:20}}>トクトク切符</Text>
<Foundation name="ticket" color="white" size={50}/>
</TouchableOpacity>
<TouchableOpacity style={{flex:1,backgroundColor:"#8F5902",borderColor:"#0099CC",padding:10,borderWidth:1,margin:2,alignItems:"center"}} onPress={()=>_handlePressButtonAsync("https://www.jr-shikoku.co.jp/01_trainbus/event_train/sp/")}>
<Text style={{color:"white",fontWeight:"bold",fontSize:20}}>観光列車</Text>
<FontAwesome name="first-order" color="white" size={50}/>
</TouchableOpacity>
<TouchableOpacity style={{flex:1,backgroundColor:"#888A85",borderColor:"#0099CC",padding:10,borderWidth:1,margin:2,alignItems:"center"}} onPress={()=>_handlePressButtonAsync("https://www.jr-eki.com/tour/brand")}>
<Text style={{color:"white",fontWeight:"bold",fontSize:20}}>旅行ツアー</Text>
<Ionicons name="flag" color="white" size={50}/>
</TouchableOpacity>
<TicketBox backgroundColor={"#AD7FA8"} icon={<Foundation name="ticket" color="white" size={50}/>} flex={1} onPressButton={()=>Linking.openURL("https://www.jr-eki.com/ticket/brand")}>トクトク切符</TicketBox>
<TicketBox backgroundColor={"#8F5902"} icon={<FontAwesome name="first-order" color="white" size={50}/>} flex={1} onPressButton={()=>Linking.openURL("https://www.jr-shikoku.co.jp/01_trainbus/event_train/sp/")}>観光列車</TicketBox>
<TicketBox backgroundColor={"#888A85"} icon={<Ionicons name="flag" color="white" size={50}/>} flex={1} onPressButton={()=>Linking.openURL("https://www.jr-eki.com/tour/brand")}>旅行ツアー</TicketBox>
</View>
<TouchableOpacity style={{flex:1,backgroundColor:"#0099CC",padding:10,height:70,alignItems:"center",alignContent:"center",margin:2}} onPress={()=>_handlePressButtonAsync("https://www.jr-shikoku.co.jp/sp/index.html#menu-box")}>
<View style={{flex:1}} />
<Text style={{color:"white",fontWeight:"bold",fontSize:20}}>臨時列車などのお知らせ</Text>
<Text style={{color:"white",fontSize:18}}>区間縮小計画運休イベント季節臨時列車など</Text>
<View style={{flex:1}} />
</TouchableOpacity>
<TouchableOpacity style={{flex:1,backgroundColor:"#0099CC",padding:10,height:70,alignItems:"center",alignContent:"center",margin:2}} onPress={()=>_handlePressButtonAsync("https://www.jr-shikoku.co.jp/03_news/press/")}>
<View style={{flex:1}} />
<Text style={{color:"white",fontWeight:"bold",fontSize:20}}>ニュースリリース</Text>
<Text style={{color:"white",fontSize:18}}>公式プレス記事はこちら</Text>
<View style={{flex:1}} />
</TouchableOpacity>
<TouchableOpacity style={{flex:1,backgroundColor:"#0099CC",padding:10,height:70,alignItems:"center",alignContent:"center",margin:2}} onPress={()=>_handlePressButtonAsync("https://www.jr-shikoku.co.jp/teiki/")}>
<View style={{flex:1}} />
<Text style={{color:"white",fontWeight:"bold",fontSize:20}}>定期運賃計算</Text>
<Text style={{color:"white",fontSize:18}}>通常/学生/快てき等はこちら</Text>
<View style={{flex:1}} />
</TouchableOpacity>
<TouchableOpacity style={{flex:1,backgroundColor:"#0099CC",padding:10,height:70,alignItems:"center",alignContent:"center",margin:2}} onPress={()=>_handlePressButtonAsync("https://www.jr-shikoku.co.jp/04_company/group/sp/")}>
<View style={{flex:1}} />
<Text style={{color:"white",fontWeight:"bold",fontSize:20}}>JR四国のお店サービス</Text>
<Text style={{color:"white",fontSize:18}}>JR四国グループの施設をご案内</Text>
<View style={{flex:1}} />
</TouchableOpacity>
<TextBox backgroundColor="#0099CC" flex={1} onPressButton={()=>Linking.openURL("https://www.jr-shikoku.co.jp/sp/index.html#menu-box")}>
<Text style={{color:"white",fontWeight:"bold",fontSize:20}}>臨時列車などのお知らせ</Text>
<Text style={{color:"white",fontSize:18}}>区間縮小計画運休イベント季節臨時列車など</Text>
</TextBox>
<TextBox backgroundColor="#0099CC" flex={1} onPressButton={()=>Linking.openURL("https://www.jr-shikoku.co.jp/03_news/press/")}>
<Text style={{color:"white",fontWeight:"bold",fontSize:20}}>ニュースリリース</Text>
<Text style={{color:"white",fontSize:18}}>公式プレス記事はこちら</Text>
</TextBox>
<TextBox backgroundColor="#0099CC" flex={1} onPressButton={()=>Linking.openURL("https://www.jr-shikoku.co.jp/teiki/")}>
<Text style={{color:"white",fontWeight:"bold",fontSize:20}}>定期運賃計算</Text>
<Text style={{color:"white",fontSize:18}}>通常/学生/快てき等はこちら</Text>
</TextBox>
<TextBox backgroundColor="#0099CC" flex={1} onPressButton={()=>Linking.openURL("https://www.jr-shikoku.co.jp/04_company/group/sp/")}>
<Text style={{color:"white",fontWeight:"bold",fontSize:20}}>JR四国のお店サービス</Text>
<Text style={{color:"white",fontSize:18}}>JR四国グループの施設をご案内</Text>
</TextBox>
<View style={{flexDirection:"row"}}>
<TouchableOpacity style={{flex:1,backgroundColor:"#729FCF",borderColor:"#0099CC",padding:10,borderWidth:1,margin:2,alignItems:"center"}} onPress={()=>_handlePressButtonAsync("https://www.jr-odekake.net/smt/")}>
<TouchableOpacity style={{flex:1,backgroundColor:"#729FCF",borderColor:"#0099CC",padding:10,borderWidth:1,margin:2,alignItems:"center"}} onPress={()=>Linking.openURL("https://www.jr-odekake.net/smt/")}>
<Text style={{color:"white",fontWeight:"bold",fontSize:20}}>時刻運賃計算</Text>
<Text style={{color:"white",fontWeight:"bold",fontSize:18}}>(マイダイヤ)</Text>
<Foundation name="yen" color="white" size={50}/>
@ -490,15 +478,13 @@ export function Menu(props) {
<Text style={{fontWeight:"bold",fontSize:20}}>このアプリについて</Text>
<Text>このアプリはXprocess(HARUKIN)が製作しているJR四国の完全非公式アシストアプリケーションですこのアプリに関することでのJR四国公式へ問合せすることはお控えください以下のTwitterよりお願いします</Text>
<Text>2021/6/23 4.0公開ホーム画面を大改造しました</Text>
<TouchableOpacity style={{flex:1,backgroundColor:"#CC0000",padding:10,height:70,alignItems:"center",alignContent:"center",margin:2}} onPress={()=>{count < 10 ? (Linking.openURL("https://twitter.com/Xprocess_main"),setCount(count+1)):navigation.navigate("test")}}>
<View style={{flex:1}} />
<Text style={{color:"white",fontWeight:"bold",fontSize:20}}>XprocessのTwitter</Text>
<Text style={{color:"white",fontSize:18}}>制作運営のTwitterです</Text>
<View style={{flex:1}} />
</TouchableOpacity>
<TextBox backgroundColor="#CC0000" flex={1} onPressButton={()=>Linking.openURL("https://twitter.com/Xprocess_main")}>
<Text style={{color:"white",fontWeight:"bold",fontSize:20}}>XprocessのTwitter</Text>
<Text style={{color:"white",fontSize:18}}>制作運営のTwitterです</Text>
</TextBox>
<SvgUri width="200" height="200" source={ require('./assets/トレインビジョン関係/1.svg') } />
</ScrollView>
<ActionSheet ref={actionSheetRef}gestureEnabled CustomHeaderComponent={()=>{}}>
<ActionSheet ref={JRSTraInfoEXAcSR}gestureEnabled CustomHeaderComponent={()=>{}}>
<View style={{backgroundColor:"#0099CC",borderRadius:5,borderColor:"dark",borderWidth:1}}>
<View style={{height:26,width:"100%",}}>
<View style={{ height: 6, width: 45, borderRadius: 100, backgroundColor: "#f0f0f0", marginVertical: 10, alignSelf: "center",}} />
@ -510,7 +496,7 @@ export function Menu(props) {
<Text style={{fontSize:20,fontWeight:"bold",color:"#0099CC"}}>最新の情報へ更新</Text>
</TouchableOpacity> */}
<Text style={{fontSize:30,fontWeight:"bold",color:"white"}}>{getTime ? getTime.toLocaleTimeString('ja-JP').split(":")[0]+":"+getTime.toLocaleTimeString('ja-JP').split(":")[1]: NaN} </Text>
<Ionicons name="reload" color="white" size={30} style={{margin:5}} onPress={() => {LayoutAnimation.easeInEaseOut(),setLoadingDelayData(true),doFetch()}}/>
<Ionicons name="reload" color="white" size={30} style={{margin:5}} onPress={() => {LayoutAnimation.easeInEaseOut(),setLoadingDelayData(true)}}/>
</View>
<ScrollView>
@ -547,6 +533,77 @@ export function Menu(props) {
</View>
</ActionSheet>
<ActionSheet ref={StationBoardAcSR}gestureEnabled CustomHeaderComponent={()=>{}}>
<View style={{backgroundColor:"white",borderRadius:5,borderColor:"dark",borderWidth:1}}>
<View style={{height:26,width:"100%",}}>
<View style={{ height: 6, width: 45, borderRadius: 100, backgroundColor: "#f0f0f0", marginVertical: 10, alignSelf: "center",}} />
</View>
<View style={{padding:10,flexDirection:"row",alignItems:"center"}}>
<Text style={{fontSize:30,fontWeight:"bold",color:"white"}}>にゃー</Text>
<View style={{flex:1}} />
{/* <TouchableOpacity style={{padding:10,backgroundColor:"white",alignContent:"center"}} onPress={() => {doFetch()}}>
<Text style={{fontSize:20,fontWeight:"bold",color:"#0099CC"}}>最新の情報へ更新</Text>
</TouchableOpacity> */}
<Text style={{fontSize:30,fontWeight:"bold",color:"white"}}>{getTime ? getTime.toLocaleTimeString('ja-JP').split(":")[0]+":"+getTime.toLocaleTimeString('ja-JP').split(":")[1]: NaN} </Text>
<Ionicons name="reload" color="white" size={30} style={{margin:5}} onPress={() => {LayoutAnimation.easeInEaseOut(),setLoadingDelayData(true)}}/>
</View>
<ScrollView>
{stationName ? stationName. ?
<AutoHeightImage source={{uri:stationName..JrHpUrl+"images/illustration.png"}} resizeMode='contain' width={wp("80%")}/>
: null : null}
{stationName ? stationName. ?
<TouchableOpacity style={{ width: wp("80%"), height: wp("80%")/20*9,borderColor:"#2E94BB",borderWidth:1,margin:10,marginHorizontal:wp("10%")}} onPress={()=> !stationName..JrHpUrl || Linking.openURL(stationName..JrHpUrl)} /* onPress={() => {StationBoardAcSR.current?.setModalVisible()}}*/>
<View style={{position:"absolute",bottom:"0%",left:"0%",width:"100%",height:'30%',backgroundColor:"#2E94BB"}} />
<Text style={{position:"absolute",top:"2%",left:"2%",fontWeight:"bold",fontSize:parseInt("30%"),color:"#2E94BB"}}>JR</Text>
<View style={{position:"absolute",alignContent:"center",alignItems:"center",top:"20%",right:'10%',width:wp("10%"),height:wp("10%"),borderColor:"#2E94BB",borderWidth:parseInt("2%"),borderRadius:parseInt("100%")}} >
<View style={{flex:1}} />
<Text style={{fontSize:parseInt("20%")}}>{stationName..StationNumber}</Text>
<View style={{flex:1}} />
</View>
<View style={{position:"absolute",top:"10%",alignContent:"center",flexDirection:"row"}}>
<View style={{flex:1}}/>
<View style={{alignItems:"center"}}>
<Text style={{fontWeight:"bold",fontSize:parseInt("15%"),color:"#005170"}}>{stationName..LineName}</Text>
<Text style={{fontWeight:"bold",fontSize:parseInt("40%"),color:"#005170"}}>{stationName..name}</Text>
<Text style={{fontWeight:"bold",fontSize:parseInt("15%"),color:"#005170"}}>{stationName..en}</Text>
</View>
<View style={{flex:1}}/>
</View>
<View style={{position:"absolute",bottom:"0%",height:"30%",width:"100%",alignItems:"center",flexDirection:"row"}}>
{stationName. ? <Text style={{fontWeight:"bold",fontSize:parseInt("20%"),color:"white",paddingHorizontal:10}}></Text> : null}
{stationName. ?
<View style={{alignContent:"center",alignItems:"center",width:wp("8%"),height:wp("8%"),margin:wp("1%"),borderColor:"white",borderWidth:parseInt("2%"),borderRadius:parseInt("100%")}} >
<View style={{flex:1}} />
<Text style={{fontSize:parseInt("10%"),color:"white"}}>{stationName..StationNumber}</Text>
<View style={{flex:1}} />
</View> : null}
<View style={{flex:1,alignItems:"flex-start"}}>
<Text style={{fontWeight:"bold",fontSize:parseInt("15%"),color:"white"}}>{stationName..name}</Text>
<Text style={{fontWeight:"bold",fontSize:parseInt("15%"),color:"white"}}>{stationName..en}</Text>
</View>
<TouchableOpacity style={{alignItems:"center"}} onPress={()=>Linking.openURL(stationName..StationTimeTable)}>
<Text style={{fontWeight:"bold",fontSize:parseInt("15%"),backgroundColor:"white",color:"#005170",padding:5}}>時刻表</Text>
</TouchableOpacity>
<View style={{flex:1,alignItems:"flex-end"}}>
<Text style={{fontWeight:"bold",fontSize:parseInt("15%"),color:"white"}}>{stationName..name}</Text>
<Text style={{fontWeight:"bold",fontSize:parseInt("15%"),color:"white"}}>{stationName..en}</Text>
</View>
{stationName..name != null ?
<View style={{alignContent:"center",alignItems:"center",width:wp("8%"),height:wp("8%"),margin:wp("1%"),borderColor:"white",borderWidth:parseInt("2%"),borderRadius:parseInt("100%")}} >
<View style={{flex:1}} />
<Text style={{fontSize:parseInt("10%"),color:"white"}}>{stationName..StationNumber}</Text>
<View style={{flex:1}} />
</View> : null}
{stationName..name != null ? <Text style={{fontWeight:"bold",fontSize:parseInt("20%"),color:"white",paddingHorizontal:10}}></Text>: null}
</View>
</TouchableOpacity>: null : null}
</ScrollView>
</View>
</ActionSheet>
</View>
);
}