Skip to content

Commit ae66793

Browse files
authored
Merge pull request #5588 from TrainLCD/dev
canary
2 parents ad82955 + 30abddf commit ae66793

File tree

6 files changed

+117
-66
lines changed

6 files changed

+117
-66
lines changed

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,12 @@ android {
141141
dimension "environment"
142142
applicationId "me.tinykitten.trainlcd.dev"
143143
versionNameSuffix "-dev"
144-
versionCode 100000320
144+
versionCode 100000321
145145
versionName "10.2.1"
146146
}
147147
prod {
148148
dimension "environment"
149-
versionCode 100000320
149+
versionCode 100000321
150150
versionName "10.2.1"
151151
}
152152
}

app.config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default ({ config }: ConfigContext) => ({
5353
},
5454
},
5555
ios: {
56-
buildNumber: '2533',
56+
buildNumber: '2534',
5757
bundleIdentifier:
5858
process.env.EAS_BUILD_PROFILE === 'production'
5959
? 'me.tinykitten.trainlcd'
@@ -70,7 +70,7 @@ export default ({ config }: ConfigContext) => ({
7070
? 'me.tinykitten.trainlcd'
7171
: 'me.tinykitten.trainlcd.dev',
7272
permissions: [],
73-
versionCode: 100000320,
73+
versionCode: 100000321,
7474
},
7575
owner: 'trainlcd',
7676
});
@@ -96,5 +96,6 @@ export default ({ config }: ConfigContext) => ({
9696

9797

9898

99+
99100

100101

ios/TrainLCD.xcodeproj/project.pbxproj

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2419,7 +2419,7 @@
24192419
CODE_SIGN_ENTITLEMENTS = ProdTrainLCD.entitlements;
24202420
CODE_SIGN_IDENTITY = "Apple Development";
24212421
CODE_SIGN_STYLE = Automatic;
2422-
CURRENT_PROJECT_VERSION = 2533;
2422+
CURRENT_PROJECT_VERSION = 2534;
24232423
DEAD_CODE_STRIPPING = YES;
24242424
DEVELOPMENT_TEAM = E6R2G33Z36;
24252425
INFOPLIST_FILE = TrainLCD/Schemes/Prod/Info.plist;
@@ -2458,7 +2458,7 @@
24582458
CODE_SIGN_ENTITLEMENTS = ProdTrainLCD.entitlements;
24592459
CODE_SIGN_IDENTITY = "Apple Development";
24602460
CODE_SIGN_STYLE = Automatic;
2461-
CURRENT_PROJECT_VERSION = 2533;
2461+
CURRENT_PROJECT_VERSION = 2534;
24622462
DEVELOPMENT_TEAM = E6R2G33Z36;
24632463
INFOPLIST_FILE = TrainLCD/Schemes/Prod/Info.plist;
24642464
INFOPLIST_KEY_CFBundleDisplayName = TrainLCD;
@@ -2517,7 +2517,7 @@
25172517
CODE_SIGN_ENTITLEMENTS = TrainLCD/trainlcd.entitlements;
25182518
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
25192519
COPY_PHASE_STRIP = NO;
2520-
CURRENT_PROJECT_VERSION = 2533;
2520+
CURRENT_PROJECT_VERSION = 2534;
25212521
CXX = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang++.sh";
25222522
ENABLE_STRICT_OBJC_MSGSEND = YES;
25232523
ENABLE_TESTABILITY = YES;
@@ -2623,7 +2623,7 @@
26232623
CODE_SIGN_ENTITLEMENTS = TrainLCD/trainlcd.entitlements;
26242624
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
26252625
COPY_PHASE_STRIP = YES;
2626-
CURRENT_PROJECT_VERSION = 2533;
2626+
CURRENT_PROJECT_VERSION = 2534;
26272627
CXX = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang++.sh";
26282628
ENABLE_NS_ASSERTIONS = NO;
26292629
ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -2702,7 +2702,7 @@
27022702
CODE_SIGN_ENTITLEMENTS = CanaryTrainLCD.entitlements;
27032703
CODE_SIGN_IDENTITY = "Apple Development";
27042704
CODE_SIGN_STYLE = Automatic;
2705-
CURRENT_PROJECT_VERSION = 2533;
2705+
CURRENT_PROJECT_VERSION = 2534;
27062706
DEAD_CODE_STRIPPING = YES;
27072707
DEVELOPMENT_TEAM = E6R2G33Z36;
27082708
INFOPLIST_FILE = TrainLCD/Schemes/Dev/Info.plist;
@@ -2741,7 +2741,7 @@
27412741
CODE_SIGN_ENTITLEMENTS = CanaryTrainLCD.entitlements;
27422742
CODE_SIGN_IDENTITY = "Apple Development";
27432743
CODE_SIGN_STYLE = Automatic;
2744-
CURRENT_PROJECT_VERSION = 2533;
2744+
CURRENT_PROJECT_VERSION = 2534;
27452745
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
27462746
DEVELOPMENT_TEAM = E6R2G33Z36;
27472747
INFOPLIST_FILE = TrainLCD/Schemes/Dev/Info.plist;
@@ -2952,7 +2952,7 @@
29522952
CODE_SIGN_ENTITLEMENTS = RideSessionActivity/CanaryRideSessionActivity.entitlements;
29532953
CODE_SIGN_IDENTITY = "Apple Development";
29542954
CODE_SIGN_STYLE = Automatic;
2955-
CURRENT_PROJECT_VERSION = 2533;
2955+
CURRENT_PROJECT_VERSION = 2534;
29562956
DEBUG_INFORMATION_FORMAT = dwarf;
29572957
DEVELOPMENT_TEAM = E6R2G33Z36;
29582958
GCC_C_LANGUAGE_STANDARD = gnu11;
@@ -3003,7 +3003,7 @@
30033003
CODE_SIGN_IDENTITY = "Apple Development";
30043004
CODE_SIGN_STYLE = Automatic;
30053005
COPY_PHASE_STRIP = NO;
3006-
CURRENT_PROJECT_VERSION = 2533;
3006+
CURRENT_PROJECT_VERSION = 2534;
30073007
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
30083008
DEVELOPMENT_TEAM = E6R2G33Z36;
30093009
GCC_C_LANGUAGE_STANDARD = gnu11;
@@ -3054,7 +3054,7 @@
30543054
CODE_SIGN_ENTITLEMENTS = WatchWidget/ProdWatchWidget.entitlements;
30553055
CODE_SIGN_IDENTITY = "Apple Development";
30563056
CODE_SIGN_STYLE = Automatic;
3057-
CURRENT_PROJECT_VERSION = 2533;
3057+
CURRENT_PROJECT_VERSION = 2534;
30583058
DEBUG_INFORMATION_FORMAT = dwarf;
30593059
DEVELOPMENT_TEAM = E6R2G33Z36;
30603060
ENABLE_USER_SCRIPT_SANDBOXING = YES;
@@ -3112,7 +3112,7 @@
31123112
CODE_SIGN_IDENTITY = "Apple Development";
31133113
CODE_SIGN_STYLE = Automatic;
31143114
COPY_PHASE_STRIP = NO;
3115-
CURRENT_PROJECT_VERSION = 2533;
3115+
CURRENT_PROJECT_VERSION = 2534;
31163116
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
31173117
DEVELOPMENT_TEAM = E6R2G33Z36;
31183118
ENABLE_USER_SCRIPT_SANDBOXING = YES;
@@ -3163,7 +3163,7 @@
31633163
CODE_SIGN_ENTITLEMENTS = WatchWidget/CanaryWatchWidget.entitlements;
31643164
CODE_SIGN_IDENTITY = "Apple Development";
31653165
CODE_SIGN_STYLE = Automatic;
3166-
CURRENT_PROJECT_VERSION = 2533;
3166+
CURRENT_PROJECT_VERSION = 2534;
31673167
DEBUG_INFORMATION_FORMAT = dwarf;
31683168
DEVELOPMENT_TEAM = E6R2G33Z36;
31693169
ENABLE_USER_SCRIPT_SANDBOXING = YES;
@@ -3220,7 +3220,7 @@
32203220
CODE_SIGN_IDENTITY = "Apple Development";
32213221
CODE_SIGN_STYLE = Automatic;
32223222
COPY_PHASE_STRIP = NO;
3223-
CURRENT_PROJECT_VERSION = 2533;
3223+
CURRENT_PROJECT_VERSION = 2534;
32243224
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
32253225
DEVELOPMENT_TEAM = E6R2G33Z36;
32263226
ENABLE_USER_SCRIPT_SANDBOXING = YES;
@@ -3268,7 +3268,7 @@
32683268
CODE_SIGN_ENTITLEMENTS = RideSessionActivity/ProdRideSessionActivity.entitlements;
32693269
CODE_SIGN_IDENTITY = "Apple Development";
32703270
CODE_SIGN_STYLE = Automatic;
3271-
CURRENT_PROJECT_VERSION = 2533;
3271+
CURRENT_PROJECT_VERSION = 2534;
32723272
DEBUG_INFORMATION_FORMAT = dwarf;
32733273
DEVELOPMENT_TEAM = E6R2G33Z36;
32743274
GCC_C_LANGUAGE_STANDARD = gnu11;
@@ -3319,7 +3319,7 @@
33193319
CODE_SIGN_IDENTITY = "Apple Development";
33203320
CODE_SIGN_STYLE = Automatic;
33213321
COPY_PHASE_STRIP = NO;
3322-
CURRENT_PROJECT_VERSION = 2533;
3322+
CURRENT_PROJECT_VERSION = 2534;
33233323
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
33243324
DEVELOPMENT_TEAM = E6R2G33Z36;
33253325
GCC_C_LANGUAGE_STANDARD = gnu11;
@@ -3538,7 +3538,7 @@
35383538
CODE_SIGN_ENTITLEMENTS = ProdAppClip/ProdAppClip.entitlements;
35393539
CODE_SIGN_IDENTITY = "Apple Development";
35403540
CODE_SIGN_STYLE = Automatic;
3541-
CURRENT_PROJECT_VERSION = 2533;
3541+
CURRENT_PROJECT_VERSION = 2534;
35423542
DEBUG_INFORMATION_FORMAT = dwarf;
35433543
DEVELOPMENT_TEAM = E6R2G33Z36;
35443544
ENABLE_USER_SCRIPT_SANDBOXING = NO;
@@ -3594,7 +3594,7 @@
35943594
CODE_SIGN_IDENTITY = "Apple Development";
35953595
CODE_SIGN_STYLE = Automatic;
35963596
COPY_PHASE_STRIP = NO;
3597-
CURRENT_PROJECT_VERSION = 2533;
3597+
CURRENT_PROJECT_VERSION = 2534;
35983598
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
35993599
DEVELOPMENT_TEAM = E6R2G33Z36;
36003600
ENABLE_USER_SCRIPT_SANDBOXING = NO;
@@ -3644,7 +3644,7 @@
36443644
CODE_SIGN_ENTITLEMENTS = CanaryAppClip/CanaryAppClip.entitlements;
36453645
CODE_SIGN_IDENTITY = "Apple Development";
36463646
CODE_SIGN_STYLE = Automatic;
3647-
CURRENT_PROJECT_VERSION = 2533;
3647+
CURRENT_PROJECT_VERSION = 2534;
36483648
DEBUG_INFORMATION_FORMAT = dwarf;
36493649
DEVELOPMENT_TEAM = E6R2G33Z36;
36503650
ENABLE_USER_SCRIPT_SANDBOXING = NO;
@@ -3702,7 +3702,7 @@
37023702
CODE_SIGN_IDENTITY = "Apple Development";
37033703
CODE_SIGN_STYLE = Automatic;
37043704
COPY_PHASE_STRIP = NO;
3705-
CURRENT_PROJECT_VERSION = 2533;
3705+
CURRENT_PROJECT_VERSION = 2534;
37063706
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
37073707
DEVELOPMENT_TEAM = E6R2G33Z36;
37083708
ENABLE_USER_SCRIPT_SANDBOXING = NO;

src/components/Permitted.tsx

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,10 @@ const PermittedLayout: React.FC<Props> = ({ children }: Props) => {
306306
ttsEnabledLanguagesStr,
307307
telemetryEnabledStr,
308308
devOverlayEnabledStr,
309+
headerTransitionIntervalStr,
310+
headerTransitionDelayStr,
311+
bottomTransitionIntervalStr,
312+
untouchableModeEnabledStr,
309313
] = await Promise.all([
310314
AsyncStorage.getItem(ASYNC_STORAGE_KEYS.PREVIOUS_THEME),
311315
AsyncStorage.getItem(ASYNC_STORAGE_KEYS.ENABLED_LANGUAGES),
@@ -314,6 +318,10 @@ const PermittedLayout: React.FC<Props> = ({ children }: Props) => {
314318
AsyncStorage.getItem(ASYNC_STORAGE_KEYS.TTS_ENABLED_LANGUAGES),
315319
AsyncStorage.getItem(ASYNC_STORAGE_KEYS.TELEMETRY_ENABLED),
316320
AsyncStorage.getItem(ASYNC_STORAGE_KEYS.DEV_OVERLAY_ENABLED),
321+
AsyncStorage.getItem(ASYNC_STORAGE_KEYS.HEADER_TRANSITION_INTERVAL),
322+
AsyncStorage.getItem(ASYNC_STORAGE_KEYS.HEADER_TRANSITION_DELAY),
323+
AsyncStorage.getItem(ASYNC_STORAGE_KEYS.BOTTOM_TRANSITION_INTERVAL),
324+
AsyncStorage.getItem(ASYNC_STORAGE_KEYS.UNTOUCHABLE_MODE_ENABLED),
317325
]);
318326

319327
if (prevThemeKey) {
@@ -371,6 +379,39 @@ const PermittedLayout: React.FC<Props> = ({ children }: Props) => {
371379
devOverlayEnabled: devOverlayEnabledStr === 'true',
372380
}));
373381
}
382+
if (headerTransitionIntervalStr) {
383+
const parsed = Number(headerTransitionIntervalStr);
384+
if (!Number.isNaN(parsed)) {
385+
setTuning((prev) => ({
386+
...prev,
387+
headerTransitionInterval: parsed,
388+
}));
389+
}
390+
}
391+
if (headerTransitionDelayStr) {
392+
const parsed = Number(headerTransitionDelayStr);
393+
if (!Number.isNaN(parsed)) {
394+
setTuning((prev) => ({
395+
...prev,
396+
headerTransitionDelay: parsed,
397+
}));
398+
}
399+
}
400+
if (bottomTransitionIntervalStr) {
401+
const parsed = Number(bottomTransitionIntervalStr);
402+
if (!Number.isNaN(parsed)) {
403+
setTuning((prev) => ({
404+
...prev,
405+
bottomTransitionInterval: parsed,
406+
}));
407+
}
408+
}
409+
if (untouchableModeEnabledStr) {
410+
setTuning((prev) => ({
411+
...prev,
412+
untouchableModeEnabled: untouchableModeEnabledStr === 'true',
413+
}));
414+
}
374415
};
375416

