@iternio/react-native-auto-play 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -10
- package/android/src/automotive/AndroidManifest-nonnav.xml +0 -2
- package/android/src/automotive/AndroidManifest.xml +0 -2
- package/android/src/main/AndroidManifest-nonnav.xml +0 -2
- package/android/src/main/AndroidManifest.xml +0 -2
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/AndroidAutoService.kt +3 -27
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAutoPlayTiming.kt +122 -0
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/template/Parser.kt +49 -14
- package/installTimers.ts +3 -0
- package/installTimers.web.ts +2 -0
- package/ios/hybrid/HybridAutoPlayTiming.swift +123 -0
- package/jest.js +2 -0
- package/lib/components/SafeAreaView.js +1 -1
- package/lib/hybrid/HybridAutoPlayTiming.d.ts +2 -0
- package/lib/hybrid/HybridAutoPlayTiming.js +2 -0
- package/lib/hybrid/HybridVoice.js +2 -2
- package/lib/index.js +0 -2
- package/lib/index.web.d.ts +75 -0
- package/lib/index.web.js +72 -1
- package/lib/installTimers.d.ts +1 -0
- package/lib/installTimers.js +8 -0
- package/lib/installTimers.web.d.ts +1 -0
- package/lib/installTimers.web.js +2 -0
- package/lib/scenes/CarPlayDashboardScene.d.ts +3 -3
- package/lib/specs/AutoPlayTiming.nitro.d.ts +27 -0
- package/lib/specs/AutoPlayTiming.nitro.js +1 -0
- package/lib/types/Image.d.ts +6 -1
- package/lib/types/Telemetry.d.ts +1 -1
- package/lib/utils/AutoPlayTimers.d.ts +21 -0
- package/lib/utils/AutoPlayTimers.js +45 -0
- package/lib/utils/NitroColor.d.ts +1 -0
- package/lib/utils/NitroColor.js +8 -0
- package/lib/utils/NitroImage.d.ts +5 -2
- package/lib/utils/NitroImage.js +2 -2
- package/lib/utils/NitroManeuver.js +1 -3
- package/lib-cjs/Constants.js +9 -0
- package/lib-cjs/components/MapTemplateContext.js +10 -0
- package/lib-cjs/components/SafeAreaInsetsContext.js +21 -0
- package/lib-cjs/components/SafeAreaView.js +22 -0
- package/lib-cjs/components/WindowInformationWrapper.js +20 -0
- package/lib-cjs/hooks/useAndroidAutoTelemetry.js +115 -0
- package/lib-cjs/hooks/useFocusedEffect.js +35 -0
- package/lib-cjs/hooks/useMapTemplate.js +13 -0
- package/lib-cjs/hooks/useSafeAreaInsets.js +9 -0
- package/lib-cjs/hooks/useVoiceInput.js +42 -0
- package/lib-cjs/hybrid/HybridAndroidAutoTelemetry.js +4 -0
- package/lib-cjs/hybrid/HybridAndroidWindowInformation.js +4 -0
- package/lib-cjs/hybrid/HybridAutoPlay.js +5 -0
- package/lib-cjs/hybrid/HybridVoice.js +61 -0
- package/lib-cjs/index.js +71 -0
- package/lib-cjs/index.web.js +98 -0
- package/lib-cjs/scenes/AutoPlayCluster.js +140 -0
- package/lib-cjs/scenes/CarPlayDashboardScene.js +100 -0
- package/lib-cjs/specs/AndroidAutoTelemetry.nitro.js +2 -0
- package/lib-cjs/specs/AndroidAutomotive.nitro.js +16 -0
- package/lib-cjs/specs/AndroidWindowInformation.nitro.js +2 -0
- package/lib-cjs/specs/AutoPlay.nitro.js +2 -0
- package/lib-cjs/specs/CarPlayDashboard.nitro.js +2 -0
- package/lib-cjs/specs/Cluster.nitro.js +2 -0
- package/lib-cjs/specs/GridTemplate.nitro.js +2 -0
- package/lib-cjs/specs/InformationTemplate.nitro.js +2 -0
- package/lib-cjs/specs/ListTemplate.nitro.js +2 -0
- package/lib-cjs/specs/MapTemplate.nitro.js +2 -0
- package/lib-cjs/specs/MessageTemplate.nitro.js +2 -0
- package/lib-cjs/specs/SearchTemplate.nitro.js +2 -0
- package/lib-cjs/specs/SignInTemplate.nitro.js +2 -0
- package/lib-cjs/specs/Voice.nitro.js +2 -0
- package/lib-cjs/templates/GridTemplate.js +41 -0
- package/lib-cjs/templates/InformationTemplate.js +49 -0
- package/lib-cjs/templates/ListTemplate.js +33 -0
- package/lib-cjs/templates/MapTemplate.js +168 -0
- package/lib-cjs/templates/MessageTemplate.js +50 -0
- package/lib-cjs/templates/SearchTemplate.js +32 -0
- package/lib-cjs/templates/SignInTemplate.js +55 -0
- package/lib-cjs/templates/Template.js +40 -0
- package/lib-cjs/types/Button.js +12 -0
- package/lib-cjs/types/Event.js +2 -0
- package/lib-cjs/types/Image.js +2 -0
- package/lib-cjs/types/Maneuver.js +77 -0
- package/lib-cjs/types/RootComponent.js +2 -0
- package/lib-cjs/types/SignInMethod.js +22 -0
- package/lib-cjs/types/Telemetry.js +24 -0
- package/lib-cjs/types/Text.js +8 -0
- package/lib-cjs/types/Trip.js +2 -0
- package/lib-cjs/types/Voice.js +2 -0
- package/lib-cjs/utils/ErrorUtil.js +34 -0
- package/lib-cjs/utils/NitroAction.js +129 -0
- package/lib-cjs/utils/NitroAlert.js +19 -0
- package/lib-cjs/utils/NitroAttributedString.js +14 -0
- package/lib-cjs/utils/NitroColor.js +32 -0
- package/lib-cjs/utils/NitroGrid.js +12 -0
- package/lib-cjs/utils/NitroImage.js +97 -0
- package/lib-cjs/utils/NitroManeuver.js +79 -0
- package/lib-cjs/utils/NitroMapButton.js +33 -0
- package/lib-cjs/utils/NitroOptionsPanel.js +66 -0
- package/lib-cjs/utils/NitroSection.js +112 -0
- package/nitro.json +10 -0
- package/nitrogen/generated/android/ReactNativeAutoPlay+autolinking.cmake +2 -0
- package/nitrogen/generated/android/ReactNativeAutoPlayOnLoad.cpp +16 -0
- package/nitrogen/generated/android/c++/JActiveCarUxRestrictions.hpp +1 -1
- package/nitrogen/generated/android/c++/JAlertActionStyle.hpp +1 -1
- package/nitrogen/generated/android/c++/JAlertDismissalReason.hpp +1 -1
- package/nitrogen/generated/android/c++/JAppFocusState.hpp +1 -1
- package/nitrogen/generated/android/c++/JAssetImage.hpp +18 -18
- package/nitrogen/generated/android/c++/JAutoText.hpp +1 -1
- package/nitrogen/generated/android/c++/JBooleanTelemetryItem.hpp +1 -1
- package/nitrogen/generated/android/c++/JCarUxRestrictions.hpp +1 -1
- package/nitrogen/generated/android/c++/JChargingConnector.hpp +1 -1
- package/nitrogen/generated/android/c++/JClusterEventName.hpp +1 -1
- package/nitrogen/generated/android/c++/JColorScheme.hpp +1 -1
- package/nitrogen/generated/android/c++/JDistance.hpp +1 -1
- package/nitrogen/generated/android/c++/JDistanceUnits.hpp +1 -1
- package/nitrogen/generated/android/c++/JDurationWithTimeZone.hpp +1 -1
- package/nitrogen/generated/android/c++/JEventName.hpp +1 -1
- package/nitrogen/generated/android/c++/JForkType.hpp +1 -1
- package/nitrogen/generated/android/c++/JGlyphImage.hpp +1 -1
- package/nitrogen/generated/android/c++/JGoogleSignIn.hpp +1 -1
- package/nitrogen/generated/android/c++/JGoogleSignInAccount.hpp +1 -1
- package/nitrogen/generated/android/c++/JGridImageSize.hpp +1 -1
- package/nitrogen/generated/android/c++/JGridTemplateConfig.hpp +1 -1
- package/nitrogen/generated/android/c++/JHybridAutoPlayTimingSpec.cpp +59 -0
- package/nitrogen/generated/android/c++/JHybridAutoPlayTimingSpec.hpp +64 -0
- package/nitrogen/generated/android/c++/JImageLane.hpp +1 -1
- package/nitrogen/generated/android/c++/JInformationTemplateConfig.hpp +1 -1
- package/nitrogen/generated/android/c++/JInputSignIn.hpp +1 -1
- package/nitrogen/generated/android/c++/JKeepType.hpp +1 -1
- package/nitrogen/generated/android/c++/JKeyboardType.hpp +1 -1
- package/nitrogen/generated/android/c++/JLaneGuidance.hpp +1 -1
- package/nitrogen/generated/android/c++/JListImageType.hpp +1 -1
- package/nitrogen/generated/android/c++/JListTemplateConfig.hpp +1 -1
- package/nitrogen/generated/android/c++/JLocation.hpp +1 -1
- package/nitrogen/generated/android/c++/JManeuverState.hpp +1 -1
- package/nitrogen/generated/android/c++/JManeuverType.hpp +1 -1
- package/nitrogen/generated/android/c++/JMapTemplateConfig.hpp +1 -1
- package/nitrogen/generated/android/c++/JMessageTemplateConfig.hpp +1 -1
- package/nitrogen/generated/android/c++/JNavigationAlertAction.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroAction.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroActionType.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroAlignment.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroAttributedString.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroAttributedStringImage.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroBaseMapTemplateConfig.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroButtonStyle.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroChargerLocation.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroChargerOutlet.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroColor.hpp +9 -5
- package/nitrogen/generated/android/c++/JNitroGridButton.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroLoadingManeuver.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroMapButton.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroMapButtonType.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroMessageManeuver.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroNavigationAlert.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroOptionsPanelChargerSection.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroOptionsPanelConfig.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroOptionsPanelGridSection.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroRoutingManeuver.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroRow.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroSection.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroSectionType.hpp +1 -1
- package/nitrogen/generated/android/c++/JNumericTelemetryItem.hpp +1 -1
- package/nitrogen/generated/android/c++/JOffRampType.hpp +1 -1
- package/nitrogen/generated/android/c++/JOnRampType.hpp +1 -1
- package/nitrogen/generated/android/c++/JPermissionRequestResult.hpp +1 -1
- package/nitrogen/generated/android/c++/JPinSignIn.hpp +1 -1
- package/nitrogen/generated/android/c++/JPoint.hpp +1 -1
- package/nitrogen/generated/android/c++/JPreferredImageLane.hpp +1 -1
- package/nitrogen/generated/android/c++/JQrSignIn.hpp +1 -1
- package/nitrogen/generated/android/c++/JRemoteImage.hpp +1 -1
- package/nitrogen/generated/android/c++/JRouteChoice.hpp +1 -1
- package/nitrogen/generated/android/c++/JSafeAreaInsets.hpp +1 -1
- package/nitrogen/generated/android/c++/JSearchTemplateConfig.hpp +1 -1
- package/nitrogen/generated/android/c++/JSignInMethods.hpp +1 -1
- package/nitrogen/generated/android/c++/JSignInTemplateConfig.hpp +1 -1
- package/nitrogen/generated/android/c++/JStringTelemetryItem.hpp +1 -1
- package/nitrogen/generated/android/c++/JTelemetry.hpp +1 -1
- package/nitrogen/generated/android/c++/JTextInputType.hpp +1 -1
- package/nitrogen/generated/android/c++/JTrafficSide.hpp +1 -1
- package/nitrogen/generated/android/c++/JTravelEstimates.hpp +1 -1
- package/nitrogen/generated/android/c++/JTripConfig.hpp +1 -1
- package/nitrogen/generated/android/c++/JTripPoint.hpp +1 -1
- package/nitrogen/generated/android/c++/JTripPreviewTextConfiguration.hpp +1 -1
- package/nitrogen/generated/android/c++/JTripSelectorCallback.hpp +1 -1
- package/nitrogen/generated/android/c++/JTripsConfig.hpp +1 -1
- package/nitrogen/generated/android/c++/JTurnType.hpp +1 -1
- package/nitrogen/generated/android/c++/JVehicleTelemetryItem.hpp +1 -1
- package/nitrogen/generated/android/c++/JVisibilityState.hpp +1 -1
- package/nitrogen/generated/android/c++/JVisibleTravelEstimate.hpp +1 -1
- package/nitrogen/generated/android/c++/JVoiceAudioEncoding.hpp +1 -1
- package/nitrogen/generated/android/c++/JVoiceInputChunk.hpp +1 -1
- package/nitrogen/generated/android/c++/JVoiceInputResult.hpp +1 -1
- package/nitrogen/generated/android/c++/JWaypointCoordinate.hpp +1 -1
- package/nitrogen/generated/android/c++/JWindowInformation.hpp +1 -1
- package/nitrogen/generated/android/c++/JZoomEvent.hpp +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/AssetImage.kt +15 -15
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_ActiveCarUxRestrictions.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_AlertDismissalReason.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_AppFocusState.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_ColorScheme.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_Point.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_Point_double.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_Point_std__optional_Point_.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_SafeAreaInsets.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_VisibilityState.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_VoiceInputChunk.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_WindowInformation.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_bool.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_std__optional_Location__std__optional_std__string_.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_std__optional_Telemetry_.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_std__optional_bool_.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_std__optional_std__string__std__optional_GoogleSignInAccount_.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_std__string.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_std__string_ColorScheme.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_std__string_ZoomEvent.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_std__string_bool.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_std__string_std__string.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAndroidAutoTelemetrySpec.kt +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAndroidAutomotiveSpec.kt +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAndroidWindowInformationSpec.kt +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAutoPlaySpec.kt +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAutoPlayTimingSpec.kt +65 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridClusterSpec.kt +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridGridTemplateSpec.kt +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridInformationTemplateSpec.kt +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridListTemplateSpec.kt +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridMapTemplateSpec.kt +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridMessageTemplateSpec.kt +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridSearchTemplateSpec.kt +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridSignInTemplateSpec.kt +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridVoiceSpec.kt +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroColor.kt +9 -4
- package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Bridge.cpp +17 -0
- package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Bridge.hpp +35 -9
- package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Umbrella.hpp +5 -0
- package/nitrogen/generated/ios/ReactNativeAutoPlayAutolinking.mm +8 -0
- package/nitrogen/generated/ios/ReactNativeAutoPlayAutolinking.swift +12 -0
- package/nitrogen/generated/ios/c++/HybridAutoPlayTimingSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridAutoPlayTimingSpecSwift.hpp +88 -0
- package/nitrogen/generated/ios/swift/AssetImage.swift +13 -13
- package/nitrogen/generated/ios/swift/HybridAutoPlayTimingSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridAutoPlayTimingSpec_cxx.swift +154 -0
- package/nitrogen/generated/ios/swift/NitroColor.swift +20 -2
- package/nitrogen/generated/shared/c++/AssetImage.hpp +18 -18
- package/nitrogen/generated/shared/c++/HybridAutoPlayTimingSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridAutoPlayTimingSpec.hpp +63 -0
- package/nitrogen/generated/shared/c++/NitroColor.hpp +7 -3
- package/package.json +12 -6
- package/src/components/SafeAreaView.tsx +1 -1
- package/src/hybrid/HybridAutoPlayTiming.ts +5 -0
- package/src/hybrid/HybridVoice.ts +2 -2
- package/src/index.ts +0 -3
- package/src/index.web.ts +166 -0
- package/src/installTimers.ts +9 -0
- package/src/installTimers.web.ts +2 -0
- package/src/specs/AutoPlayTiming.nitro.ts +25 -0
- package/src/types/Image.ts +6 -1
- package/src/types/Telemetry.ts +1 -1
- package/src/utils/AutoPlayTimers.ts +60 -0
- package/src/utils/NitroColor.ts +10 -1
- package/src/utils/NitroImage.ts +14 -8
- package/src/utils/NitroManeuver.ts +1 -4
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HeadlessTaskService.kt +0 -36
- package/lib/AutoPlayHeadlessJsTask.d.ts +0 -5
- package/lib/AutoPlayHeadlessJsTask.js +0 -14
- package/src/AutoPlayHeadlessJsTask.ts +0 -22
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NitroOptionsPanelUtil = void 0;
|
|
4
|
+
const NitroAction_1 = require("./NitroAction");
|
|
5
|
+
const NitroGrid_1 = require("./NitroGrid");
|
|
6
|
+
const NitroImage_1 = require("./NitroImage");
|
|
7
|
+
const NitroSection_1 = require("./NitroSection");
|
|
8
|
+
const isRadioSection = (items) => {
|
|
9
|
+
return items.length > 0 && items.every((item) => item.type === 'radio');
|
|
10
|
+
};
|
|
11
|
+
const convertSection = (template, section) => {
|
|
12
|
+
if (section.type === 'grid') {
|
|
13
|
+
return {
|
|
14
|
+
title: section.title,
|
|
15
|
+
buttons: NitroGrid_1.NitroGridUtil.convert(template, section.buttons),
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
if (section.type === 'charger') {
|
|
19
|
+
const { location } = section;
|
|
20
|
+
return {
|
|
21
|
+
title: section.title,
|
|
22
|
+
outlets: section.outlets.map((outlet) => ({
|
|
23
|
+
connector: outlet.connector,
|
|
24
|
+
voltage: outlet.voltage,
|
|
25
|
+
powerKw: outlet.powerKw,
|
|
26
|
+
onPress: outlet.onPress ? () => outlet.onPress?.(template) : undefined,
|
|
27
|
+
})),
|
|
28
|
+
location: location
|
|
29
|
+
? {
|
|
30
|
+
name: location.name,
|
|
31
|
+
address: location.address,
|
|
32
|
+
coordinate: location.coordinate,
|
|
33
|
+
distance: location.travelEstimates.distance,
|
|
34
|
+
duration: location.travelEstimates.duration,
|
|
35
|
+
visible: location.travelEstimates.visible,
|
|
36
|
+
image: NitroImage_1.NitroImageUtil.convert(location.image),
|
|
37
|
+
onPress: location.onPress ? () => location.onPress?.(template) : undefined,
|
|
38
|
+
}
|
|
39
|
+
: undefined,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
const { items, title = '' } = section;
|
|
43
|
+
const multiSection = isRadioSection(items)
|
|
44
|
+
? { type: 'radio', title, items }
|
|
45
|
+
: {
|
|
46
|
+
type: 'default',
|
|
47
|
+
title,
|
|
48
|
+
items,
|
|
49
|
+
};
|
|
50
|
+
const [nitroSection] = NitroSection_1.NitroSectionUtil.convert(template, [multiSection]) ?? [];
|
|
51
|
+
if (nitroSection == null) {
|
|
52
|
+
throw new Error('converting sections failed');
|
|
53
|
+
}
|
|
54
|
+
return nitroSection;
|
|
55
|
+
};
|
|
56
|
+
const convert = (template, config) => {
|
|
57
|
+
if (config == null) {
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
title: config.title,
|
|
62
|
+
sections: config.sections.map((section) => convertSection(template, section)),
|
|
63
|
+
actions: NitroAction_1.NitroActionUtil.convert(template, config.actions),
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
exports.NitroOptionsPanelUtil = { convert };
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NitroSectionUtil = void 0;
|
|
4
|
+
const Text_1 = require("../types/Text");
|
|
5
|
+
const NitroImage_1 = require("./NitroImage");
|
|
6
|
+
const validateRadioItems = (type, items) => {
|
|
7
|
+
if (__DEV__ &&
|
|
8
|
+
type === 'radio' &&
|
|
9
|
+
(items.filter((item) => item.selected).length > 1 || items.every((item) => !item.selected))) {
|
|
10
|
+
throw new Error('radio lists must have one selected item');
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
const convert = (template, sections) => {
|
|
14
|
+
if (sections == null) {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
if (Array.isArray(sections)) {
|
|
18
|
+
return sections.map((section) => {
|
|
19
|
+
const { title, type } = section;
|
|
20
|
+
const items = section.items.map((item) => convertRow(template, item));
|
|
21
|
+
validateRadioItems(type, items);
|
|
22
|
+
return {
|
|
23
|
+
items,
|
|
24
|
+
type,
|
|
25
|
+
title,
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
const items = sections.items.map((item) => convertRow(template, item));
|
|
30
|
+
validateRadioItems(sections.type, items);
|
|
31
|
+
return [
|
|
32
|
+
{
|
|
33
|
+
items,
|
|
34
|
+
type: sections.type,
|
|
35
|
+
},
|
|
36
|
+
];
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* `AutoText.distance`/`.duration` only take effect if `text` actually uses the matching
|
|
40
|
+
* `TextPlaceholders` marker — populate whichever of those the text references, leaving the rest
|
|
41
|
+
* of `text` untouched, so a title/address that doesn't opt in via a placeholder is unaffected.
|
|
42
|
+
*/
|
|
43
|
+
const withTravelEstimates = (text, distance, durationSeconds) => {
|
|
44
|
+
const hasDistance = text.text.includes(Text_1.TextPlaceholders.Distance);
|
|
45
|
+
const hasDuration = text.text.includes(Text_1.TextPlaceholders.Duration);
|
|
46
|
+
if (!hasDistance && !hasDuration) {
|
|
47
|
+
return text;
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
...text,
|
|
51
|
+
distance: hasDistance ? distance : text.distance,
|
|
52
|
+
duration: hasDuration ? durationSeconds : text.duration,
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
const convertRow = (template, item) => {
|
|
56
|
+
const { type, enabled = true, image, imageType } = item;
|
|
57
|
+
// `WaypointRow` has no `detailedText` of its own — `address` doubles as the detail line
|
|
58
|
+
// whenever this falls back to a plain row (non-panel context, Android).
|
|
59
|
+
let title = item.title;
|
|
60
|
+
let detailedText = item.type === 'waypoint'
|
|
61
|
+
? item.address != null
|
|
62
|
+
? { text: item.address }
|
|
63
|
+
: undefined
|
|
64
|
+
: 'detailedText' in item
|
|
65
|
+
? item.detailedText
|
|
66
|
+
: undefined;
|
|
67
|
+
// Opt-in only: a title/address using `{distance}`/`{duration}` gets those values filled in,
|
|
68
|
+
// via the same substitution `AutoText` already does everywhere else — no separate "estimate"
|
|
69
|
+
// UI element needed for a row embedded in a list alongside other rows. Deliberately NOT gated
|
|
70
|
+
// on `travelEstimates.visible` — that flag only controls the panel-only sibling
|
|
71
|
+
// `CPTravelEstimates` item (see `Parser.swift`'s `travelEstimatesVisible` check), which has no
|
|
72
|
+
// bearing on the non-panel/Android fallback text this feeds; a placeholder in the text is
|
|
73
|
+
// already its own explicit opt-in regardless of `visible`.
|
|
74
|
+
if (item.type === 'waypoint') {
|
|
75
|
+
const { distance, duration } = item.travelEstimates;
|
|
76
|
+
title = withTravelEstimates(title, distance, duration.seconds);
|
|
77
|
+
if (detailedText != null) {
|
|
78
|
+
detailedText = withTravelEstimates(detailedText, distance, duration.seconds);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const selected = type === 'radio' ? (item.selected ?? false) : undefined;
|
|
82
|
+
const onTogglePress = item.type === 'toggle' ? item.onPress : undefined;
|
|
83
|
+
const onRowPress = item.type !== 'text' && item.type !== 'toggle' ? item.onPress : undefined;
|
|
84
|
+
const onPress = item.type === 'text'
|
|
85
|
+
? undefined
|
|
86
|
+
: (checked) => {
|
|
87
|
+
if (onTogglePress != null && checked != null) {
|
|
88
|
+
onTogglePress(template, checked);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (onRowPress != null) {
|
|
92
|
+
onRowPress(template);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
return {
|
|
96
|
+
browsable: type === 'default' ? item.browsable : undefined,
|
|
97
|
+
detailedText,
|
|
98
|
+
enabled,
|
|
99
|
+
image: NitroImage_1.NitroImageUtil.convert(image),
|
|
100
|
+
imageType,
|
|
101
|
+
title,
|
|
102
|
+
checked: type === 'toggle' ? item.checked : undefined,
|
|
103
|
+
onPress,
|
|
104
|
+
selected,
|
|
105
|
+
coordinate: item.type === 'waypoint' ? item.coordinate : undefined,
|
|
106
|
+
distance: item.type === 'waypoint' ? item.travelEstimates.distance : undefined,
|
|
107
|
+
duration: item.type === 'waypoint' ? item.travelEstimates.duration : undefined,
|
|
108
|
+
travelEstimatesVisible: item.type === 'waypoint' ? item.travelEstimates.visible : undefined,
|
|
109
|
+
address: item.type === 'waypoint' ? item.address : undefined,
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
exports.NitroSectionUtil = { convert };
|
package/nitro.json
CHANGED
|
@@ -119,6 +119,16 @@
|
|
|
119
119
|
"language": "swift"
|
|
120
120
|
}
|
|
121
121
|
},
|
|
122
|
+
"AutoPlayTiming": {
|
|
123
|
+
"android": {
|
|
124
|
+
"implementationClassName": "HybridAutoPlayTiming",
|
|
125
|
+
"language": "kotlin"
|
|
126
|
+
},
|
|
127
|
+
"ios": {
|
|
128
|
+
"implementationClassName": "HybridAutoPlayTiming",
|
|
129
|
+
"language": "swift"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
122
132
|
"Cluster": {
|
|
123
133
|
"android": {
|
|
124
134
|
"implementationClassName": "HybridCluster",
|
|
@@ -37,6 +37,7 @@ target_sources(
|
|
|
37
37
|
../nitrogen/generated/shared/c++/HybridAndroidAutoTelemetrySpec.cpp
|
|
38
38
|
../nitrogen/generated/shared/c++/HybridAndroidWindowInformationSpec.cpp
|
|
39
39
|
../nitrogen/generated/shared/c++/HybridAutoPlaySpec.cpp
|
|
40
|
+
../nitrogen/generated/shared/c++/HybridAutoPlayTimingSpec.cpp
|
|
40
41
|
../nitrogen/generated/shared/c++/HybridCarPlayDashboardSpec.cpp
|
|
41
42
|
../nitrogen/generated/shared/c++/HybridClusterSpec.cpp
|
|
42
43
|
../nitrogen/generated/shared/c++/HybridGridTemplateSpec.cpp
|
|
@@ -53,6 +54,7 @@ target_sources(
|
|
|
53
54
|
../nitrogen/generated/android/c++/JHybridAndroidWindowInformationSpec.cpp
|
|
54
55
|
../nitrogen/generated/android/c++/JHybridAutoPlaySpec.cpp
|
|
55
56
|
../nitrogen/generated/android/c++/JVariant_GlyphImage_AssetImage_RemoteImage.cpp
|
|
57
|
+
../nitrogen/generated/android/c++/JHybridAutoPlayTimingSpec.cpp
|
|
56
58
|
../nitrogen/generated/android/c++/JHybridClusterSpec.cpp
|
|
57
59
|
../nitrogen/generated/android/c++/JNitroImage.cpp
|
|
58
60
|
../nitrogen/generated/android/c++/JHybridGridTemplateSpec.cpp
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
#include "JFunc_void_VisibilityState.hpp"
|
|
28
28
|
#include "JFunc_void_std__optional_Location__std__optional_std__string_.hpp"
|
|
29
29
|
#include "JFunc_void_SafeAreaInsets.hpp"
|
|
30
|
+
#include "JHybridAutoPlayTimingSpec.hpp"
|
|
30
31
|
#include "JHybridClusterSpec.hpp"
|
|
31
32
|
#include "JFunc_void_std__string.hpp"
|
|
32
33
|
#include "JFunc_void_std__string_ColorScheme.hpp"
|
|
@@ -156,6 +157,14 @@ struct JHybridSearchTemplateSpecImpl: public jni::JavaClass<JHybridSearchTemplat
|
|
|
156
157
|
return javaPart->getJHybridSearchTemplateSpec();
|
|
157
158
|
}
|
|
158
159
|
};
|
|
160
|
+
struct JHybridAutoPlayTimingSpecImpl: public jni::JavaClass<JHybridAutoPlayTimingSpecImpl, JHybridAutoPlayTimingSpec::JavaPart> {
|
|
161
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAutoPlayTiming;";
|
|
162
|
+
static std::shared_ptr<JHybridAutoPlayTimingSpec> create() {
|
|
163
|
+
static const auto constructorFn = javaClassStatic()->getConstructor<JHybridAutoPlayTimingSpecImpl::javaobject()>();
|
|
164
|
+
jni::local_ref<JHybridAutoPlayTimingSpec::JavaPart> javaPart = javaClassStatic()->newObject(constructorFn);
|
|
165
|
+
return javaPart->getJHybridAutoPlayTimingSpec();
|
|
166
|
+
}
|
|
167
|
+
};
|
|
159
168
|
struct JHybridClusterSpecImpl: public jni::JavaClass<JHybridClusterSpecImpl, JHybridClusterSpec::JavaPart> {
|
|
160
169
|
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/swe/iternio/reactnativeautoplay/HybridCluster;";
|
|
161
170
|
static std::shared_ptr<JHybridClusterSpec> create() {
|
|
@@ -182,6 +191,7 @@ void registerAllNatives() {
|
|
|
182
191
|
margelo::nitro::swe::iternio::reactnativeautoplay::JFunc_void_VisibilityState_cxx::registerNatives();
|
|
183
192
|
margelo::nitro::swe::iternio::reactnativeautoplay::JFunc_void_std__optional_Location__std__optional_std__string__cxx::registerNatives();
|
|
184
193
|
margelo::nitro::swe::iternio::reactnativeautoplay::JFunc_void_SafeAreaInsets_cxx::registerNatives();
|
|
194
|
+
margelo::nitro::swe::iternio::reactnativeautoplay::JHybridAutoPlayTimingSpec::CxxPart::registerNatives();
|
|
185
195
|
margelo::nitro::swe::iternio::reactnativeautoplay::JHybridClusterSpec::CxxPart::registerNatives();
|
|
186
196
|
margelo::nitro::swe::iternio::reactnativeautoplay::JFunc_void_std__string_cxx::registerNatives();
|
|
187
197
|
margelo::nitro::swe::iternio::reactnativeautoplay::JFunc_void_std__string_ColorScheme_cxx::registerNatives();
|
|
@@ -279,6 +289,12 @@ void registerAllNatives() {
|
|
|
279
289
|
return JHybridSearchTemplateSpecImpl::create();
|
|
280
290
|
}
|
|
281
291
|
);
|
|
292
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
293
|
+
"AutoPlayTiming",
|
|
294
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
295
|
+
return JHybridAutoPlayTimingSpecImpl::create();
|
|
296
|
+
}
|
|
297
|
+
);
|
|
282
298
|
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
283
299
|
"Cluster",
|
|
284
300
|
[]() -> std::shared_ptr<HybridObject> {
|
|
@@ -19,7 +19,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
19
19
|
using namespace facebook;
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
* The C++ JNI bridge between the C++ struct "ActiveCarUxRestrictions" and the
|
|
22
|
+
* The C++ JNI bridge between the C++ struct "ActiveCarUxRestrictions" and the Kotlin data class "ActiveCarUxRestrictions".
|
|
23
23
|
*/
|
|
24
24
|
struct JActiveCarUxRestrictions final: public jni::JavaClass<JActiveCarUxRestrictions> {
|
|
25
25
|
public:
|
|
@@ -15,7 +15,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
15
15
|
using namespace facebook;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* The C++ JNI bridge between the C++ enum "AlertActionStyle" and the
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "AlertActionStyle" and the Kotlin enum "AlertActionStyle".
|
|
19
19
|
*/
|
|
20
20
|
struct JAlertActionStyle final: public jni::JavaClass<JAlertActionStyle> {
|
|
21
21
|
public:
|
|
@@ -15,7 +15,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
15
15
|
using namespace facebook;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* The C++ JNI bridge between the C++ enum "AlertDismissalReason" and the
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "AlertDismissalReason" and the Kotlin enum "AlertDismissalReason".
|
|
19
19
|
*/
|
|
20
20
|
struct JAlertDismissalReason final: public jni::JavaClass<JAlertDismissalReason> {
|
|
21
21
|
public:
|
|
@@ -17,7 +17,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
17
17
|
using namespace facebook;
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* The C++ JNI bridge between the C++ struct "AppFocusState" and the
|
|
20
|
+
* The C++ JNI bridge between the C++ struct "AppFocusState" and the Kotlin data class "AppFocusState".
|
|
21
21
|
*/
|
|
22
22
|
struct JAppFocusState final: public jni::JavaClass<JAppFocusState> {
|
|
23
23
|
public:
|
|
@@ -20,7 +20,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
20
20
|
using namespace facebook;
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
* The C++ JNI bridge between the C++ struct "AssetImage" and the
|
|
23
|
+
* The C++ JNI bridge between the C++ struct "AssetImage" and the Kotlin data class "AssetImage".
|
|
24
24
|
*/
|
|
25
25
|
struct JAssetImage final: public jni::JavaClass<JAssetImage> {
|
|
26
26
|
public:
|
|
@@ -34,25 +34,25 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
34
34
|
[[nodiscard]]
|
|
35
35
|
AssetImage toCpp() const {
|
|
36
36
|
static const auto clazz = javaClassStatic();
|
|
37
|
-
static const auto
|
|
38
|
-
jni::local_ref<
|
|
39
|
-
static const auto fieldPackager_asset = clazz->getField<jboolean>("packager_asset");
|
|
40
|
-
jboolean packager_asset = this->getFieldValue(fieldPackager_asset);
|
|
41
|
-
static const auto fieldHeight = clazz->getField<double>("height");
|
|
42
|
-
double height = this->getFieldValue(fieldHeight);
|
|
37
|
+
static const auto fieldUri = clazz->getField<jni::JString>("uri");
|
|
38
|
+
jni::local_ref<jni::JString> uri = this->getFieldValue(fieldUri);
|
|
43
39
|
static const auto fieldWidth = clazz->getField<double>("width");
|
|
44
40
|
double width = this->getFieldValue(fieldWidth);
|
|
41
|
+
static const auto fieldHeight = clazz->getField<double>("height");
|
|
42
|
+
double height = this->getFieldValue(fieldHeight);
|
|
45
43
|
static const auto fieldScale = clazz->getField<double>("scale");
|
|
46
44
|
double scale = this->getFieldValue(fieldScale);
|
|
47
|
-
static const auto
|
|
48
|
-
jni::local_ref<
|
|
45
|
+
static const auto fieldColor = clazz->getField<JNitroColor>("color");
|
|
46
|
+
jni::local_ref<JNitroColor> color = this->getFieldValue(fieldColor);
|
|
47
|
+
static const auto fieldPackager_asset = clazz->getField<jboolean>("packager_asset");
|
|
48
|
+
jboolean packager_asset = this->getFieldValue(fieldPackager_asset);
|
|
49
49
|
return AssetImage(
|
|
50
|
-
|
|
51
|
-
static_cast<bool>(packager_asset),
|
|
52
|
-
height,
|
|
50
|
+
uri->toStdString(),
|
|
53
51
|
width,
|
|
52
|
+
height,
|
|
54
53
|
scale,
|
|
55
|
-
|
|
54
|
+
color != nullptr ? std::make_optional(color->toCpp()) : std::nullopt,
|
|
55
|
+
static_cast<bool>(packager_asset)
|
|
56
56
|
);
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -62,17 +62,17 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
62
62
|
*/
|
|
63
63
|
[[maybe_unused]]
|
|
64
64
|
static jni::local_ref<JAssetImage::javaobject> fromCpp(const AssetImage& value) {
|
|
65
|
-
using JSignature = JAssetImage(jni::alias_ref<
|
|
65
|
+
using JSignature = JAssetImage(jni::alias_ref<jni::JString>, double, double, double, jni::alias_ref<JNitroColor>, jboolean);
|
|
66
66
|
static const auto clazz = javaClassStatic();
|
|
67
67
|
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
68
68
|
return create(
|
|
69
69
|
clazz,
|
|
70
|
-
|
|
71
|
-
value.packager_asset,
|
|
72
|
-
value.height,
|
|
70
|
+
jni::make_jstring(value.uri),
|
|
73
71
|
value.width,
|
|
72
|
+
value.height,
|
|
74
73
|
value.scale,
|
|
75
|
-
|
|
74
|
+
value.color.has_value() ? JNitroColor::fromCpp(value.color.value()) : nullptr,
|
|
75
|
+
value.packager_asset
|
|
76
76
|
);
|
|
77
77
|
}
|
|
78
78
|
};
|
|
@@ -22,7 +22,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
22
22
|
using namespace facebook;
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
* The C++ JNI bridge between the C++ struct "AutoText" and the
|
|
25
|
+
* The C++ JNI bridge between the C++ struct "AutoText" and the Kotlin data class "AutoText".
|
|
26
26
|
*/
|
|
27
27
|
struct JAutoText final: public jni::JavaClass<JAutoText> {
|
|
28
28
|
public:
|
|
@@ -17,7 +17,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
17
17
|
using namespace facebook;
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* The C++ JNI bridge between the C++ struct "BooleanTelemetryItem" and the
|
|
20
|
+
* The C++ JNI bridge between the C++ struct "BooleanTelemetryItem" and the Kotlin data class "BooleanTelemetryItem".
|
|
21
21
|
*/
|
|
22
22
|
struct JBooleanTelemetryItem final: public jni::JavaClass<JBooleanTelemetryItem> {
|
|
23
23
|
public:
|
|
@@ -15,7 +15,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
15
15
|
using namespace facebook;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* The C++ JNI bridge between the C++ enum "CarUxRestrictions" and the
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "CarUxRestrictions" and the Kotlin enum "CarUxRestrictions".
|
|
19
19
|
*/
|
|
20
20
|
struct JCarUxRestrictions final: public jni::JavaClass<JCarUxRestrictions> {
|
|
21
21
|
public:
|
|
@@ -15,7 +15,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
15
15
|
using namespace facebook;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* The C++ JNI bridge between the C++ enum "ChargingConnector" and the
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "ChargingConnector" and the Kotlin enum "ChargingConnector".
|
|
19
19
|
*/
|
|
20
20
|
struct JChargingConnector final: public jni::JavaClass<JChargingConnector> {
|
|
21
21
|
public:
|
|
@@ -15,7 +15,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
15
15
|
using namespace facebook;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* The C++ JNI bridge between the C++ enum "ClusterEventName" and the
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "ClusterEventName" and the Kotlin enum "ClusterEventName".
|
|
19
19
|
*/
|
|
20
20
|
struct JClusterEventName final: public jni::JavaClass<JClusterEventName> {
|
|
21
21
|
public:
|
|
@@ -15,7 +15,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
15
15
|
using namespace facebook;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* The C++ JNI bridge between the C++ enum "ColorScheme" and the
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "ColorScheme" and the Kotlin enum "ColorScheme".
|
|
19
19
|
*/
|
|
20
20
|
struct JColorScheme final: public jni::JavaClass<JColorScheme> {
|
|
21
21
|
public:
|
|
@@ -18,7 +18,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
18
18
|
using namespace facebook;
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* The C++ JNI bridge between the C++ struct "Distance" and the
|
|
21
|
+
* The C++ JNI bridge between the C++ struct "Distance" and the Kotlin data class "Distance".
|
|
22
22
|
*/
|
|
23
23
|
struct JDistance final: public jni::JavaClass<JDistance> {
|
|
24
24
|
public:
|
|
@@ -15,7 +15,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
15
15
|
using namespace facebook;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* The C++ JNI bridge between the C++ enum "DistanceUnits" and the
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "DistanceUnits" and the Kotlin enum "DistanceUnits".
|
|
19
19
|
*/
|
|
20
20
|
struct JDistanceUnits final: public jni::JavaClass<JDistanceUnits> {
|
|
21
21
|
public:
|
|
@@ -17,7 +17,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
17
17
|
using namespace facebook;
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* The C++ JNI bridge between the C++ struct "DurationWithTimeZone" and the
|
|
20
|
+
* The C++ JNI bridge between the C++ struct "DurationWithTimeZone" and the Kotlin data class "DurationWithTimeZone".
|
|
21
21
|
*/
|
|
22
22
|
struct JDurationWithTimeZone final: public jni::JavaClass<JDurationWithTimeZone> {
|
|
23
23
|
public:
|
|
@@ -15,7 +15,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
15
15
|
using namespace facebook;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* The C++ JNI bridge between the C++ enum "EventName" and the
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "EventName" and the Kotlin enum "EventName".
|
|
19
19
|
*/
|
|
20
20
|
struct JEventName final: public jni::JavaClass<JEventName> {
|
|
21
21
|
public:
|
|
@@ -15,7 +15,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
15
15
|
using namespace facebook;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* The C++ JNI bridge between the C++ enum "ForkType" and the
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "ForkType" and the Kotlin enum "ForkType".
|
|
19
19
|
*/
|
|
20
20
|
struct JForkType final: public jni::JavaClass<JForkType> {
|
|
21
21
|
public:
|
|
@@ -20,7 +20,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
20
20
|
using namespace facebook;
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
* The C++ JNI bridge between the C++ struct "GlyphImage" and the
|
|
23
|
+
* The C++ JNI bridge between the C++ struct "GlyphImage" and the Kotlin data class "GlyphImage".
|
|
24
24
|
*/
|
|
25
25
|
struct JGlyphImage final: public jni::JavaClass<JGlyphImage> {
|
|
26
26
|
public:
|
|
@@ -25,7 +25,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
25
25
|
using namespace facebook;
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
* The C++ JNI bridge between the C++ struct "GoogleSignIn" and the
|
|
28
|
+
* The C++ JNI bridge between the C++ struct "GoogleSignIn" and the Kotlin data class "GoogleSignIn".
|
|
29
29
|
*/
|
|
30
30
|
struct JGoogleSignIn final: public jni::JavaClass<JGoogleSignIn> {
|
|
31
31
|
public:
|
|
@@ -18,7 +18,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
18
18
|
using namespace facebook;
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* The C++ JNI bridge between the C++ struct "GoogleSignInAccount" and the
|
|
21
|
+
* The C++ JNI bridge between the C++ struct "GoogleSignInAccount" and the Kotlin data class "GoogleSignInAccount".
|
|
22
22
|
*/
|
|
23
23
|
struct JGoogleSignInAccount final: public jni::JavaClass<JGoogleSignInAccount> {
|
|
24
24
|
public:
|
|
@@ -15,7 +15,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
15
15
|
using namespace facebook;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* The C++ JNI bridge between the C++ enum "GridImageSize" and the
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "GridImageSize" and the Kotlin enum "GridImageSize".
|
|
19
19
|
*/
|
|
20
20
|
struct JGridImageSize final: public jni::JavaClass<JGridImageSize> {
|
|
21
21
|
public:
|
|
@@ -59,7 +59,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
59
59
|
using namespace facebook;
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
|
-
* The C++ JNI bridge between the C++ struct "GridTemplateConfig" and the
|
|
62
|
+
* The C++ JNI bridge between the C++ struct "GridTemplateConfig" and the Kotlin data class "GridTemplateConfig".
|
|
63
63
|
*/
|
|
64
64
|
struct JGridTemplateConfig final: public jni::JavaClass<JGridTemplateConfig> {
|
|
65
65
|
public:
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JHybridAutoPlayTimingSpec.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "JHybridAutoPlayTimingSpec.hpp"
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
#include <functional>
|
|
13
|
+
#include "JFunc_void.hpp"
|
|
14
|
+
#include <NitroModules/JNICallable.hpp>
|
|
15
|
+
|
|
16
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
17
|
+
|
|
18
|
+
std::shared_ptr<JHybridAutoPlayTimingSpec> JHybridAutoPlayTimingSpec::JavaPart::getJHybridAutoPlayTimingSpec() {
|
|
19
|
+
auto hybridObject = JHybridObject::JavaPart::getJHybridObject();
|
|
20
|
+
auto castHybridObject = std::dynamic_pointer_cast<JHybridAutoPlayTimingSpec>(hybridObject);
|
|
21
|
+
if (castHybridObject == nullptr) [[unlikely]] {
|
|
22
|
+
throw std::runtime_error("Failed to downcast JHybridObject to JHybridAutoPlayTimingSpec!");
|
|
23
|
+
}
|
|
24
|
+
return castHybridObject;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
jni::local_ref<JHybridAutoPlayTimingSpec::CxxPart::jhybriddata> JHybridAutoPlayTimingSpec::CxxPart::initHybrid(jni::alias_ref<jhybridobject> jThis) {
|
|
28
|
+
return makeCxxInstance(jThis);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
std::shared_ptr<JHybridObject> JHybridAutoPlayTimingSpec::CxxPart::createHybridObject(const jni::local_ref<JHybridObject::JavaPart>& javaPart) {
|
|
32
|
+
auto castJavaPart = jni::dynamic_ref_cast<JHybridAutoPlayTimingSpec::JavaPart>(javaPart);
|
|
33
|
+
if (castJavaPart == nullptr) [[unlikely]] {
|
|
34
|
+
throw std::runtime_error("Failed to cast JHybridObject::JavaPart to JHybridAutoPlayTimingSpec::JavaPart!");
|
|
35
|
+
}
|
|
36
|
+
return std::make_shared<JHybridAutoPlayTimingSpec>(castJavaPart);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
void JHybridAutoPlayTimingSpec::CxxPart::registerNatives() {
|
|
40
|
+
registerHybrid({
|
|
41
|
+
makeNativeMethod("initHybrid", JHybridAutoPlayTimingSpec::CxxPart::initHybrid),
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Properties
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
// Methods
|
|
49
|
+
double JHybridAutoPlayTimingSpec::createTimer(const std::function<void()>& callback, double durationMs, bool repeats) {
|
|
50
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<double(jni::alias_ref<JFunc_void::javaobject> /* callback */, double /* durationMs */, jboolean /* repeats */)>("createTimer_cxx");
|
|
51
|
+
auto __result = method(_javaPart, JFunc_void_cxx::fromCpp(callback), durationMs, repeats);
|
|
52
|
+
return __result;
|
|
53
|
+
}
|
|
54
|
+
void JHybridAutoPlayTimingSpec::deleteTimer(double id) {
|
|
55
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(double /* id */)>("deleteTimer");
|
|
56
|
+
method(_javaPart, id);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|