diff --git a/App.tsx b/App.tsx
index 84300af..6cf58d6 100644
--- a/App.tsx
+++ b/App.tsx
@@ -5,36 +5,17 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
import BinaryClockScreen from './src/pages/BinaryClockScreen';
-import BinaryClockSettingsScreen from './src/pages/BinaryClockSettingsScreen';
-import {NavigationContainer} from '@react-navigation/native';
+import KeepAwake from '@sayem314/react-native-keep-awake';
import React from 'react';
-import Toast from 'react-native-toast-message';
-import {createNativeStackNavigator} from '@react-navigation/native-stack';
+import { StatusBar } from 'react-native';
-const Stack = createNativeStackNavigator();
-
-const App = () => {
+const App = () => {
return (
-
-
-
-
-
-
-
+ <>
+
+
+
+ >
);
};
diff --git a/ios/BinaryClock.xcodeproj/project.pbxproj b/ios/BinaryClock.xcodeproj/project.pbxproj
index 18b8d6c..6f37f32 100644
--- a/ios/BinaryClock.xcodeproj/project.pbxproj
+++ b/ios/BinaryClock.xcodeproj/project.pbxproj
@@ -191,14 +191,10 @@
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-BinaryClock/Pods-BinaryClock-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
- inputPaths = (
- );
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-BinaryClock/Pods-BinaryClock-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
- outputPaths = (
- );
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-BinaryClock/Pods-BinaryClock-frameworks.sh\"\n";
@@ -234,14 +230,10 @@
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-BinaryClock/Pods-BinaryClock-resources-${CONFIGURATION}-input-files.xcfilelist",
);
- inputPaths = (
- );
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-BinaryClock/Pods-BinaryClock-resources-${CONFIGURATION}-output-files.xcfilelist",
);
- outputPaths = (
- );
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-BinaryClock/Pods-BinaryClock-resources.sh\"\n";
@@ -388,7 +380,10 @@
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
);
- OTHER_LDFLAGS = "$(inherited) ";
+ OTHER_LDFLAGS = (
+ "$(inherited)",
+ " ",
+ );
PRODUCT_NAME = "Binary Clock";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
@@ -458,7 +453,10 @@
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
);
- OTHER_LDFLAGS = "$(inherited) ";
+ OTHER_LDFLAGS = (
+ "$(inherited)",
+ " ",
+ );
PRODUCT_NAME = "Binary Clock";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
diff --git a/ios/Podfile.lock b/ios/Podfile.lock
index 7ebe44a..cc79402 100644
--- a/ios/Podfile.lock
+++ b/ios/Podfile.lock
@@ -1247,72 +1247,6 @@ PODS:
- React-Core
- React-RCTFabric
- ReactCommon/turbomodule/core
- - react-native-safe-area-context (5.4.1):
- - DoubleConversion
- - glog
- - hermes-engine
- - RCT-Folly (= 2024.11.18.00)
- - RCTRequired
- - RCTTypeSafety
- - React-Core
- - React-debug
- - React-Fabric
- - React-featureflags
- - React-graphics
- - React-ImageManager
- - react-native-safe-area-context/common (= 5.4.1)
- - react-native-safe-area-context/fabric (= 5.4.1)
- - React-NativeModulesApple
- - React-RCTFabric
- - React-rendererdebug
- - React-utils
- - ReactCodegen
- - ReactCommon/turbomodule/bridging
- - ReactCommon/turbomodule/core
- - Yoga
- - react-native-safe-area-context/common (5.4.1):
- - DoubleConversion
- - glog
- - hermes-engine
- - RCT-Folly (= 2024.11.18.00)
- - RCTRequired
- - RCTTypeSafety
- - React-Core
- - React-debug
- - React-Fabric
- - React-featureflags
- - React-graphics
- - React-ImageManager
- - React-NativeModulesApple
- - React-RCTFabric
- - React-rendererdebug
- - React-utils
- - ReactCodegen
- - ReactCommon/turbomodule/bridging
- - ReactCommon/turbomodule/core
- - Yoga
- - react-native-safe-area-context/fabric (5.4.1):
- - DoubleConversion
- - glog
- - hermes-engine
- - RCT-Folly (= 2024.11.18.00)
- - RCTRequired
- - RCTTypeSafety
- - React-Core
- - React-debug
- - React-Fabric
- - React-featureflags
- - React-graphics
- - React-ImageManager
- - react-native-safe-area-context/common
- - React-NativeModulesApple
- - React-RCTFabric
- - React-rendererdebug
- - React-utils
- - ReactCodegen
- - ReactCommon/turbomodule/bridging
- - ReactCommon/turbomodule/core
- - Yoga
- react-native-slider (4.5.7):
- DoubleConversion
- glog
@@ -1645,51 +1579,6 @@ PODS:
- React-utils (= 0.78.2)
- RNDefaultPreference (1.4.4):
- React-Core
- - RNScreens (4.11.1):
- - DoubleConversion
- - glog
- - hermes-engine
- - RCT-Folly (= 2024.11.18.00)
- - RCTRequired
- - RCTTypeSafety
- - React-Core
- - React-debug
- - React-Fabric
- - React-featureflags
- - React-graphics
- - React-ImageManager
- - React-NativeModulesApple
- - React-RCTFabric
- - React-RCTImage
- - React-rendererdebug
- - React-utils
- - ReactCodegen
- - ReactCommon/turbomodule/bridging
- - ReactCommon/turbomodule/core
- - RNScreens/common (= 4.11.1)
- - Yoga
- - RNScreens/common (4.11.1):
- - DoubleConversion
- - glog
- - hermes-engine
- - RCT-Folly (= 2024.11.18.00)
- - RCTRequired
- - RCTTypeSafety
- - React-Core
- - React-debug
- - React-Fabric
- - React-featureflags
- - React-graphics
- - React-ImageManager
- - React-NativeModulesApple
- - React-RCTFabric
- - React-RCTImage
- - React-rendererdebug
- - React-utils
- - ReactCodegen
- - ReactCommon/turbomodule/bridging
- - ReactCommon/turbomodule/core
- - Yoga
- SocketRocket (0.7.1)
- Yoga (0.0.0)
@@ -1734,7 +1623,6 @@ DEPENDENCIES:
- React-Mapbuffer (from `../node_modules/react-native/ReactCommon`)
- React-microtasksnativemodule (from `../node_modules/react-native/ReactCommon/react/nativemodule/microtasks`)
- "react-native-keep-awake (from `../node_modules/@sayem314/react-native-keep-awake`)"
- - react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
- "react-native-slider (from `../node_modules/@react-native-community/slider`)"
- React-NativeModulesApple (from `../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`)
- React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
@@ -1765,7 +1653,6 @@ DEPENDENCIES:
- ReactCodegen (from `build/generated/ios`)
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- RNDefaultPreference (from `../node_modules/react-native-default-preference`)
- - RNScreens (from `../node_modules/react-native-screens`)
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
SPEC REPOS:
@@ -1851,8 +1738,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/react/nativemodule/microtasks"
react-native-keep-awake:
:path: "../node_modules/@sayem314/react-native-keep-awake"
- react-native-safe-area-context:
- :path: "../node_modules/react-native-safe-area-context"
react-native-slider:
:path: "../node_modules/@react-native-community/slider"
React-NativeModulesApple:
@@ -1913,8 +1798,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon"
RNDefaultPreference:
:path: "../node_modules/react-native-default-preference"
- RNScreens:
- :path: "../node_modules/react-native-screens"
Yoga:
:path: "../node_modules/react-native/ReactCommon/yoga"
@@ -1958,7 +1841,6 @@ SPEC CHECKSUMS:
React-Mapbuffer: b588d1ca18d2ce626f868f04ab12d8b1f004f12c
React-microtasksnativemodule: 11831d070aa47755bb5739069eb04ec621fec548
react-native-keep-awake: 5fb94de503761b67af1bec52f83e18d66e9abaf3
- react-native-safe-area-context: b6552f52e87c808d4e20da0c216e3206831b58ba
react-native-slider: 27263d134d55db948a4706f1e47d0ec88fb354dd
React-NativeModulesApple: 79a4404ac301b40bec3b367879c5e9a9ce81683c
React-perflogger: 0ea25c109dba33d47dec36b2634bf7ea67c1a555
@@ -1989,7 +1871,6 @@ SPEC CHECKSUMS:
ReactCodegen: 78b64f0ad96ef733616f54d0c20923f6c67287fd
ReactCommon: 547db015202a80a5b3e7e041586ea54c4a087180
RNDefaultPreference: 08bdb06cfa9188d5da97d4642dac745218d7fb31
- RNScreens: 7a4eb8a0fe4dc5537e10559ddedc4709a9cd0561
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
Yoga: e14bad835e12b6c7e2260fc320bd00e0f4b45add
diff --git a/package-lock.json b/package-lock.json
index fc3e521..5a703d2 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -9,16 +9,11 @@
"version": "0.0.1",
"dependencies": {
"@react-native-community/slider": "^4.5.7",
- "@react-navigation/native": "^7.1.10",
- "@react-navigation/native-stack": "^7.3.14",
"@sayem314/react-native-keep-awake": "^1.3.1",
"lodash": "^4.17.21",
"react": "19.0.0",
"react-native": "0.78.2",
- "react-native-default-preference": "^1.4.4",
- "react-native-safe-area-context": "^5.4.1",
- "react-native-screens": "^4.11.1",
- "react-native-toast-message": "^2.3.0"
+ "react-native-default-preference": "^1.4.4"
},
"devDependencies": {
"@babel/core": "^7.25.2",
@@ -3368,94 +3363,6 @@
}
}
},
- "node_modules/@react-navigation/core": {
- "version": "7.10.0",
- "resolved": "https://registry.npmjs.org/@react-navigation/core/-/core-7.10.0.tgz",
- "integrity": "sha512-qZBA5gGm+9liT4+EHk+kl9apwvqh7HqhLF1XeX6SQRmC/n2QI0u1B8OevKc+EPUDEM9Od15IuwT/GRbSs7/Umw==",
- "license": "MIT",
- "dependencies": {
- "@react-navigation/routers": "^7.4.0",
- "escape-string-regexp": "^4.0.0",
- "nanoid": "^3.3.11",
- "query-string": "^7.1.3",
- "react-is": "^19.1.0",
- "use-latest-callback": "^0.2.3",
- "use-sync-external-store": "^1.5.0"
- },
- "peerDependencies": {
- "react": ">= 18.2.0"
- }
- },
- "node_modules/@react-navigation/core/node_modules/react-is": {
- "version": "19.1.0",
- "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.1.0.tgz",
- "integrity": "sha512-Oe56aUPnkHyyDxxkvqtd7KkdQP5uIUfHxd5XTb3wE9d/kRnZLmKbDB0GWk919tdQ+mxxPtG6EAs6RMT6i1qtHg==",
- "license": "MIT"
- },
- "node_modules/@react-navigation/elements": {
- "version": "2.4.3",
- "resolved": "https://registry.npmjs.org/@react-navigation/elements/-/elements-2.4.3.tgz",
- "integrity": "sha512-psoNmnZ0DQIt9nxxPITVLtYW04PGCAfnmd/Pcd3yhiBs93aj+HYKH+SDZDpUnXMf3BN7Wvo4+jPI+/Xjqb+m9w==",
- "license": "MIT",
- "dependencies": {
- "color": "^4.2.3"
- },
- "peerDependencies": {
- "@react-native-masked-view/masked-view": ">= 0.2.0",
- "@react-navigation/native": "^7.1.10",
- "react": ">= 18.2.0",
- "react-native": "*",
- "react-native-safe-area-context": ">= 4.0.0"
- },
- "peerDependenciesMeta": {
- "@react-native-masked-view/masked-view": {
- "optional": true
- }
- }
- },
- "node_modules/@react-navigation/native": {
- "version": "7.1.10",
- "resolved": "https://registry.npmjs.org/@react-navigation/native/-/native-7.1.10.tgz",
- "integrity": "sha512-Ug4IML0DkAxZTMF/E7lyyLXSclkGAYElY2cxZWITwfBjtlVeda0NjsdnTWY5EGjnd7bwvhTIUC+CO6qSlrDn5A==",
- "license": "MIT",
- "dependencies": {
- "@react-navigation/core": "^7.10.0",
- "escape-string-regexp": "^4.0.0",
- "fast-deep-equal": "^3.1.3",
- "nanoid": "^3.3.11",
- "use-latest-callback": "^0.2.3"
- },
- "peerDependencies": {
- "react": ">= 18.2.0",
- "react-native": "*"
- }
- },
- "node_modules/@react-navigation/native-stack": {
- "version": "7.3.14",
- "resolved": "https://registry.npmjs.org/@react-navigation/native-stack/-/native-stack-7.3.14.tgz",
- "integrity": "sha512-45Sf7ReqSCIySXS5nrKtLGmNlFXm5x+u32YQMwKDONCqVGOBCfo4ryKqeQq1EMJ7Py6IDyOwHMhA+jhNOxnfPw==",
- "license": "MIT",
- "dependencies": {
- "@react-navigation/elements": "^2.4.3",
- "warn-once": "^0.1.1"
- },
- "peerDependencies": {
- "@react-navigation/native": "^7.1.10",
- "react": ">= 18.2.0",
- "react-native": "*",
- "react-native-safe-area-context": ">= 4.0.0",
- "react-native-screens": ">= 4.0.0"
- }
- },
- "node_modules/@react-navigation/routers": {
- "version": "7.4.0",
- "resolved": "https://registry.npmjs.org/@react-navigation/routers/-/routers-7.4.0.tgz",
- "integrity": "sha512-th5THnuWKJlmr7GGHiicy979di11ycDWub9iIXbEDvQwmwmsRzppmVbfs2nD8bC/MgyMgqWu/gxfys+HqN+kcw==",
- "license": "MIT",
- "dependencies": {
- "nanoid": "^3.3.11"
- }
- },
"node_modules/@sayem314/react-native-keep-awake": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/@sayem314/react-native-keep-awake/-/react-native-keep-awake-1.3.1.tgz",
@@ -4935,19 +4842,6 @@
"dev": true,
"license": "MIT"
},
- "node_modules/color": {
- "version": "4.2.3",
- "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz",
- "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==",
- "license": "MIT",
- "dependencies": {
- "color-convert": "^2.0.1",
- "color-string": "^1.9.0"
- },
- "engines": {
- "node": ">=12.5.0"
- }
- },
"node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
@@ -4966,16 +4860,6 @@
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"license": "MIT"
},
- "node_modules/color-string": {
- "version": "1.9.1",
- "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz",
- "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==",
- "license": "MIT",
- "dependencies": {
- "color-name": "^1.0.0",
- "simple-swizzle": "^0.2.2"
- }
- },
"node_modules/colorette": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz",
@@ -5269,15 +5153,6 @@
"node": ">=0.10.0"
}
},
- "node_modules/decode-uri-component": {
- "version": "0.2.2",
- "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz",
- "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==",
- "license": "MIT",
- "engines": {
- "node": ">=0.10"
- }
- },
"node_modules/dedent": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/dedent/-/dedent-1.6.0.tgz",
@@ -6431,6 +6306,7 @@
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
+ "dev": true,
"license": "MIT"
},
"node_modules/fast-glob": {
@@ -6539,15 +6415,6 @@
"node": ">=8"
}
},
- "node_modules/filter-obj": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz",
- "integrity": "sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ==",
- "license": "MIT",
- "engines": {
- "node": ">=0.10.0"
- }
- },
"node_modules/finalhandler": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz",
@@ -9984,24 +9851,6 @@
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
"license": "MIT"
},
- "node_modules/nanoid": {
- "version": "3.3.11",
- "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz",
- "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==",
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/ai"
- }
- ],
- "license": "MIT",
- "bin": {
- "nanoid": "bin/nanoid.cjs"
- },
- "engines": {
- "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
- }
- },
"node_modules/natural-compare": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
@@ -10730,24 +10579,6 @@
],
"license": "MIT"
},
- "node_modules/query-string": {
- "version": "7.1.3",
- "resolved": "https://registry.npmjs.org/query-string/-/query-string-7.1.3.tgz",
- "integrity": "sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg==",
- "license": "MIT",
- "dependencies": {
- "decode-uri-component": "^0.2.2",
- "filter-obj": "^1.1.0",
- "split-on-first": "^1.0.0",
- "strict-uri-encode": "^2.0.0"
- },
- "engines": {
- "node": ">=6"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
"node_modules/queue": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/queue/-/queue-6.0.2.tgz",
@@ -10827,18 +10658,6 @@
}
}
},
- "node_modules/react-freeze": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/react-freeze/-/react-freeze-1.0.4.tgz",
- "integrity": "sha512-r4F0Sec0BLxWicc7HEyo2x3/2icUTrRmDjaaRyzzn+7aDyFZliszMDOgLVwSnQnYENOlL1o569Ze2HZefk8clA==",
- "license": "MIT",
- "engines": {
- "node": ">=10"
- },
- "peerDependencies": {
- "react": ">=17.0.0"
- }
- },
"node_modules/react-is": {
"version": "17.0.2",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
@@ -10914,51 +10733,6 @@
"react-native": ">=0.47.0"
}
},
- "node_modules/react-native-is-edge-to-edge": {
- "version": "1.1.7",
- "resolved": "https://registry.npmjs.org/react-native-is-edge-to-edge/-/react-native-is-edge-to-edge-1.1.7.tgz",
- "integrity": "sha512-EH6i7E8epJGIcu7KpfXYXiV2JFIYITtq+rVS8uEb+92naMRBdxhTuS8Wn2Q7j9sqyO0B+Xbaaf9VdipIAmGW4w==",
- "license": "MIT",
- "peerDependencies": {
- "react": "*",
- "react-native": "*"
- }
- },
- "node_modules/react-native-safe-area-context": {
- "version": "5.4.1",
- "resolved": "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-5.4.1.tgz",
- "integrity": "sha512-x+g3NblZ9jof8y+XkVvaGlpMrSlixhrJJ33BRzhTAKUKctQVecO1heSXmzxc5UdjvGYBKS6kPZVUw2b8NxHcPg==",
- "license": "MIT",
- "peerDependencies": {
- "react": "*",
- "react-native": "*"
- }
- },
- "node_modules/react-native-screens": {
- "version": "4.11.1",
- "resolved": "https://registry.npmjs.org/react-native-screens/-/react-native-screens-4.11.1.tgz",
- "integrity": "sha512-F0zOzRVa3ptZfLpD0J8ROdo+y1fEPw+VBFq1MTY/iyDu08al7qFUO5hLMd+EYMda5VXGaTFCa8q7bOppUszhJw==",
- "license": "MIT",
- "dependencies": {
- "react-freeze": "^1.0.0",
- "react-native-is-edge-to-edge": "^1.1.7",
- "warn-once": "^0.1.0"
- },
- "peerDependencies": {
- "react": "*",
- "react-native": "*"
- }
- },
- "node_modules/react-native-toast-message": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/react-native-toast-message/-/react-native-toast-message-2.3.0.tgz",
- "integrity": "sha512-d7LldTK1ei1Bl7RFhoOYw8hVQ4oKPQHORYI//xR9Pyz3HxSlFlvQbueE5X3KLoemRRgBrOUg3zY6DxXnxrVLRg==",
- "license": "MIT",
- "peerDependencies": {
- "react": "*",
- "react-native": "*"
- }
- },
"node_modules/react-native/node_modules/ansi-styles": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz",
@@ -11738,21 +11512,6 @@
"integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",
"license": "ISC"
},
- "node_modules/simple-swizzle": {
- "version": "0.2.2",
- "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz",
- "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==",
- "license": "MIT",
- "dependencies": {
- "is-arrayish": "^0.3.1"
- }
- },
- "node_modules/simple-swizzle/node_modules/is-arrayish": {
- "version": "0.3.2",
- "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz",
- "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==",
- "license": "MIT"
- },
"node_modules/sisteransi": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz",
@@ -11834,15 +11593,6 @@
"source-map": "^0.6.0"
}
},
- "node_modules/split-on-first": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz",
- "integrity": "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==",
- "license": "MIT",
- "engines": {
- "node": ">=6"
- }
- },
"node_modules/sprintf-js": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
@@ -11920,15 +11670,6 @@
"node": ">= 0.4"
}
},
- "node_modules/strict-uri-encode": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz",
- "integrity": "sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ==",
- "license": "MIT",
- "engines": {
- "node": ">=4"
- }
- },
"node_modules/string_decoder": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
@@ -12625,24 +12366,6 @@
"punycode": "^2.1.0"
}
},
- "node_modules/use-latest-callback": {
- "version": "0.2.3",
- "resolved": "https://registry.npmjs.org/use-latest-callback/-/use-latest-callback-0.2.3.tgz",
- "integrity": "sha512-7vI3fBuyRcP91pazVboc4qu+6ZqM8izPWX9k7cRnT8hbD5svslcknsh3S9BUhaK11OmgTV4oWZZVSeQAiV53SQ==",
- "license": "MIT",
- "peerDependencies": {
- "react": ">=16.8"
- }
- },
- "node_modules/use-sync-external-store": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.5.0.tgz",
- "integrity": "sha512-Rb46I4cGGVBmjamjphe8L/UnvJD+uPPtTkNvX5mZgqdbavhI4EbgIWJiIHXJ8bc/i9EQGPRh4DwEURJ552Do0A==",
- "license": "MIT",
- "peerDependencies": {
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
- }
- },
"node_modules/util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
@@ -12699,12 +12422,6 @@
"makeerror": "1.0.12"
}
},
- "node_modules/warn-once": {
- "version": "0.1.1",
- "resolved": "https://registry.npmjs.org/warn-once/-/warn-once-0.1.1.tgz",
- "integrity": "sha512-VkQZJbO8zVImzYFteBXvBOZEl1qL175WH8VmZcxF2fZAoudNhNDvHi+doCaAEdU2l2vtcIwa2zn0QK5+I1HQ3Q==",
- "license": "MIT"
- },
"node_modules/wcwidth": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz",
diff --git a/package.json b/package.json
index f8e0a47..22d9162 100644
--- a/package.json
+++ b/package.json
@@ -12,16 +12,11 @@
},
"dependencies": {
"@react-native-community/slider": "^4.5.7",
- "@react-navigation/native": "^7.1.10",
- "@react-navigation/native-stack": "^7.3.14",
"@sayem314/react-native-keep-awake": "^1.3.1",
"lodash": "^4.17.21",
"react": "19.0.0",
"react-native": "0.78.2",
- "react-native-default-preference": "^1.4.4",
- "react-native-safe-area-context": "^5.4.1",
- "react-native-screens": "^4.11.1",
- "react-native-toast-message": "^2.3.0"
+ "react-native-default-preference": "^1.4.4"
},
"devDependencies": {
"@babel/core": "^7.25.2",
diff --git a/src/components/settings/SettingBoolean.tsx b/src/components/settings/SettingBoolean.tsx
index ce0f9ac..5331278 100644
--- a/src/components/settings/SettingBoolean.tsx
+++ b/src/components/settings/SettingBoolean.tsx
@@ -3,27 +3,34 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
-import {Switch} from 'react-native';
-import React from 'react';
+
+import React, {useCallback} from 'react';
+
import SettingItem from './SettingItem';
+import {Switch} from 'react-native';
type Props = {
title: string;
subtitle: string;
initialValue: boolean;
onValueChange: (value: boolean) => void;
+ onValueSet: (value: boolean) => void;
};
const SettingBoolean = (props: Props) => {
+ const onValueChange = useCallback(
+ (value: boolean) => {
+ props.onValueChange(value);
+ props.onValueSet(value);
+ },
+ [props.onValueChange, props.onValueSet],
+ );
return (
+
}
/>
);
diff --git a/src/components/settings/SettingItem.tsx b/src/components/settings/SettingItem.tsx
index 9d98add..713bfcb 100644
--- a/src/components/settings/SettingItem.tsx
+++ b/src/components/settings/SettingItem.tsx
@@ -5,6 +5,7 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
import {StyleSheet, Text, View} from 'react-native';
+
import React from 'react';
type Props = {
@@ -46,13 +47,13 @@ const styles = StyleSheet.create({
flex: 3,
},
title: {
- color: 'black',
+ color: 'white',
fontSize: 20,
fontWeight: 'bold',
marginBottom: 10,
},
subtitle: {
- color: 'black',
+ color: 'white',
marginBottom: 10,
},
right: {
diff --git a/src/components/settings/SettingRange.tsx b/src/components/settings/SettingRange.tsx
index 315c89d..494bd35 100644
--- a/src/components/settings/SettingRange.tsx
+++ b/src/components/settings/SettingRange.tsx
@@ -14,6 +14,7 @@ import debounce from 'lodash/debounce';
type Props = {
title: string;
onValueChange: (value: number) => void;
+ onValueSet: (value: number) => void;
subtitle?: string;
caption?: string;
initialValue?: number;
@@ -33,7 +34,7 @@ const propDefaults = {
const SettingRange = (props: Props) => {
// eslint-disable-next-line react-hooks/exhaustive-deps
const onValueChange = useCallback(
- debounce(props.onValueChange, 25, {leading: true, trailing: true}),
+ debounce(props.onValueChange, 5, {leading: true, trailing: true}),
[props.onValueChange],
);
const args = {...propDefaults, ...props};
@@ -46,6 +47,7 @@ const SettingRange = (props: Props) => {
{
const styles = StyleSheet.create({
caption: {
- color: 'black',
+ color: 'white',
},
});
diff --git a/src/pages/BinaryClockScreen.tsx b/src/pages/BinaryClockScreen.tsx
index a9cfd30..b8729fa 100644
--- a/src/pages/BinaryClockScreen.tsx
+++ b/src/pages/BinaryClockScreen.tsx
@@ -4,52 +4,159 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
-import {Pressable, StatusBar, View, useWindowDimensions} from 'react-native';
-import React, {useEffect} from 'react';
import {
+ BinaryClockSettings,
useBrightness,
useRoundness,
useShowHints,
} from '../utils/BinaryClockSettings';
+import {
+ Pressable,
+ SafeAreaView,
+ ScrollView,
+ StyleSheet,
+ View,
+ useWindowDimensions,
+} from 'react-native';
+import React, {useCallback, useState} from 'react';
import BinaryClock from '../components/BinaryClock';
-import KeepAwake from '@sayem314/react-native-keep-awake';
import Orientation from '../utils/orientation';
-import Toast from 'react-native-toast-message';
+import SettingBoolean from '../components/settings/SettingBoolean';
+import SettingRange from '../components/settings/SettingRange';
-const BinaryClockScreen: React.FC<{
- navigation: any;
-}> = ({navigation}) => {
- const [brightness] = useBrightness();
- const [roundness] = useRoundness();
- const [showHints] = useShowHints();
+const BinaryClockScreen: React.FC = () => {
+ const [showSettings, setShowSettings] = useState<{
+ value: boolean;
+ updated: Date;
+ }>({value: false, updated: new Date()});
+ const toggleSettings = useCallback(
+ () => setShowSettings({value: !showSettings.value, updated: new Date()}),
+ [showSettings],
+ );
const {height, width} = useWindowDimensions();
- let orientation =
- height > width ? Orientation.Portrait : Orientation.Landscape;
- useEffect(() => {
- Toast.show({
- type: 'info',
- text1: '⚙️ Settings Available ⚙️',
- text2: 'Access settings by pressing and holding the clock',
- visibilityTime: 10000,
- });
- }, []);
+ const [brightness, setBrightness] = useBrightness();
+ const brightnessString = `${Math.round(brightness * 100)}%`;
+ const [roundness, setRoundness] = useRoundness();
+ const roundnessString = `${Math.round(roundness * 100)}%`;
+ const [showHints, setShowHints] = useShowHints();
+ return (
+
+ width ? 'column' : 'row'},
+ ]}>
+
+
+
+ {showSettings.value && (
+
+
+
+ {}}
+ onValueSet={BinaryClockSettings.setShowHints}
+ initialValue={showHints}
+ />
+
+ )}
+
+
+ );
+};
+
+function Clock({
+ brightness,
+ roundness,
+ showHints,
+ lastAspectUpdate,
+}: {
+ brightness: number;
+ roundness: number;
+ showHints: boolean;
+ lastAspectUpdate: Date;
+}) {
+ const [layout, setLayout] = useState({
+ height: 0,
+ width: 0,
+ date: new Date(0),
+ });
+ const showClock =
+ layout.height > 0 &&
+ layout.width > 0 &&
+ layout.date.getTime() > lastAspectUpdate.getTime();
+ const orientation =
+ layout.height > layout.width ? Orientation.Portrait : Orientation.Landscape;
return (
- navigation.navigate('BinaryClockSettingsScreen')}>
-
-
- {/* @ts-ignore */}
-
+ {
+ setLayout({
+ height: nativeEvent.layout.height,
+ width: nativeEvent.layout.width,
+ date: new Date(),
+ });
+ }}>
+ {!showClock ? (
+
+ ) : (
-
-
+ )}
+
);
-};
+}
+
+const styles = StyleSheet.create({
+ container: {
+ height: '100%',
+ },
+ clockPreview: {
+ flex: 2,
+ },
+ settingsContainer: {
+ flex: 3,
+ },
+ settingsContentContainer: {
+ padding: 20,
+ justifyContent: 'flex-start',
+ },
+ label: {
+ fontSize: 20,
+ fontWeight: 'bold',
+ marginBottom: 10,
+ },
+ description: {
+ marginBottom: 10,
+ },
+});
export default BinaryClockScreen;
diff --git a/src/pages/BinaryClockSettingsScreen.tsx b/src/pages/BinaryClockSettingsScreen.tsx
deleted file mode 100644
index 2e8947d..0000000
--- a/src/pages/BinaryClockSettingsScreen.tsx
+++ /dev/null
@@ -1,122 +0,0 @@
-// Copyright (c) 2022 Joseph Hale
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this
-// file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-import {
- BinaryClockSettings,
- useBrightness,
- useRoundness,
- useShowHints,
-} from '../utils/BinaryClockSettings';
-import {
- Button,
- SafeAreaView,
- StyleSheet,
- View,
- useWindowDimensions,
-} from 'react-native';
-
-import BinaryClock from '../components/BinaryClock';
-import Orientation from '../utils/orientation';
-import React from 'react';
-import SettingBoolean from '../components/settings/SettingBoolean';
-import SettingRange from '../components/settings/SettingRange';
-import Toast from 'react-native-toast-message';
-
-const BinaryClockSettingScreen: React.FC = () => {
- const {height, width} = useWindowDimensions();
- let clockOrientation =
- height > width ? Orientation.Landscape : Orientation.Portrait;
- const [brightness, setBrightness] = useBrightness();
- const brightnessString = `${Math.round(brightness * 100)}%`;
- const [roundness, setRoundness] = useRoundness();
- const roundnessString = `${Math.round(roundness * 100)}%`;
- const [showHints, setShowHints] = useShowHints();
- function saveSettings() {
- console.debug('Saving settings');
- BinaryClockSettings.setPreferences({
- brightness: brightness,
- roundness: roundness,
- showHints: showHints,
- })
- .then(() => {
- Toast.show({
- type: 'success',
- text1: 'Settings saved! 🎉',
- });
- })
- .catch(err => {
- console.error(err);
- Toast.show({
- type: 'error',
- text1: 'Settings not saved 🤔',
- });
- });
- }
- return (
-
- width ? 'column' : 'row'},
- ]}>
-
-
-
-
-
-
-
-
-
-
-
- );
-};
-
-const styles = StyleSheet.create({
- container: {
- height: '100%',
- },
- clockPreview: {
- flex: 1,
- },
- settingsContainer: {
- flex: 2,
- margin: 20,
- justifyContent: 'flex-start',
- },
- label: {
- fontSize: 20,
- fontWeight: 'bold',
- marginBottom: 10,
- },
- description: {
- marginBottom: 10,
- },
-});
-
-export default BinaryClockSettingScreen;
diff --git a/src/utils/BinaryClockSettings.ts b/src/utils/BinaryClockSettings.ts
index b87c8d8..6405207 100644
--- a/src/utils/BinaryClockSettings.ts
+++ b/src/utils/BinaryClockSettings.ts
@@ -7,7 +7,6 @@
import {Dispatch, SetStateAction, useEffect, useState} from 'react';
import DefaultPreference from 'react-native-default-preference';
-import {useIsFocused} from '@react-navigation/native';
const BRIGHTNESS_KEY = 'brightness';
const ROUNDNESS_KEY = 'roundness';
@@ -71,7 +70,6 @@ class BinaryClockSettings {
function useBrightness(): [number, Dispatch>] {
const [brightness, setBrightness] = useState(1);
- const isFocused = useIsFocused();
useEffect(() => {
BinaryClockSettings.getBrightness()
.then(value => {
@@ -84,13 +82,12 @@ function useBrightness(): [number, Dispatch>] {
console.error(err);
setBrightness(1);
});
- }, [isFocused]);
+ }, []);
return [brightness, setBrightness];
}
function useRoundness(): [number, Dispatch>] {
const [roundness, setRoundness] = useState(1);
- const isFocused = useIsFocused();
useEffect(() => {
BinaryClockSettings.getRoundness()
.then(value => {
@@ -103,13 +100,12 @@ function useRoundness(): [number, Dispatch>] {
console.error(err);
setRoundness(1);
});
- }, [isFocused]);
+ }, []);
return [roundness, setRoundness];
}
function useShowHints(): [boolean, Dispatch>] {
const [showHints, setShowHints] = useState(false);
- const isFocused = useIsFocused();
useEffect(() => {
BinaryClockSettings.getShowHints()
.then(value => {
@@ -120,7 +116,7 @@ function useShowHints(): [boolean, Dispatch>] {
console.error(err);
setShowHints(false);
});
- }, [isFocused]);
+ }, []);
return [showHints, setShowHints];
}