376417
loadSettings();

src/components/TuningSettings.tsx

Lines changed: 49 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -141,31 +141,40 @@ const TuningSettings: React.FC = () => {
141141
const parseNumberFromText = (prev: number, text: string) =>
142142
Number.isNaN(Number(text)) ? prev : Number(text);
143143

144-
const handleHeaderIntervalChange = (text: string) =>
144+
const handleHeaderIntervalChange = (text: string) => {
145+
const value = parseNumberFromText(settings.headerTransitionInterval, text);
145146
setSettings((prev) => ({
146147
...prev,
147-
headerTransitionInterval: parseNumberFromText(
148-
prev.headerTransitionInterval,
149-
text
150-
),
148+
headerTransitionInterval: value,
151149
}));
152-
const handleHeaderDelayChange = (text: string) =>
150+
AsyncStorage.setItem(
151+
ASYNC_STORAGE_KEYS.HEADER_TRANSITION_INTERVAL,
152+
String(value)
153+
);
154+
};
155+
const handleHeaderDelayChange = (text: string) => {
156+
const value = parseNumberFromText(settings.headerTransitionDelay, text);
153157
setSettings((prev) => ({
154158
...prev,
155-
headerTransitionDelay: parseNumberFromText(
156-
prev.headerTransitionDelay,
157-
text
158-
),
159+
headerTransitionDelay: value,
159160
}));
161+
AsyncStorage.setItem(
162+
ASYNC_STORAGE_KEYS.HEADER_TRANSITION_DELAY,
163+
String(value)
164+
);
165+
};
160166

161-
const handleBottomDelayChange = (text: string) =>
167+
const handleBottomDelayChange = (text: string) => {
168+
const value = parseNumberFromText(settings.bottomTransitionInterval, text);
162169
setSettings((prev) => ({
163170
...prev,
164-
bottomTransitionInterval: parseNumberFromText(
165-
prev.bottomTransitionInterval,
166-
text
167-
),
171+
bottomTransitionInterval: value,
168172
}));
173+
AsyncStorage.setItem(
174+
ASYNC_STORAGE_KEYS.BOTTOM_TRANSITION_INTERVAL,
175+
String(value)
176+
);
177+
};
169178

170179
const [voicePickerState, setVoicePickerState] = useState<{
171180
current: string;
@@ -199,44 +208,40 @@ const TuningSettings: React.FC = () => {
199208
AsyncStorage.setItem(ASYNC_STORAGE_KEYS.TTS_EN_VOICE_NAME, voice);
200209
};
201210

202-
const toggleDevOverlayEnabled = () =>
211+
const toggleDevOverlayEnabled = () => {
212+
const nextValue = !settings.devOverlayEnabled;
203213
setSettings((prev) => ({
204214
...prev,
205-
devOverlayEnabled: !prev.devOverlayEnabled,
215+
devOverlayEnabled: nextValue,
206216
}));
217+
AsyncStorage.setItem(
218+
ASYNC_STORAGE_KEYS.DEV_OVERLAY_ENABLED,
219+
String(nextValue)
220+
);
221+
};
207222

208-
const toggleUntouchableModeEnabled = () =>
223+
const toggleUntouchableModeEnabled = () => {
224+
const nextValue = !settings.untouchableModeEnabled;
209225
setSettings((prev) => ({
210226
...prev,
211-
untouchableModeEnabled: !prev.untouchableModeEnabled,
227+
untouchableModeEnabled: nextValue,
212228
}));
229+
AsyncStorage.setItem(
230+
ASYNC_STORAGE_KEYS.UNTOUCHABLE_MODE_ENABLED,
231+
String(nextValue)
232+
);
233+
};
213234

214235
const toggleTelemetryEnabled = () => {
215-
if (settings.telemetryEnabled) {
216-
AsyncStorage.setItem(ASYNC_STORAGE_KEYS.TELEMETRY_ENABLED, 'false');
217-
setSettings((prev) => ({
218-
...prev,
219-
telemetryEnabled: !prev.telemetryEnabled,
220-
}));
221-
return;
222-
}
223-
224-
Alert.alert(translate('notice'), translate('telemetrySettingWillPersist'), [
225-
{
226-
text: 'OK',
227-
onPress: () => {
228-
AsyncStorage.setItem(ASYNC_STORAGE_KEYS.TELEMETRY_ENABLED, 'true');
229-
setSettings((prev) => ({
230-
...prev,
231-
telemetryEnabled: !prev.telemetryEnabled,
232-
}));
233-
},
234-
},
235-
{
236-
text: translate('cancel'),
237-
style: 'cancel',
238-
},
239-
]);
236+
const nextValue = !settings.telemetryEnabled;
237+
setSettings((prev) => ({
238+
...prev,
239+
telemetryEnabled: nextValue,
240+
}));
241+
AsyncStorage.setItem(
242+
ASYNC_STORAGE_KEYS.TELEMETRY_ENABLED,
243+
String(nextValue)
244+
);
240245
};
241246

242247
return (

0 commit comments

Comments
 (0)