added back handler
parent
2d70e71eff
commit
bf21a7b52a
2
App.js
2
App.js
|
@ -125,8 +125,6 @@ export function MyApp() {
|
|||
|
||||
useEffect(() => {
|
||||
const loadData = async () => {
|
||||
await AsyncStorage.removeItem("appLanguage");
|
||||
|
||||
const data = await GetMultipleData([
|
||||
"appLanguage",
|
||||
"appColorScheme",
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
"wifiStandByTitle": "WLAN im Standby",
|
||||
"wifiStandByDescription": "Die WLAN-Verbindung bleibt bestehen, auch wenn das Gerät ausgeschaltet ist. Bitte beachten Sie, dass dies zu einem erhöhten Stromverbrauch führen kann.",
|
||||
"deviceAutoBrightnessTitle": "Automatische Helligkeit",
|
||||
"deviceAutoBrightnessDescription": "Die Helligkeit des Geräts wird automatisch an die Umgebung angepasst.",
|
||||
"deviceAutoBrightnessDescription": "Die Einstellungsmöglichkeit erlaubt es Ihnen, den Bereich festzulegen, innerhalb dessen die Helligkeit des Geräts vom Helligkeitssensor berücksichtigt werden soll.",
|
||||
"deviceInformationText": "Geräteinformationen",
|
||||
"deviceNameText": "Gerätename",
|
||||
"deviceModelText": "Gerätemodell",
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
"wifiStandByTitle": "WLAN in standby",
|
||||
"wifiStandByDescription": "The WLAN connection remains established even if the device is switched off. Please note that this can lead to increased power consumption.",
|
||||
"deviceAutoBrightnessTitle": "Automatic brightness",
|
||||
"deviceAutoBrightnessDescription": "The brightness of the device is automatically adjusted to the ambient light.",
|
||||
"deviceAutoBrightnessDescription": "The setting option allows you to define the range within which the device's brightness will be taken into account by the brightness sensor.",
|
||||
"deviceInformationText": "Device information",
|
||||
"deviceNameText": "Device name",
|
||||
"deviceModelText": "Device model",
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
"expo": "~48.0.18",
|
||||
"expo-haptics": "~12.2.1",
|
||||
"expo-linear-gradient": "~12.1.2",
|
||||
"expo-splash-screen": "^0.20.5",
|
||||
"expo-splash-screen": "~0.18.2",
|
||||
"expo-status-bar": "~1.4.4",
|
||||
"i18next": "^23.2.11",
|
||||
"i18next-browser-languagedetector": "^7.1.0",
|
||||
|
@ -2314,6 +2314,77 @@
|
|||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/@expo/configure-splash-screen": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@expo/configure-splash-screen/-/configure-splash-screen-0.6.0.tgz",
|
||||
"integrity": "sha512-4DyPoNXJqx9bN4nEwF3HQreo//ECu7gDe1Xor3dnnzFm9P/VDxAKdbEhA0n+R6fgkNfT2onVHWijqvdpTS3Xew==",
|
||||
"dependencies": {
|
||||
"color-string": "^1.5.3",
|
||||
"commander": "^5.1.0",
|
||||
"fs-extra": "^9.0.0",
|
||||
"glob": "^7.1.6",
|
||||
"lodash": "^4.17.15",
|
||||
"pngjs": "^5.0.0",
|
||||
"xcode": "^3.0.0",
|
||||
"xml-js": "^1.6.11"
|
||||
},
|
||||
"bin": {
|
||||
"configure-splash-screen": "build/index-cli.js",
|
||||
"expo-splash-screen": "build/index-cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@expo/configure-splash-screen/node_modules/commander": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz",
|
||||
"integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==",
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/@expo/configure-splash-screen/node_modules/fs-extra": {
|
||||
"version": "9.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",
|
||||
"integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==",
|
||||
"dependencies": {
|
||||
"at-least-node": "^1.0.0",
|
||||
"graceful-fs": "^4.2.0",
|
||||
"jsonfile": "^6.0.1",
|
||||
"universalify": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/@expo/configure-splash-screen/node_modules/jsonfile": {
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
|
||||
"integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
|
||||
"dependencies": {
|
||||
"universalify": "^2.0.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"graceful-fs": "^4.1.6"
|
||||
}
|
||||
},
|
||||
"node_modules/@expo/configure-splash-screen/node_modules/pngjs": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz",
|
||||
"integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==",
|
||||
"engines": {
|
||||
"node": ">=10.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@expo/configure-splash-screen/node_modules/universalify": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
|
||||
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
|
||||
"engines": {
|
||||
"node": ">= 10.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@expo/dev-server": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@expo/dev-server/-/dev-server-0.3.0.tgz",
|
||||
|
@ -7332,236 +7403,17 @@
|
|||
}
|
||||
},
|
||||
"node_modules/expo-splash-screen": {
|
||||
"version": "0.20.5",
|
||||
"resolved": "https://registry.npmjs.org/expo-splash-screen/-/expo-splash-screen-0.20.5.tgz",
|
||||
"integrity": "sha512-nTALYdjHpeEA30rdOWSguxn72ctv8WM8ptuUgpfRgsWyn4i6rwYds/rBXisX69XO5fg+XjHAQqijGx/b28+3tg==",
|
||||
"version": "0.18.2",
|
||||
"resolved": "https://registry.npmjs.org/expo-splash-screen/-/expo-splash-screen-0.18.2.tgz",
|
||||
"integrity": "sha512-fsiKmyn/lbJtV6Uor6wSvl21fScOidFzmB/HHShQJJOu2TBN/vqMvhPu/r0bF5NVk8Wi64r98hiWY1EEsbW03w==",
|
||||
"dependencies": {
|
||||
"@expo/prebuild-config": "6.2.6"
|
||||
"@expo/configure-splash-screen": "^0.6.0",
|
||||
"@expo/prebuild-config": "6.0.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"expo": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/expo-splash-screen/node_modules/@babel/code-frame": {
|
||||
"version": "7.10.4",
|
||||
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz",
|
||||
"integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==",
|
||||
"dependencies": {
|
||||
"@babel/highlight": "^7.10.4"
|
||||
}
|
||||
},
|
||||
"node_modules/expo-splash-screen/node_modules/@expo/config": {
|
||||
"version": "8.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@expo/config/-/config-8.1.2.tgz",
|
||||
"integrity": "sha512-4e7hzPj50mQIlsrzOH6XZ36O094mPfPTIDIH4yv49bWNMc7GFLTofB/lcT+QyxiLaJuC0Wlk9yOLB8DIqmtwug==",
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "~7.10.4",
|
||||
"@expo/config-plugins": "~7.2.0",
|
||||
"@expo/config-types": "^49.0.0-alpha.1",
|
||||
"@expo/json-file": "^8.2.37",
|
||||
"getenv": "^1.0.0",
|
||||
"glob": "7.1.6",
|
||||
"require-from-string": "^2.0.2",
|
||||
"resolve-from": "^5.0.0",
|
||||
"semver": "7.5.3",
|
||||
"slugify": "^1.3.4",
|
||||
"sucrase": "^3.20.0"
|
||||
}
|
||||
},
|
||||
"node_modules/expo-splash-screen/node_modules/@expo/config-plugins": {
|
||||
"version": "7.2.5",
|
||||
"resolved": "https://registry.npmjs.org/@expo/config-plugins/-/config-plugins-7.2.5.tgz",
|
||||
"integrity": "sha512-w+5ccu1IxBHgyQk9CPFKLZOk8yZQEyTjbJwOzESK1eR7QwosbcsLkN1c1WWUZYiCXwORu3UTwJYll4+X2xxJhQ==",
|
||||
"dependencies": {
|
||||
"@expo/config-types": "^49.0.0-alpha.1",
|
||||
"@expo/json-file": "~8.2.37",
|
||||
"@expo/plist": "^0.0.20",
|
||||
"@expo/sdk-runtime-versions": "^1.0.0",
|
||||
"@react-native/normalize-color": "^2.0.0",
|
||||
"chalk": "^4.1.2",
|
||||
"debug": "^4.3.1",
|
||||
"find-up": "~5.0.0",
|
||||
"getenv": "^1.0.0",
|
||||
"glob": "7.1.6",
|
||||
"resolve-from": "^5.0.0",
|
||||
"semver": "^7.5.3",
|
||||
"slash": "^3.0.0",
|
||||
"xcode": "^3.0.1",
|
||||
"xml2js": "0.6.0"
|
||||
}
|
||||
},
|
||||
"node_modules/expo-splash-screen/node_modules/@expo/config-types": {
|
||||
"version": "49.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@expo/config-types/-/config-types-49.0.0.tgz",
|
||||
"integrity": "sha512-8eyREVi+K2acnMBe/rTIu1dOfyR2+AMnTLHlut+YpMV9OZPdeKV0Bs9BxAewGqBA2slslbQ9N39IS2CuTKpXkA=="
|
||||
},
|
||||
"node_modules/expo-splash-screen/node_modules/@expo/prebuild-config": {
|
||||
"version": "6.2.6",
|
||||
"resolved": "https://registry.npmjs.org/@expo/prebuild-config/-/prebuild-config-6.2.6.tgz",
|
||||
"integrity": "sha512-uFVvDAm9dPg9p1qpnr4CVnpo2hmkZIL5FQz+VlIdXXJpe7ySh/qTGHtKWY/lWUshQkAJ0nwbKGPztGWdABns/Q==",
|
||||
"dependencies": {
|
||||
"@expo/config": "~8.1.0",
|
||||
"@expo/config-plugins": "~7.2.0",
|
||||
"@expo/config-types": "^49.0.0-alpha.1",
|
||||
"@expo/image-utils": "0.3.22",
|
||||
"@expo/json-file": "^8.2.37",
|
||||
"debug": "^4.3.1",
|
||||
"fs-extra": "^9.0.0",
|
||||
"resolve-from": "^5.0.0",
|
||||
"semver": "7.5.3",
|
||||
"xml2js": "0.6.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"expo-modules-autolinking": ">=0.8.1"
|
||||
}
|
||||
},
|
||||
"node_modules/expo-splash-screen/node_modules/ansi-styles": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
||||
"dependencies": {
|
||||
"color-convert": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/expo-splash-screen/node_modules/chalk": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
||||
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
||||
"dependencies": {
|
||||
"ansi-styles": "^4.1.0",
|
||||
"supports-color": "^7.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/chalk?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/expo-splash-screen/node_modules/color-convert": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
||||
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
||||
"dependencies": {
|
||||
"color-name": "~1.1.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/expo-splash-screen/node_modules/color-name": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
||||
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
|
||||
},
|
||||
"node_modules/expo-splash-screen/node_modules/fs-extra": {
|
||||
"version": "9.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",
|
||||
"integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==",
|
||||
"dependencies": {
|
||||
"at-least-node": "^1.0.0",
|
||||
"graceful-fs": "^4.2.0",
|
||||
"jsonfile": "^6.0.1",
|
||||
"universalify": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/expo-splash-screen/node_modules/has-flag": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
||||
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/expo-splash-screen/node_modules/jsonfile": {
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
|
||||
"integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
|
||||
"dependencies": {
|
||||
"universalify": "^2.0.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"graceful-fs": "^4.1.6"
|
||||
}
|
||||
},
|
||||
"node_modules/expo-splash-screen/node_modules/lru-cache": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
|
||||
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
|
||||
"dependencies": {
|
||||
"yallist": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/expo-splash-screen/node_modules/semver": {
|
||||
"version": "7.5.3",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz",
|
||||
"integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==",
|
||||
"dependencies": {
|
||||
"lru-cache": "^6.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/expo-splash-screen/node_modules/supports-color": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
||||
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
||||
"dependencies": {
|
||||
"has-flag": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/expo-splash-screen/node_modules/universalify": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
|
||||
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
|
||||
"engines": {
|
||||
"node": ">= 10.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/expo-splash-screen/node_modules/xml2js": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.6.0.tgz",
|
||||
"integrity": "sha512-eLTh0kA8uHceqesPqSE+VvO1CDDJWMwlQfB6LuN6T8w6MaDJ8Txm8P7s5cHD0miF0V+GGTZrDQfxPZQVsur33w==",
|
||||
"dependencies": {
|
||||
"sax": ">=0.6.0",
|
||||
"xmlbuilder": "~11.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/expo-splash-screen/node_modules/xmlbuilder": {
|
||||
"version": "11.0.1",
|
||||
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz",
|
||||
"integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==",
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/expo-splash-screen/node_modules/yallist": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
|
||||
},
|
||||
"node_modules/expo-status-bar": {
|
||||
"version": "1.4.4",
|
||||
"resolved": "https://registry.npmjs.org/expo-status-bar/-/expo-status-bar-1.4.4.tgz",
|
||||
|
@ -14320,6 +14172,17 @@
|
|||
"uuid": "dist/bin/uuid"
|
||||
}
|
||||
},
|
||||
"node_modules/xml-js": {
|
||||
"version": "1.6.11",
|
||||
"resolved": "https://registry.npmjs.org/xml-js/-/xml-js-1.6.11.tgz",
|
||||
"integrity": "sha512-7rVi2KMfwfWFl+GpPg6m80IVMWXLRjO+PxTq7V2CDhoGak0wzYzFgUY2m4XJ47OGdXd8eLE8EmwfAmdjw7lC1g==",
|
||||
"dependencies": {
|
||||
"sax": "^1.2.4"
|
||||
},
|
||||
"bin": {
|
||||
"xml-js": "bin/cli.js"
|
||||
}
|
||||
},
|
||||
"node_modules/xml2js": {
|
||||
"version": "0.4.23",
|
||||
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz",
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
"expo": "~48.0.18",
|
||||
"expo-haptics": "~12.2.1",
|
||||
"expo-linear-gradient": "~12.1.2",
|
||||
"expo-splash-screen": "^0.20.5",
|
||||
"expo-splash-screen": "~0.18.2",
|
||||
"expo-status-bar": "~1.4.4",
|
||||
"i18next": "^23.2.11",
|
||||
"i18next-browser-languagedetector": "^7.1.0",
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
import { useContext, useState } from "react";
|
||||
import { Image, View, Text, Alert } from "react-native";
|
||||
import { AppContext, AppStyles } from "../../utils";
|
||||
import { useCallback, useContext, useEffect, useState } from "react";
|
||||
import { Image, View, Text, Alert, BackHandler } from "react-native";
|
||||
import { AppContext, AppSelectedUserDevice, AppStyles } from "../../utils";
|
||||
import SettingsView from "./settings";
|
||||
import SceneView from "./scene";
|
||||
import {
|
||||
MyDeviceTabButton,
|
||||
MyDeviceTabButtonContainer,
|
||||
} from "./deviceTabButton";
|
||||
import { useFocusEffect } from "@react-navigation/native";
|
||||
|
||||
export default function DeviceScreen({ navigation }) {
|
||||
const appContext = useContext(AppContext);
|
||||
|
@ -29,6 +30,57 @@ export default function DeviceScreen({ navigation }) {
|
|||
: appContext.appTheme.icon;
|
||||
};
|
||||
|
||||
useFocusEffect(
|
||||
useCallback(() => {
|
||||
const onBackPress = () => {
|
||||
if (selectedView === 0) {
|
||||
// This will switch from the device settings to the device scene view
|
||||
console.log("set selected view");
|
||||
setSelectedView(2);
|
||||
return true;
|
||||
}
|
||||
|
||||
// This will close the app if the user is on the device screen on the scence view
|
||||
BackHandler.exitApp();
|
||||
return true;
|
||||
};
|
||||
|
||||
BackHandler.addEventListener("hardwareBackPress", onBackPress);
|
||||
|
||||
return () =>
|
||||
BackHandler.removeEventListener("hardwareBackPress", onBackPress);
|
||||
}, [selectedView])
|
||||
);
|
||||
|
||||
/*
|
||||
useFocusEffect(
|
||||
useCallback(() => {
|
||||
console.log("open", AppSelectedUserDevice.current);
|
||||
|
||||
const onBackPress = () => {
|
||||
if (selectedView === 0) {
|
||||
console.log("set selected view");
|
||||
setSelectedView(2);
|
||||
return true;
|
||||
} else {
|
||||
console.log("false");
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
const subscription = BackHandler.addEventListener(
|
||||
"hardwareBackPress",
|
||||
onBackPress
|
||||
);
|
||||
|
||||
return () => {
|
||||
console.log("close");
|
||||
//subscription.remove();
|
||||
BackHandler.removeEventListener("hardwareBackPress", onBackPress);
|
||||
};
|
||||
}, [selectedView])
|
||||
); */
|
||||
|
||||
return (
|
||||
<View
|
||||
style={{
|
||||
|
|
Loading…
Reference in New Issue