起動画面設定機能を追加:6.0以降の変更点のメモを追加
This commit is contained in:
parent
08d105588f
commit
da0e8428d9
16
MenuPage.js
16
MenuPage.js
@ -21,6 +21,16 @@ export function MenuPage() {
|
||||
const { getCurrentTrain } = useCurrentTrain();
|
||||
const navigation = useNavigation();
|
||||
const { addListener } = navigation;
|
||||
useEffect(() => {
|
||||
AS.getItem("startPage")
|
||||
.then((res) => {
|
||||
if (res == "true") navigation.navigate("login");
|
||||
})
|
||||
.catch((e) => {
|
||||
//6.0以降false
|
||||
AS.setItem("startPage", "true");
|
||||
});
|
||||
}, []);
|
||||
useEffect(() => {
|
||||
const unsubscribe = addListener("tabPress", (e) => {
|
||||
AS.getItem("favoriteStation")
|
||||
@ -70,11 +80,7 @@ export function MenuPage() {
|
||||
options={{ ...optionData, gestureEnabled: false }}
|
||||
component={AllTrainDiagramView}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="howto"
|
||||
options={optionData}
|
||||
component={HowTo}
|
||||
/>
|
||||
<Stack.Screen name="howto" options={optionData} component={HowTo} />
|
||||
</Stack.Navigator>
|
||||
);
|
||||
}
|
||||
|
BIN
assets/configuration/showSetting0.jpg
Normal file
BIN
assets/configuration/showSetting0.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 146 KiB |
BIN
assets/configuration/showSetting1.jpg
Normal file
BIN
assets/configuration/showSetting1.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 49 KiB |
@ -340,6 +340,7 @@ export const EachTrainInfoCore = ({
|
||||
.then((d) => {
|
||||
if (d) setTrainPositionSwitch(d);
|
||||
})
|
||||
//6.0で変更
|
||||
.catch(() => AS.setItem("trainPositionSwitch", "false"));
|
||||
}, []);
|
||||
|
||||
|
@ -11,10 +11,11 @@ import {
|
||||
import * as Updates from "expo-updates";
|
||||
import { useWindowDimensions } from "react-native";
|
||||
import { ListItem } from "native-base";
|
||||
import { SwitchArea } from "../atom/SwitchArea";
|
||||
|
||||
const versionCode = "5.5.1";
|
||||
|
||||
export const SettingTopPage = ({ navigate, testNFC, updateAndReload }) => {
|
||||
export const SettingTopPage = ({ navigate, testNFC,startPage,setStartPage, updateAndReload }) => {
|
||||
const { width } = useWindowDimensions();
|
||||
return (
|
||||
<View style={{ height: "100%", backgroundColor: "#0099CC" }}>
|
||||
@ -100,10 +101,19 @@ export const SettingTopPage = ({ navigate, testNFC, updateAndReload }) => {
|
||||
</View>
|
||||
|
||||
<View style={{ flex: 1, borderTopWidth: 1, borderColor: "gray" }}>
|
||||
<ListItem
|
||||
<SwitchArea
|
||||
str="起動時に表示する画面"
|
||||
bool={startPage}
|
||||
setBool={setStartPage}
|
||||
falseImage={require("../../assets/configuration/showSetting0.jpg")}
|
||||
trueImage={require("../../assets/configuration/showSetting1.jpg")}
|
||||
falseText={"リンクメニュー"}
|
||||
trueText={"列車位置情報"}
|
||||
/><ListItem
|
||||
style={{ flexDirection: "row" }}
|
||||
onPress={() => navigate("FavoriteSettings")}
|
||||
>
|
||||
|
||||
<Text
|
||||
style={{
|
||||
fontSize: 20,
|
||||
|
@ -35,6 +35,7 @@ export default function Setting(props) {
|
||||
const [trainMenu, setTrainMenu] = useState(false);
|
||||
const [trainPosition, setTrainPosition] = useState(false);
|
||||
const [headerSize, setHeaderSize] = useState("default");
|
||||
const [startPage, setStartPage] = useState(false);
|
||||
useLayoutEffect(() => {
|
||||
AS.getItem("iconSwitch").then(setIconSetting);
|
||||
AS.getItem("mapSwitch").then(setMapSwitch);
|
||||
@ -43,6 +44,7 @@ export default function Setting(props) {
|
||||
AS.getItem("trainSwitch").then(setTrainMenu);
|
||||
AS.getItem("trainPositionSwitch").then(setTrainPosition);
|
||||
AS.getItem("headerSize").then(setHeaderSize);
|
||||
AS.getItem("startPage").then(setStartPage);
|
||||
}, []);
|
||||
const testNFC = async () => {
|
||||
const result = await ExpoFelicaReader.scan();
|
||||
@ -57,6 +59,7 @@ export default function Setting(props) {
|
||||
AS.setItem("trainSwitch", trainMenu.toString()),
|
||||
AS.setItem("trainPositionSwitch", trainPosition.toString()),
|
||||
AS.setItem("headerSize", headerSize),
|
||||
AS.setItem("startPage", startPage.toString()),
|
||||
]).then(() => Updates.reloadAsync());
|
||||
};
|
||||
return (
|
||||
@ -75,19 +78,9 @@ export default function Setting(props) {
|
||||
<SettingTopPage
|
||||
{...props}
|
||||
navigate={navigate}
|
||||
iconSetting={iconSetting}
|
||||
setIconSetting={setIconSetting}
|
||||
mapSwitch={mapSwitch}
|
||||
setMapSwitch={setMapSwitch}
|
||||
stationMenu={stationMenu}
|
||||
setStationMenu={setStationMenu}
|
||||
usePDFView={usePDFView}
|
||||
setUsePDFView={setUsePDFView}
|
||||
trainMenu={trainMenu}
|
||||
setTrainMenu={setTrainMenu}
|
||||
trainPosition={trainPosition}
|
||||
setTrainPosition={setTrainPosition}
|
||||
testNFC={testNFC}
|
||||
startPage={startPage}
|
||||
setStartPage={setStartPage}
|
||||
updateAndReload={updateAndReload}
|
||||
/>
|
||||
)}
|
||||
|
@ -72,6 +72,7 @@ export const TrainMenuProvider = ({ children }) => {
|
||||
//列車アイコンスイッチ
|
||||
ASCore({ k: "iconSwitch", s: setIconSetting, d: "true", u: true });
|
||||
//地図スイッチ
|
||||
//6.0.0以降true
|
||||
ASCore({ k: "mapSwitch", s: setMapSwitch, d: "false", u: true });
|
||||
//駅メニュースイッチ
|
||||
ASCore({ k: "stationSwitch", s: setStationMenu, d: "true", u: true });
|
||||
|
Loading…
Reference in New Issue
Block a user