@iternio/react-native-auto-play 0.0.2 → 0.0.4
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/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/AndroidAutoSession.kt +2 -0
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/{hybrid/HybridAutoPlay.kt → HybridAutoPlay.kt} +20 -20
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/{hybrid/HybridSearchTemplate.kt → HybridSearchTemplate.kt} +3 -3
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/VirtualRenderer.kt +1 -1
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/template/GridTemplate.kt +1 -16
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/template/InformationTemplate.kt +1 -14
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/template/ListTemplate.kt +1 -16
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/template/MapTemplate.kt +5 -1
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/template/MessageTemplate.kt +1 -16
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/template/Parser.kt +59 -18
- package/ios/Types.swift +1 -0
- package/ios/hybrid/HybridAutoPlay.swift +5 -4
- package/ios/hybrid/HybridGridTemplate.swift +3 -6
- package/ios/hybrid/HybridInformationTemplate.swift +9 -9
- package/ios/hybrid/HybridListTemplate.swift +3 -6
- package/ios/hybrid/HybridMapTemplate.swift +21 -16
- package/ios/hybrid/HybridSearchTemplate.swift +7 -11
- package/ios/templates/AutoPlayTemplate.swift +31 -48
- package/ios/templates/GridTemplate.swift +31 -22
- package/ios/templates/InformationTemplate.swift +29 -21
- package/ios/templates/ListTemplate.swift +29 -20
- package/ios/templates/MapTemplate.swift +162 -61
- package/ios/templates/MessageTemplate.swift +19 -12
- package/ios/templates/SearchTemplate.swift +17 -25
- package/ios/templates/TemplateStore.swift +3 -3
- package/ios/utils/RootModule.swift +36 -38
- package/lib/templates/MapTemplate.d.ts +14 -3
- package/lib/templates/Template.d.ts +1 -0
- package/lib/types/Button.d.ts +5 -4
- package/lib/types/Maneuver.d.ts +3 -1
- package/lib/utils/NitroMapButton.d.ts +2 -2
- package/lib/utils/NitroMapButton.js +4 -9
- package/nitrogen/generated/android/ReactNativeAutoPlayOnLoad.cpp +2 -0
- package/nitrogen/generated/android/c++/JFunc_void_bool.hpp +74 -0
- package/nitrogen/generated/android/c++/JGridTemplateConfig.hpp +1 -0
- package/nitrogen/generated/android/c++/JHybridGridTemplateSpec.cpp +1 -0
- package/nitrogen/generated/android/c++/JHybridInformationTemplateSpec.cpp +2 -0
- package/nitrogen/generated/android/c++/JHybridListTemplateSpec.cpp +2 -0
- package/nitrogen/generated/android/c++/JHybridMapTemplateSpec.cpp +3 -2
- package/nitrogen/generated/android/c++/JHybridMessageTemplateSpec.cpp +2 -0
- package/nitrogen/generated/android/c++/JInformationTemplateConfig.hpp +2 -0
- package/nitrogen/generated/android/c++/JListTemplateConfig.hpp +2 -0
- package/nitrogen/generated/android/c++/JMapTemplateConfig.hpp +31 -11
- package/nitrogen/generated/android/c++/JMessageTemplateConfig.hpp +2 -0
- package/nitrogen/generated/android/c++/JNitroBaseMapTemplateConfig.hpp +17 -1
- package/nitrogen/generated/android/c++/JNitroMapButton.hpp +9 -9
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_bool.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/MapTemplateConfig.kt +12 -6
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroBaseMapTemplateConfig.kt +7 -4
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroMapButton.kt +5 -5
- package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Bridge.cpp +8 -0
- package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Bridge.hpp +37 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +47 -0
- package/nitrogen/generated/ios/swift/MapTemplateConfig.swift +70 -6
- package/nitrogen/generated/ios/swift/NitroBaseMapTemplateConfig.swift +42 -1
- package/nitrogen/generated/ios/swift/NitroMapButton.swift +54 -54
- package/nitrogen/generated/shared/c++/MapTemplateConfig.hpp +14 -6
- package/nitrogen/generated/shared/c++/NitroBaseMapTemplateConfig.hpp +5 -1
- package/nitrogen/generated/shared/c++/NitroMapButton.hpp +10 -10
- package/package.json +1 -1
- package/src/templates/MapTemplate.ts +32 -12
- package/src/templates/Template.ts +1 -0
- package/src/types/Button.ts +5 -4
- package/src/types/Maneuver.ts +1 -1
- package/src/utils/NitroMapButton.ts +6 -14
- /package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/{hybrid/HybridAndroidAutoTelemetry.kt → HybridAndroidAutoTelemetry.kt} +0 -0
- /package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/{hybrid/HybridCluster.kt → HybridCluster.kt} +0 -0
- /package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/{hybrid/HybridGridTemplate.kt → HybridGridTemplate.kt} +0 -0
- /package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/{hybrid/HybridInformationTemplate.kt → HybridInformationTemplate.kt} +0 -0
- /package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/{hybrid/HybridListTemplate.kt → HybridListTemplate.kt} +0 -0
- /package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/{hybrid/HybridMapTemplate.kt → HybridMapTemplate.kt} +0 -0
- /package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/{hybrid/HybridMessageTemplate.kt → HybridMessageTemplate.kt} +0 -0
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
import CarPlay
|
|
9
9
|
|
|
10
10
|
class RootModule {
|
|
11
|
-
static func withScene(
|
|
11
|
+
static func withScene(
|
|
12
|
+
perform action: @escaping (AutoPlayScene) throws -> Void
|
|
13
|
+
) throws {
|
|
12
14
|
guard
|
|
13
15
|
let scene = SceneStore.getScene(
|
|
14
16
|
moduleName: SceneStore.rootModuleName
|
|
@@ -18,33 +20,49 @@ class RootModule {
|
|
|
18
20
|
"operation failed, \(SceneStore.rootModuleName) scene not found"
|
|
19
21
|
)
|
|
20
22
|
}
|
|
21
|
-
|
|
23
|
+
|
|
22
24
|
try action(scene)
|
|
23
25
|
}
|
|
24
|
-
|
|
25
|
-
static func
|
|
26
|
+
|
|
27
|
+
static func withAutoPlayTemplate<T>(
|
|
28
|
+
templateId: String,
|
|
29
|
+
perform action: @escaping (T) throws -> Void
|
|
30
|
+
) throws {
|
|
26
31
|
try withScene { scene in
|
|
27
32
|
guard
|
|
28
|
-
let template = scene.templateStore.getTemplate(
|
|
33
|
+
let template = scene.templateStore.getTemplate(
|
|
34
|
+
templateId: templateId
|
|
35
|
+
)
|
|
29
36
|
else {
|
|
30
37
|
throw AutoPlayError.templateNotFound(templateId)
|
|
31
38
|
}
|
|
32
|
-
|
|
39
|
+
|
|
40
|
+
guard let template = template as? T else {
|
|
41
|
+
throw AutoPlayError.invalidTemplateType(
|
|
42
|
+
"\(template) is not a \(T.self) template"
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
33
46
|
try action(template)
|
|
34
47
|
}
|
|
35
48
|
}
|
|
36
|
-
|
|
37
|
-
static func
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
49
|
+
|
|
50
|
+
static func withTemplate<T: CPTemplate>(
|
|
51
|
+
templateId: String,
|
|
52
|
+
perform action: @escaping (T) throws -> Void
|
|
53
|
+
) throws {
|
|
54
|
+
try withAutoPlayTemplate(templateId: templateId) {
|
|
55
|
+
(autoPlayTemplate: AutoPlayTemplate) in
|
|
56
|
+
if let template = autoPlayTemplate.getTemplate() as? T {
|
|
57
|
+
try! action(template)
|
|
58
|
+
} else {
|
|
59
|
+
throw AutoPlayError.invalidTemplateType(
|
|
60
|
+
"\(autoPlayTemplate) is not a \(T.self) template"
|
|
42
61
|
)
|
|
43
62
|
}
|
|
44
|
-
try action(template)
|
|
45
63
|
}
|
|
46
64
|
}
|
|
47
|
-
|
|
65
|
+
|
|
48
66
|
@MainActor
|
|
49
67
|
static func withScene<T>(
|
|
50
68
|
perform action:
|
|
@@ -66,7 +84,8 @@ class RootModule {
|
|
|
66
84
|
@MainActor
|
|
67
85
|
static func withSceneAndInterfaceController<T>(
|
|
68
86
|
perform action:
|
|
69
|
-
@escaping (AutoPlayScene, AutoPlayInterfaceController) async throws
|
|
87
|
+
@escaping (AutoPlayScene, AutoPlayInterfaceController) async throws
|
|
88
|
+
-> T
|
|
70
89
|
) async throws -> T {
|
|
71
90
|
return try await withScene { scene in
|
|
72
91
|
guard let interfaceController = scene.interfaceController else {
|
|
@@ -81,35 +100,14 @@ class RootModule {
|
|
|
81
100
|
|
|
82
101
|
@MainActor
|
|
83
102
|
static func withInterfaceController<T>(
|
|
84
|
-
perform action:
|
|
103
|
+
perform action:
|
|
104
|
+
@escaping (AutoPlayInterfaceController) async throws -> T
|
|
85
105
|
) async throws -> T {
|
|
86
106
|
try await withSceneAndInterfaceController { _, interfaceController in
|
|
87
107
|
try await action(interfaceController)
|
|
88
108
|
}
|
|
89
109
|
}
|
|
90
110
|
|
|
91
|
-
@MainActor
|
|
92
|
-
static func withTemplateAndInterfaceController<T>(
|
|
93
|
-
templateId: String,
|
|
94
|
-
perform action:
|
|
95
|
-
@escaping (CPTemplate, AutoPlayInterfaceController) async throws -> T
|
|
96
|
-
) async throws -> T {
|
|
97
|
-
return try await withSceneAndInterfaceController {
|
|
98
|
-
scene,
|
|
99
|
-
interfaceController in
|
|
100
|
-
guard
|
|
101
|
-
let template = scene.templateStore.getCPTemplate(
|
|
102
|
-
templateId: templateId
|
|
103
|
-
)
|
|
104
|
-
else {
|
|
105
|
-
throw AutoPlayError.templateNotFound(
|
|
106
|
-
"operation failed, \(templateId) template not found"
|
|
107
|
-
)
|
|
108
|
-
}
|
|
109
|
-
return try await action(template, interfaceController)
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
111
|
@MainActor
|
|
114
112
|
static func withSceneTemplateAndInterfaceController<T>(
|
|
115
113
|
templateId: String,
|
|
@@ -13,7 +13,9 @@ export type Point = {
|
|
|
13
13
|
y: number;
|
|
14
14
|
};
|
|
15
15
|
export type VisibleTravelEstimate = 'first' | 'last';
|
|
16
|
-
export type HeaderActionsAndroidMap<T> =
|
|
16
|
+
export type HeaderActionsAndroidMap<T> = Array<ActionButtonAndroid<T>> & {
|
|
17
|
+
length: 1 | 2 | 3 | 4;
|
|
18
|
+
};
|
|
17
19
|
export interface NavigationAlertCallbacks {
|
|
18
20
|
dismiss: CleanupCallback;
|
|
19
21
|
update: (title: AutoText, subtitle?: AutoText) => void;
|
|
@@ -28,7 +30,7 @@ export interface NitroMapTemplateConfig extends TemplateConfig, NitroBaseMapTemp
|
|
|
28
30
|
* @param translation distance in pixels along the x & y axis that has been scrolled since the last touch position during the scroll event
|
|
29
31
|
* @param velocity the velocity of the pan gesture, iOS only
|
|
30
32
|
*/
|
|
31
|
-
|
|
33
|
+
onDidPan?: (translation: Point, velocity?: Point) => void;
|
|
32
34
|
/**
|
|
33
35
|
* callback for pinch to zoom gesture
|
|
34
36
|
* @param center x & y coordinate of the focal point in pixels
|
|
@@ -55,8 +57,15 @@ export interface NitroMapTemplateConfig extends TemplateConfig, NitroBaseMapTemp
|
|
|
55
57
|
onAutoDriveEnabled?: () => void;
|
|
56
58
|
mapButtons?: Array<NitroMapButton>;
|
|
57
59
|
headerActions?: Array<NitroAction>;
|
|
60
|
+
/**
|
|
61
|
+
* specify the percentage of screen height/width the pan button should scroll
|
|
62
|
+
* @namespace iOS
|
|
63
|
+
*/
|
|
64
|
+
panButtonScrollPercentage?: 0 | 0.05 | 0.1 | 0.15 | 0.2 | 0.25 | 0.3 | 0.35 | 0.4 | 0.45 | 0.5 | 0.55 | 0.6 | 0.65 | 0.7 | 0.75 | 0.8 | 0.85 | 0.9 | 0.95 | 1;
|
|
58
65
|
}
|
|
59
|
-
export type MapButtons<T> =
|
|
66
|
+
export type MapButtons<T> = Array<MapButton<T> | MapPanButton> & {
|
|
67
|
+
length: 1 | 2 | 3 | 4;
|
|
68
|
+
};
|
|
60
69
|
export type MapHeaderActions<T> = {
|
|
61
70
|
android?: HeaderActionsAndroidMap<T>;
|
|
62
71
|
ios?: HeaderActionsIos<T>;
|
|
@@ -64,6 +73,8 @@ export type MapHeaderActions<T> = {
|
|
|
64
73
|
export type BaseMapTemplateConfig<T> = {
|
|
65
74
|
/**
|
|
66
75
|
* buttons that represent actions on the map template, usually on the bottom right corner
|
|
76
|
+
* @namespace Android - adding a pan button will always make the pan button the first one
|
|
77
|
+
* @namespace iOS - the pan button can be on any position
|
|
67
78
|
*/
|
|
68
79
|
mapButtons?: MapButtons<T>;
|
|
69
80
|
/**
|
|
@@ -56,6 +56,7 @@ export interface TemplateConfig {
|
|
|
56
56
|
export interface NitroBaseMapTemplateConfig extends TemplateConfig {
|
|
57
57
|
mapButtons?: Array<NitroMapButton>;
|
|
58
58
|
headerActions?: Array<NitroAction>;
|
|
59
|
+
onDidChangePanningInterface?: (isPanningInterfaceVisible: boolean) => void;
|
|
59
60
|
}
|
|
60
61
|
export declare class Template<TemplateConfigType, ActionsType> {
|
|
61
62
|
id: string;
|
package/lib/types/Button.d.ts
CHANGED
|
@@ -6,12 +6,13 @@ export type MapButton<T = unknown> = {
|
|
|
6
6
|
};
|
|
7
7
|
export type ButtonStyle = 'normal' | 'confirm' | 'cancel';
|
|
8
8
|
/**
|
|
9
|
-
* this
|
|
10
|
-
* @namespace Android
|
|
9
|
+
* pressing this button will bring up the system default pan interface
|
|
10
|
+
* @namespace Android - this button might not be shown, usually when the device has a touch screen
|
|
11
|
+
* @namespace iOS - this button will always be shown, no matter if the device has a touch screen or not
|
|
11
12
|
*/
|
|
12
|
-
export type MapPanButton
|
|
13
|
+
export type MapPanButton = {
|
|
13
14
|
type: 'pan';
|
|
14
|
-
|
|
15
|
+
image: AutoImage;
|
|
15
16
|
};
|
|
16
17
|
type BaseButton<T = unknown> = {
|
|
17
18
|
style?: ButtonStyle;
|
package/lib/types/Maneuver.d.ts
CHANGED
|
@@ -196,5 +196,7 @@ export type MessageManeuver = {
|
|
|
196
196
|
cardBackgroundColor: ThemedColor | string;
|
|
197
197
|
type: 'message';
|
|
198
198
|
};
|
|
199
|
-
export type AutoManeuver =
|
|
199
|
+
export type AutoManeuver = (Array<RoutingManeuver> & {
|
|
200
|
+
length: 1 | 2;
|
|
201
|
+
}) | MessageManeuver;
|
|
200
202
|
export {};
|
|
@@ -3,8 +3,8 @@ import { type NitroImage } from './NitroImage';
|
|
|
3
3
|
type NitroMapButtonType = 'pan' | 'custom';
|
|
4
4
|
export type NitroMapButton = {
|
|
5
5
|
type: NitroMapButtonType;
|
|
6
|
-
image
|
|
7
|
-
onPress
|
|
6
|
+
image: NitroImage;
|
|
7
|
+
onPress?: () => void;
|
|
8
8
|
};
|
|
9
9
|
export declare const NitroMapButton: {
|
|
10
10
|
convert: <T>(template: T, mapButtons?: MapButtons<T>) => Array<NitroMapButton> | undefined;
|
|
@@ -5,13 +5,8 @@ const convert = (template, mapButtons) => {
|
|
|
5
5
|
return undefined;
|
|
6
6
|
}
|
|
7
7
|
return mapButtons?.map((button) => {
|
|
8
|
-
const {
|
|
9
|
-
|
|
10
|
-
if (Platform.OS === 'android') {
|
|
11
|
-
return { type: 'pan', onPress: () => onPress(template) };
|
|
12
|
-
}
|
|
13
|
-
throw new Error('unsupported platform, pan button can be used on Android only! Use a custom button instead.');
|
|
14
|
-
}
|
|
8
|
+
const { type } = button;
|
|
9
|
+
const onPress = button.type === 'custom' ? () => button.onPress(template) : undefined;
|
|
15
10
|
if (button.image.type === 'glyph') {
|
|
16
11
|
const backgroundColor = Platform.OS === 'android'
|
|
17
12
|
? 'transparent'
|
|
@@ -21,13 +16,13 @@ const convert = (template, mapButtons) => {
|
|
|
21
16
|
const fontScale = (button.image.fontScale ?? Platform.OS === 'android') ? 1.0 : 0.65;
|
|
22
17
|
return {
|
|
23
18
|
type,
|
|
24
|
-
onPress
|
|
19
|
+
onPress,
|
|
25
20
|
image: NitroImageUtil.convert({ ...button.image, backgroundColor, fontScale }),
|
|
26
21
|
};
|
|
27
22
|
}
|
|
28
23
|
return {
|
|
29
24
|
type,
|
|
30
|
-
onPress
|
|
25
|
+
onPress,
|
|
31
26
|
image: NitroImageUtil.convert(button.image),
|
|
32
27
|
};
|
|
33
28
|
});
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
#include "JFunc_void_std__string_bool.hpp"
|
|
29
29
|
#include "JHybridGridTemplateSpec.hpp"
|
|
30
30
|
#include "JFunc_void_std__optional_bool_.hpp"
|
|
31
|
+
#include "JFunc_void_bool.hpp"
|
|
31
32
|
#include "JHybridInformationTemplateSpec.hpp"
|
|
32
33
|
#include "JHybridListTemplateSpec.hpp"
|
|
33
34
|
#include "JHybridMapTemplateSpec.hpp"
|
|
@@ -64,6 +65,7 @@ int initialize(JavaVM* vm) {
|
|
|
64
65
|
margelo::nitro::swe::iternio::reactnativeautoplay::JFunc_void_std__string_bool_cxx::registerNatives();
|
|
65
66
|
margelo::nitro::swe::iternio::reactnativeautoplay::JHybridGridTemplateSpec::registerNatives();
|
|
66
67
|
margelo::nitro::swe::iternio::reactnativeautoplay::JFunc_void_std__optional_bool__cxx::registerNatives();
|
|
68
|
+
margelo::nitro::swe::iternio::reactnativeautoplay::JFunc_void_bool_cxx::registerNatives();
|
|
67
69
|
margelo::nitro::swe::iternio::reactnativeautoplay::JHybridInformationTemplateSpec::registerNatives();
|
|
68
70
|
margelo::nitro::swe::iternio::reactnativeautoplay::JHybridListTemplateSpec::registerNatives();
|
|
69
71
|
margelo::nitro::swe::iternio::reactnativeautoplay::JHybridMapTemplateSpec::registerNatives();
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JFunc_void_bool.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include <functional>
|
|
12
|
+
|
|
13
|
+
#include <functional>
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
16
|
+
|
|
17
|
+
using namespace facebook;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Represents the Java/Kotlin callback `(isPanningInterfaceVisible: Boolean) -> Unit`.
|
|
21
|
+
* This can be passed around between C++ and Java/Kotlin.
|
|
22
|
+
*/
|
|
23
|
+
struct JFunc_void_bool: public jni::JavaClass<JFunc_void_bool> {
|
|
24
|
+
public:
|
|
25
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_bool;";
|
|
26
|
+
|
|
27
|
+
public:
|
|
28
|
+
/**
|
|
29
|
+
* Invokes the function this `JFunc_void_bool` instance holds through JNI.
|
|
30
|
+
*/
|
|
31
|
+
void invoke(bool isPanningInterfaceVisible) const {
|
|
32
|
+
static const auto method = javaClassStatic()->getMethod<void(jboolean /* isPanningInterfaceVisible */)>("invoke");
|
|
33
|
+
method(self(), isPanningInterfaceVisible);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* An implementation of Func_void_bool that is backed by a C++ implementation (using `std::function<...>`)
|
|
39
|
+
*/
|
|
40
|
+
struct JFunc_void_bool_cxx final: public jni::HybridClass<JFunc_void_bool_cxx, JFunc_void_bool> {
|
|
41
|
+
public:
|
|
42
|
+
static jni::local_ref<JFunc_void_bool::javaobject> fromCpp(const std::function<void(bool /* isPanningInterfaceVisible */)>& func) {
|
|
43
|
+
return JFunc_void_bool_cxx::newObjectCxxArgs(func);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public:
|
|
47
|
+
/**
|
|
48
|
+
* Invokes the C++ `std::function<...>` this `JFunc_void_bool_cxx` instance holds.
|
|
49
|
+
*/
|
|
50
|
+
void invoke_cxx(jboolean isPanningInterfaceVisible) {
|
|
51
|
+
_func(static_cast<bool>(isPanningInterfaceVisible));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
public:
|
|
55
|
+
[[nodiscard]]
|
|
56
|
+
inline const std::function<void(bool /* isPanningInterfaceVisible */)>& getFunction() const {
|
|
57
|
+
return _func;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
public:
|
|
61
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_bool_cxx;";
|
|
62
|
+
static void registerNatives() {
|
|
63
|
+
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_bool_cxx::invoke_cxx)});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
private:
|
|
67
|
+
explicit JFunc_void_bool_cxx(const std::function<void(bool /* isPanningInterfaceVisible */)>& func): _func(func) { }
|
|
68
|
+
|
|
69
|
+
private:
|
|
70
|
+
friend HybridBase;
|
|
71
|
+
std::function<void(bool /* isPanningInterfaceVisible */)> _func;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
@@ -77,6 +77,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class NitroMa
|
|
|
77
77
|
#include "JNitroMapButton.hpp"
|
|
78
78
|
#include "NitroMapButtonType.hpp"
|
|
79
79
|
#include "JNitroMapButtonType.hpp"
|
|
80
|
+
#include "JFunc_void_bool.hpp"
|
|
80
81
|
|
|
81
82
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
82
83
|
|
|
@@ -84,6 +84,8 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class NitroMa
|
|
|
84
84
|
#include "JNitroMapButton.hpp"
|
|
85
85
|
#include "NitroMapButtonType.hpp"
|
|
86
86
|
#include "JNitroMapButtonType.hpp"
|
|
87
|
+
#include "JNitroImage.hpp"
|
|
88
|
+
#include "JFunc_void_bool.hpp"
|
|
87
89
|
|
|
88
90
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
89
91
|
|
|
@@ -84,6 +84,8 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class NitroMa
|
|
|
84
84
|
#include "JNitroMapButton.hpp"
|
|
85
85
|
#include "NitroMapButtonType.hpp"
|
|
86
86
|
#include "JNitroMapButtonType.hpp"
|
|
87
|
+
#include "JNitroImage.hpp"
|
|
88
|
+
#include "JFunc_void_bool.hpp"
|
|
87
89
|
|
|
88
90
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
89
91
|
|
|
@@ -131,19 +131,21 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct TripConfig;
|
|
|
131
131
|
#include "GlyphImage.hpp"
|
|
132
132
|
#include "AssetImage.hpp"
|
|
133
133
|
#include <variant>
|
|
134
|
-
#include "
|
|
134
|
+
#include "JNitroImage.hpp"
|
|
135
135
|
#include "JGlyphImage.hpp"
|
|
136
136
|
#include "NitroColor.hpp"
|
|
137
137
|
#include "JNitroColor.hpp"
|
|
138
138
|
#include "JAssetImage.hpp"
|
|
139
139
|
#include "NitroAction.hpp"
|
|
140
140
|
#include "JNitroAction.hpp"
|
|
141
|
+
#include "JVariant_GlyphImage_AssetImage.hpp"
|
|
141
142
|
#include "NitroActionType.hpp"
|
|
142
143
|
#include "JNitroActionType.hpp"
|
|
143
144
|
#include "NitroAlignment.hpp"
|
|
144
145
|
#include "JNitroAlignment.hpp"
|
|
145
146
|
#include "NitroButtonStyle.hpp"
|
|
146
147
|
#include "JNitroButtonStyle.hpp"
|
|
148
|
+
#include "JFunc_void_bool.hpp"
|
|
147
149
|
#include "NitroNavigationAlert.hpp"
|
|
148
150
|
#include "JNitroNavigationAlert.hpp"
|
|
149
151
|
#include "NavigationAlertAction.hpp"
|
|
@@ -174,7 +176,6 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct TripConfig;
|
|
|
174
176
|
#include "JNitroAttributedString.hpp"
|
|
175
177
|
#include "NitroAttributedStringImage.hpp"
|
|
176
178
|
#include "JNitroAttributedStringImage.hpp"
|
|
177
|
-
#include "JNitroImage.hpp"
|
|
178
179
|
#include "TurnType.hpp"
|
|
179
180
|
#include "JTurnType.hpp"
|
|
180
181
|
#include "OffRampType.hpp"
|
|
@@ -72,6 +72,8 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class NitroMa
|
|
|
72
72
|
#include "JNitroMapButton.hpp"
|
|
73
73
|
#include "NitroMapButtonType.hpp"
|
|
74
74
|
#include "JNitroMapButtonType.hpp"
|
|
75
|
+
#include "JNitroImage.hpp"
|
|
76
|
+
#include "JFunc_void_bool.hpp"
|
|
75
77
|
|
|
76
78
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
77
79
|
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
#include "JDistance.hpp"
|
|
21
21
|
#include "JDistanceUnits.hpp"
|
|
22
22
|
#include "JFunc_void.hpp"
|
|
23
|
+
#include "JFunc_void_bool.hpp"
|
|
23
24
|
#include "JFunc_void_std__optional_bool_.hpp"
|
|
24
25
|
#include "JGlyphImage.hpp"
|
|
25
26
|
#include "JNitroAction.hpp"
|
|
@@ -28,6 +29,7 @@
|
|
|
28
29
|
#include "JNitroBaseMapTemplateConfig.hpp"
|
|
29
30
|
#include "JNitroButtonStyle.hpp"
|
|
30
31
|
#include "JNitroColor.hpp"
|
|
32
|
+
#include "JNitroImage.hpp"
|
|
31
33
|
#include "JNitroMapButton.hpp"
|
|
32
34
|
#include "JNitroMapButtonType.hpp"
|
|
33
35
|
#include "JNitroRow.hpp"
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
#include "JDistance.hpp"
|
|
21
21
|
#include "JDistanceUnits.hpp"
|
|
22
22
|
#include "JFunc_void.hpp"
|
|
23
|
+
#include "JFunc_void_bool.hpp"
|
|
23
24
|
#include "JFunc_void_std__optional_bool_.hpp"
|
|
24
25
|
#include "JGlyphImage.hpp"
|
|
25
26
|
#include "JNitroAction.hpp"
|
|
@@ -28,6 +29,7 @@
|
|
|
28
29
|
#include "JNitroBaseMapTemplateConfig.hpp"
|
|
29
30
|
#include "JNitroButtonStyle.hpp"
|
|
30
31
|
#include "JNitroColor.hpp"
|
|
32
|
+
#include "JNitroImage.hpp"
|
|
31
33
|
#include "JNitroMapButton.hpp"
|
|
32
34
|
#include "JNitroMapButtonType.hpp"
|
|
33
35
|
#include "JNitroRow.hpp"
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
#include "JFunc_void_Point.hpp"
|
|
21
21
|
#include "JFunc_void_Point_double.hpp"
|
|
22
22
|
#include "JFunc_void_Point_std__optional_Point_.hpp"
|
|
23
|
+
#include "JFunc_void_bool.hpp"
|
|
23
24
|
#include "JFunc_void_std__optional_bool_.hpp"
|
|
24
25
|
#include "JGlyphImage.hpp"
|
|
25
26
|
#include "JNitroAction.hpp"
|
|
@@ -27,6 +28,7 @@
|
|
|
27
28
|
#include "JNitroAlignment.hpp"
|
|
28
29
|
#include "JNitroButtonStyle.hpp"
|
|
29
30
|
#include "JNitroColor.hpp"
|
|
31
|
+
#include "JNitroImage.hpp"
|
|
30
32
|
#include "JNitroMapButton.hpp"
|
|
31
33
|
#include "JNitroMapButtonType.hpp"
|
|
32
34
|
#include "JPoint.hpp"
|
|
@@ -82,8 +84,8 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
82
84
|
jni::local_ref<jni::JDouble> autoDismissMs = this->getFieldValue(fieldAutoDismissMs);
|
|
83
85
|
static const auto fieldVisibleTravelEstimate = clazz->getField<JVisibleTravelEstimate>("visibleTravelEstimate");
|
|
84
86
|
jni::local_ref<JVisibleTravelEstimate> visibleTravelEstimate = this->getFieldValue(fieldVisibleTravelEstimate);
|
|
85
|
-
static const auto
|
|
86
|
-
jni::local_ref<JFunc_void_Point_std__optional_Point_::javaobject>
|
|
87
|
+
static const auto fieldOnDidPan = clazz->getField<JFunc_void_Point_std__optional_Point_::javaobject>("onDidPan");
|
|
88
|
+
jni::local_ref<JFunc_void_Point_std__optional_Point_::javaobject> onDidPan = this->getFieldValue(fieldOnDidPan);
|
|
87
89
|
static const auto fieldOnDidUpdateZoomGestureWithCenter = clazz->getField<JFunc_void_Point_double::javaobject>("onDidUpdateZoomGestureWithCenter");
|
|
88
90
|
jni::local_ref<JFunc_void_Point_double::javaobject> onDidUpdateZoomGestureWithCenter = this->getFieldValue(fieldOnDidUpdateZoomGestureWithCenter);
|
|
89
91
|
static const auto fieldOnClick = clazz->getField<JFunc_void_Point::javaobject>("onClick");
|
|
@@ -100,6 +102,10 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
100
102
|
jni::local_ref<jni::JArrayClass<JNitroMapButton>> mapButtons = this->getFieldValue(fieldMapButtons);
|
|
101
103
|
static const auto fieldHeaderActions = clazz->getField<jni::JArrayClass<JNitroAction>>("headerActions");
|
|
102
104
|
jni::local_ref<jni::JArrayClass<JNitroAction>> headerActions = this->getFieldValue(fieldHeaderActions);
|
|
105
|
+
static const auto fieldPanButtonScrollPercentage = clazz->getField<jni::JDouble>("panButtonScrollPercentage");
|
|
106
|
+
jni::local_ref<jni::JDouble> panButtonScrollPercentage = this->getFieldValue(fieldPanButtonScrollPercentage);
|
|
107
|
+
static const auto fieldOnDidChangePanningInterface = clazz->getField<JFunc_void_bool::javaobject>("onDidChangePanningInterface");
|
|
108
|
+
jni::local_ref<JFunc_void_bool::javaobject> onDidChangePanningInterface = this->getFieldValue(fieldOnDidChangePanningInterface);
|
|
103
109
|
return MapTemplateConfig(
|
|
104
110
|
id->toStdString(),
|
|
105
111
|
onWillAppear != nullptr ? std::make_optional([&]() -> std::function<void(std::optional<bool> /* animated */)> {
|
|
@@ -159,14 +165,14 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
159
165
|
}()) : std::nullopt,
|
|
160
166
|
autoDismissMs != nullptr ? std::make_optional(autoDismissMs->value()) : std::nullopt,
|
|
161
167
|
visibleTravelEstimate != nullptr ? std::make_optional(visibleTravelEstimate->toCpp()) : std::nullopt,
|
|
162
|
-
|
|
163
|
-
if (
|
|
164
|
-
auto downcast = jni::static_ref_cast<JFunc_void_Point_std__optional_Point__cxx::javaobject>(
|
|
168
|
+
onDidPan != nullptr ? std::make_optional([&]() -> std::function<void(const Point& /* translation */, const std::optional<Point>& /* velocity */)> {
|
|
169
|
+
if (onDidPan->isInstanceOf(JFunc_void_Point_std__optional_Point__cxx::javaClassStatic())) [[likely]] {
|
|
170
|
+
auto downcast = jni::static_ref_cast<JFunc_void_Point_std__optional_Point__cxx::javaobject>(onDidPan);
|
|
165
171
|
return downcast->cthis()->getFunction();
|
|
166
172
|
} else {
|
|
167
|
-
auto
|
|
168
|
-
return [
|
|
169
|
-
return
|
|
173
|
+
auto onDidPanRef = jni::make_global(onDidPan);
|
|
174
|
+
return [onDidPanRef](Point translation, std::optional<Point> velocity) -> void {
|
|
175
|
+
return onDidPanRef->invoke(translation,velocity);
|
|
170
176
|
};
|
|
171
177
|
}
|
|
172
178
|
}()) : std::nullopt,
|
|
@@ -255,6 +261,18 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
255
261
|
__vector.push_back(__element->toCpp());
|
|
256
262
|
}
|
|
257
263
|
return __vector;
|
|
264
|
+
}()) : std::nullopt,
|
|
265
|
+
panButtonScrollPercentage != nullptr ? std::make_optional(panButtonScrollPercentage->value()) : std::nullopt,
|
|
266
|
+
onDidChangePanningInterface != nullptr ? std::make_optional([&]() -> std::function<void(bool /* isPanningInterfaceVisible */)> {
|
|
267
|
+
if (onDidChangePanningInterface->isInstanceOf(JFunc_void_bool_cxx::javaClassStatic())) [[likely]] {
|
|
268
|
+
auto downcast = jni::static_ref_cast<JFunc_void_bool_cxx::javaobject>(onDidChangePanningInterface);
|
|
269
|
+
return downcast->cthis()->getFunction();
|
|
270
|
+
} else {
|
|
271
|
+
auto onDidChangePanningInterfaceRef = jni::make_global(onDidChangePanningInterface);
|
|
272
|
+
return [onDidChangePanningInterfaceRef](bool isPanningInterfaceVisible) -> void {
|
|
273
|
+
return onDidChangePanningInterfaceRef->invoke(isPanningInterfaceVisible);
|
|
274
|
+
};
|
|
275
|
+
}
|
|
258
276
|
}()) : std::nullopt
|
|
259
277
|
);
|
|
260
278
|
}
|
|
@@ -265,7 +283,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
265
283
|
*/
|
|
266
284
|
[[maybe_unused]]
|
|
267
285
|
static jni::local_ref<JMapTemplateConfig::javaobject> fromCpp(const MapTemplateConfig& value) {
|
|
268
|
-
using JSignature = JMapTemplateConfig(jni::alias_ref<jni::JString>, jni::alias_ref<JFunc_void_std__optional_bool_::javaobject>, jni::alias_ref<JFunc_void_std__optional_bool_::javaobject>, jni::alias_ref<JFunc_void_std__optional_bool_::javaobject>, jni::alias_ref<JFunc_void_std__optional_bool_::javaobject>, jni::alias_ref<JFunc_void::javaobject>, jni::alias_ref<jni::JDouble>, jni::alias_ref<JVisibleTravelEstimate>, jni::alias_ref<JFunc_void_Point_std__optional_Point_::javaobject>, jni::alias_ref<JFunc_void_Point_double::javaobject>, jni::alias_ref<JFunc_void_Point::javaobject>, jni::alias_ref<JFunc_void_Point::javaobject>, jni::alias_ref<JFunc_void_ColorScheme::javaobject>, jni::alias_ref<JFunc_void::javaobject>, jni::alias_ref<JFunc_void::javaobject>, jni::alias_ref<jni::JArrayClass<JNitroMapButton>>, jni::alias_ref<jni::JArrayClass<JNitroAction
|
|
286
|
+
using JSignature = JMapTemplateConfig(jni::alias_ref<jni::JString>, jni::alias_ref<JFunc_void_std__optional_bool_::javaobject>, jni::alias_ref<JFunc_void_std__optional_bool_::javaobject>, jni::alias_ref<JFunc_void_std__optional_bool_::javaobject>, jni::alias_ref<JFunc_void_std__optional_bool_::javaobject>, jni::alias_ref<JFunc_void::javaobject>, jni::alias_ref<jni::JDouble>, jni::alias_ref<JVisibleTravelEstimate>, jni::alias_ref<JFunc_void_Point_std__optional_Point_::javaobject>, jni::alias_ref<JFunc_void_Point_double::javaobject>, jni::alias_ref<JFunc_void_Point::javaobject>, jni::alias_ref<JFunc_void_Point::javaobject>, jni::alias_ref<JFunc_void_ColorScheme::javaobject>, jni::alias_ref<JFunc_void::javaobject>, jni::alias_ref<JFunc_void::javaobject>, jni::alias_ref<jni::JArrayClass<JNitroMapButton>>, jni::alias_ref<jni::JArrayClass<JNitroAction>>, jni::alias_ref<jni::JDouble>, jni::alias_ref<JFunc_void_bool::javaobject>);
|
|
269
287
|
static const auto clazz = javaClassStatic();
|
|
270
288
|
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
271
289
|
return create(
|
|
@@ -278,7 +296,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
278
296
|
value.onPopped.has_value() ? JFunc_void_cxx::fromCpp(value.onPopped.value()) : nullptr,
|
|
279
297
|
value.autoDismissMs.has_value() ? jni::JDouble::valueOf(value.autoDismissMs.value()) : nullptr,
|
|
280
298
|
value.visibleTravelEstimate.has_value() ? JVisibleTravelEstimate::fromCpp(value.visibleTravelEstimate.value()) : nullptr,
|
|
281
|
-
value.
|
|
299
|
+
value.onDidPan.has_value() ? JFunc_void_Point_std__optional_Point__cxx::fromCpp(value.onDidPan.value()) : nullptr,
|
|
282
300
|
value.onDidUpdateZoomGestureWithCenter.has_value() ? JFunc_void_Point_double_cxx::fromCpp(value.onDidUpdateZoomGestureWithCenter.value()) : nullptr,
|
|
283
301
|
value.onClick.has_value() ? JFunc_void_Point_cxx::fromCpp(value.onClick.value()) : nullptr,
|
|
284
302
|
value.onDoubleClick.has_value() ? JFunc_void_Point_cxx::fromCpp(value.onDoubleClick.value()) : nullptr,
|
|
@@ -304,7 +322,9 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
304
322
|
__array->setElement(__i, *__elementJni);
|
|
305
323
|
}
|
|
306
324
|
return __array;
|
|
307
|
-
}() : nullptr
|
|
325
|
+
}() : nullptr,
|
|
326
|
+
value.panButtonScrollPercentage.has_value() ? jni::JDouble::valueOf(value.panButtonScrollPercentage.value()) : nullptr,
|
|
327
|
+
value.onDidChangePanningInterface.has_value() ? JFunc_void_bool_cxx::fromCpp(value.onDidChangePanningInterface.value()) : nullptr
|
|
308
328
|
);
|
|
309
329
|
}
|
|
310
330
|
};
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
#include "JDistance.hpp"
|
|
21
21
|
#include "JDistanceUnits.hpp"
|
|
22
22
|
#include "JFunc_void.hpp"
|
|
23
|
+
#include "JFunc_void_bool.hpp"
|
|
23
24
|
#include "JFunc_void_std__optional_bool_.hpp"
|
|
24
25
|
#include "JGlyphImage.hpp"
|
|
25
26
|
#include "JNitroAction.hpp"
|
|
@@ -28,6 +29,7 @@
|
|
|
28
29
|
#include "JNitroBaseMapTemplateConfig.hpp"
|
|
29
30
|
#include "JNitroButtonStyle.hpp"
|
|
30
31
|
#include "JNitroColor.hpp"
|
|
32
|
+
#include "JNitroImage.hpp"
|
|
31
33
|
#include "JNitroMapButton.hpp"
|
|
32
34
|
#include "JNitroMapButtonType.hpp"
|
|
33
35
|
#include "JVariant_GlyphImage_AssetImage.hpp"
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
#include "GlyphImage.hpp"
|
|
15
15
|
#include "JAssetImage.hpp"
|
|
16
16
|
#include "JFunc_void.hpp"
|
|
17
|
+
#include "JFunc_void_bool.hpp"
|
|
17
18
|
#include "JFunc_void_std__optional_bool_.hpp"
|
|
18
19
|
#include "JGlyphImage.hpp"
|
|
19
20
|
#include "JNitroAction.hpp"
|
|
@@ -21,6 +22,7 @@
|
|
|
21
22
|
#include "JNitroAlignment.hpp"
|
|
22
23
|
#include "JNitroButtonStyle.hpp"
|
|
23
24
|
#include "JNitroColor.hpp"
|
|
25
|
+
#include "JNitroImage.hpp"
|
|
24
26
|
#include "JNitroMapButton.hpp"
|
|
25
27
|
#include "JNitroMapButtonType.hpp"
|
|
26
28
|
#include "JVariant_GlyphImage_AssetImage.hpp"
|
|
@@ -60,6 +62,8 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
60
62
|
jni::local_ref<jni::JArrayClass<JNitroMapButton>> mapButtons = this->getFieldValue(fieldMapButtons);
|
|
61
63
|
static const auto fieldHeaderActions = clazz->getField<jni::JArrayClass<JNitroAction>>("headerActions");
|
|
62
64
|
jni::local_ref<jni::JArrayClass<JNitroAction>> headerActions = this->getFieldValue(fieldHeaderActions);
|
|
65
|
+
static const auto fieldOnDidChangePanningInterface = clazz->getField<JFunc_void_bool::javaobject>("onDidChangePanningInterface");
|
|
66
|
+
jni::local_ref<JFunc_void_bool::javaobject> onDidChangePanningInterface = this->getFieldValue(fieldOnDidChangePanningInterface);
|
|
63
67
|
static const auto fieldOnWillAppear = clazz->getField<JFunc_void_std__optional_bool_::javaobject>("onWillAppear");
|
|
64
68
|
jni::local_ref<JFunc_void_std__optional_bool_::javaobject> onWillAppear = this->getFieldValue(fieldOnWillAppear);
|
|
65
69
|
static const auto fieldOnWillDisappear = clazz->getField<JFunc_void_std__optional_bool_::javaobject>("onWillDisappear");
|
|
@@ -93,6 +97,17 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
93
97
|
}
|
|
94
98
|
return __vector;
|
|
95
99
|
}()) : std::nullopt,
|
|
100
|
+
onDidChangePanningInterface != nullptr ? std::make_optional([&]() -> std::function<void(bool /* isPanningInterfaceVisible */)> {
|
|
101
|
+
if (onDidChangePanningInterface->isInstanceOf(JFunc_void_bool_cxx::javaClassStatic())) [[likely]] {
|
|
102
|
+
auto downcast = jni::static_ref_cast<JFunc_void_bool_cxx::javaobject>(onDidChangePanningInterface);
|
|
103
|
+
return downcast->cthis()->getFunction();
|
|
104
|
+
} else {
|
|
105
|
+
auto onDidChangePanningInterfaceRef = jni::make_global(onDidChangePanningInterface);
|
|
106
|
+
return [onDidChangePanningInterfaceRef](bool isPanningInterfaceVisible) -> void {
|
|
107
|
+
return onDidChangePanningInterfaceRef->invoke(isPanningInterfaceVisible);
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}()) : std::nullopt,
|
|
96
111
|
onWillAppear != nullptr ? std::make_optional([&]() -> std::function<void(std::optional<bool> /* animated */)> {
|
|
97
112
|
if (onWillAppear->isInstanceOf(JFunc_void_std__optional_bool__cxx::javaClassStatic())) [[likely]] {
|
|
98
113
|
auto downcast = jni::static_ref_cast<JFunc_void_std__optional_bool__cxx::javaobject>(onWillAppear);
|
|
@@ -158,7 +173,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
158
173
|
*/
|
|
159
174
|
[[maybe_unused]]
|
|
160
175
|
static jni::local_ref<JNitroBaseMapTemplateConfig::javaobject> fromCpp(const NitroBaseMapTemplateConfig& value) {
|
|
161
|
-
using JSignature = JNitroBaseMapTemplateConfig(jni::alias_ref<jni::JArrayClass<JNitroMapButton>>, jni::alias_ref<jni::JArrayClass<JNitroAction>>, jni::alias_ref<JFunc_void_std__optional_bool_::javaobject>, jni::alias_ref<JFunc_void_std__optional_bool_::javaobject>, jni::alias_ref<JFunc_void_std__optional_bool_::javaobject>, jni::alias_ref<JFunc_void_std__optional_bool_::javaobject>, jni::alias_ref<JFunc_void::javaobject>, jni::alias_ref<jni::JDouble>);
|
|
176
|
+
using JSignature = JNitroBaseMapTemplateConfig(jni::alias_ref<jni::JArrayClass<JNitroMapButton>>, jni::alias_ref<jni::JArrayClass<JNitroAction>>, jni::alias_ref<JFunc_void_bool::javaobject>, jni::alias_ref<JFunc_void_std__optional_bool_::javaobject>, jni::alias_ref<JFunc_void_std__optional_bool_::javaobject>, jni::alias_ref<JFunc_void_std__optional_bool_::javaobject>, jni::alias_ref<JFunc_void_std__optional_bool_::javaobject>, jni::alias_ref<JFunc_void::javaobject>, jni::alias_ref<jni::JDouble>);
|
|
162
177
|
static const auto clazz = javaClassStatic();
|
|
163
178
|
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
164
179
|
return create(
|
|
@@ -183,6 +198,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
183
198
|
}
|
|
184
199
|
return __array;
|
|
185
200
|
}() : nullptr,
|
|
201
|
+
value.onDidChangePanningInterface.has_value() ? JFunc_void_bool_cxx::fromCpp(value.onDidChangePanningInterface.value()) : nullptr,
|
|
186
202
|
value.onWillAppear.has_value() ? JFunc_void_std__optional_bool__cxx::fromCpp(value.onWillAppear.value()) : nullptr,
|
|
187
203
|
value.onWillDisappear.has_value() ? JFunc_void_std__optional_bool__cxx::fromCpp(value.onWillDisappear.value()) : nullptr,
|
|
188
204
|
value.onDidAppear.has_value() ? JFunc_void_std__optional_bool__cxx::fromCpp(value.onDidAppear.value()) : nullptr,
|