@iternio/react-native-auto-play 0.0.2 → 0.0.3
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 +58 -17
- 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
|
@@ -7,59 +7,42 @@
|
|
|
7
7
|
|
|
8
8
|
import CarPlay
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
func setBarButtons() {
|
|
24
|
-
guard let template = template as? CPBarButtonProviding else { return }
|
|
25
|
-
|
|
26
|
-
if let headerActions = barButtons {
|
|
27
|
-
let parsedActions = Parser.parseHeaderActions(
|
|
28
|
-
headerActions: headerActions,
|
|
29
|
-
traitCollection: SceneStore.getRootTraitCollection()
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
template.backButton = parsedActions.backButton
|
|
33
|
-
template.leadingNavigationBarButtons =
|
|
34
|
-
parsedActions.leadingNavigationBarButtons
|
|
35
|
-
template.trailingNavigationBarButtons =
|
|
36
|
-
parsedActions.trailingNavigationBarButtons
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
open func invalidate() {
|
|
41
|
-
print("\(type(of: self)) lacks invalidate implementation")
|
|
42
|
-
}
|
|
10
|
+
protocol AutoPlayTemplate {
|
|
11
|
+
var autoDismissMs: Double? { get }
|
|
12
|
+
|
|
13
|
+
func invalidate()
|
|
14
|
+
func onWillAppear(animated: Bool)
|
|
15
|
+
func onDidAppear(animated: Bool)
|
|
16
|
+
func onWillDisappear(animated: Bool)
|
|
17
|
+
func onDidDisappear(animated: Bool)
|
|
18
|
+
func onPopped()
|
|
19
|
+
func traitCollectionDidChange()
|
|
20
|
+
func getTemplate() -> CPTemplate
|
|
21
|
+
}
|
|
43
22
|
|
|
44
|
-
|
|
45
|
-
|
|
23
|
+
extension AutoPlayTemplate {
|
|
24
|
+
func traitCollectionDidChange() {
|
|
25
|
+
// this can be implemented optionally
|
|
46
26
|
}
|
|
27
|
+
}
|
|
47
28
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
29
|
+
protocol AutoPlayHeaderProviding {
|
|
30
|
+
var barButtons: [NitroAction]? { get set }
|
|
31
|
+
}
|
|
51
32
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
33
|
+
func setBarButtons(template: CPTemplate, barButtons: [NitroAction]?) {
|
|
34
|
+
guard let template = template as? CPBarButtonProviding else { return }
|
|
55
35
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
36
|
+
if let headerActions = barButtons {
|
|
37
|
+
let parsedActions = Parser.parseHeaderActions(
|
|
38
|
+
headerActions: headerActions,
|
|
39
|
+
traitCollection: SceneStore.getRootTraitCollection()
|
|
40
|
+
)
|
|
59
41
|
|
|
60
|
-
|
|
61
|
-
|
|
42
|
+
template.backButton = parsedActions.backButton
|
|
43
|
+
template.leadingNavigationBarButtons =
|
|
44
|
+
parsedActions.leadingNavigationBarButtons
|
|
45
|
+
template.trailingNavigationBarButtons =
|
|
46
|
+
parsedActions.trailingNavigationBarButtons
|
|
62
47
|
}
|
|
63
|
-
|
|
64
|
-
open func traitCollectionDidChange() {}
|
|
65
48
|
}
|
|
@@ -7,30 +7,43 @@
|
|
|
7
7
|
|
|
8
8
|
import CarPlay
|
|
9
9
|
|
|
10
|
-
class GridTemplate: AutoPlayTemplate {
|
|
10
|
+
class GridTemplate: AutoPlayTemplate, AutoPlayHeaderProviding {
|
|
11
|
+
let template: CPGridTemplate
|
|
11
12
|
var config: GridTemplateConfig
|
|
12
13
|
|
|
14
|
+
var barButtons: [NitroAction]? {
|
|
15
|
+
get {
|
|
16
|
+
return config.headerActions
|
|
17
|
+
}
|
|
18
|
+
set {
|
|
19
|
+
config.headerActions = newValue
|
|
20
|
+
setBarButtons(template: template, barButtons: newValue)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
var autoDismissMs: Double? {
|
|
25
|
+
return config.autoDismissMs
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
func getTemplate() -> CPTemplate {
|
|
29
|
+
return template
|
|
30
|
+
}
|
|
31
|
+
|
|
13
32
|
init(config: GridTemplateConfig) {
|
|
14
33
|
self.config = config
|
|
15
34
|
|
|
16
|
-
|
|
35
|
+
template = CPGridTemplate(
|
|
17
36
|
title: Parser.parseText(text: config.title),
|
|
18
37
|
gridButtons: GridTemplate.parseButtons(buttons: config.buttons),
|
|
19
38
|
id: config.id
|
|
20
39
|
)
|
|
21
40
|
|
|
22
|
-
|
|
23
|
-
template: template,
|
|
24
|
-
header: config.headerActions,
|
|
25
|
-
autoDismissMs: config.autoDismissMs
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
setBarButtons()
|
|
41
|
+
setBarButtons(template: template, barButtons: barButtons)
|
|
29
42
|
}
|
|
30
|
-
|
|
43
|
+
|
|
31
44
|
static func parseButtons(buttons: [NitroGridButton]) -> [CPGridButton] {
|
|
32
45
|
let gridButtonHeight: CGFloat
|
|
33
|
-
|
|
46
|
+
|
|
34
47
|
if #available(iOS 26.0, *) {
|
|
35
48
|
gridButtonHeight = CPGridTemplate.maximumGridButtonImageSize.height
|
|
36
49
|
} else {
|
|
@@ -64,34 +77,30 @@ class GridTemplate: AutoPlayTemplate {
|
|
|
64
77
|
}
|
|
65
78
|
}
|
|
66
79
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
return
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
setBarButtons()
|
|
80
|
+
func invalidate() {
|
|
81
|
+
setBarButtons(template: template, barButtons: config.headerActions)
|
|
73
82
|
|
|
74
83
|
let buttons = GridTemplate.parseButtons(buttons: config.buttons)
|
|
75
84
|
template.updateGridButtons(buttons)
|
|
76
85
|
}
|
|
77
86
|
|
|
78
|
-
|
|
87
|
+
func onWillAppear(animated: Bool) {
|
|
79
88
|
config.onWillAppear?(animated)
|
|
80
89
|
}
|
|
81
90
|
|
|
82
|
-
|
|
91
|
+
func onDidAppear(animated: Bool) {
|
|
83
92
|
config.onDidAppear?(animated)
|
|
84
93
|
}
|
|
85
94
|
|
|
86
|
-
|
|
95
|
+
func onWillDisappear(animated: Bool) {
|
|
87
96
|
config.onWillDisappear?(animated)
|
|
88
97
|
}
|
|
89
98
|
|
|
90
|
-
|
|
99
|
+
func onDidDisappear(animated: Bool) {
|
|
91
100
|
config.onDidDisappear?(animated)
|
|
92
101
|
}
|
|
93
102
|
|
|
94
|
-
|
|
103
|
+
func onPopped() {
|
|
95
104
|
config.onPopped?()
|
|
96
105
|
}
|
|
97
106
|
|
|
@@ -7,13 +7,32 @@
|
|
|
7
7
|
|
|
8
8
|
import CarPlay
|
|
9
9
|
|
|
10
|
-
class InformationTemplate: AutoPlayTemplate {
|
|
10
|
+
class InformationTemplate: AutoPlayTemplate, AutoPlayHeaderProviding {
|
|
11
|
+
let template: CPInformationTemplate
|
|
11
12
|
var config: InformationTemplateConfig
|
|
13
|
+
|
|
14
|
+
var barButtons: [NitroAction]? {
|
|
15
|
+
get {
|
|
16
|
+
return config.headerActions
|
|
17
|
+
}
|
|
18
|
+
set {
|
|
19
|
+
config.headerActions = newValue
|
|
20
|
+
setBarButtons(template: template, barButtons: newValue)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
var autoDismissMs: Double? {
|
|
25
|
+
return config.autoDismissMs
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
func getTemplate() -> CPTemplate {
|
|
29
|
+
return template
|
|
30
|
+
}
|
|
12
31
|
|
|
13
32
|
init(config: InformationTemplateConfig) {
|
|
14
33
|
self.config = config
|
|
15
34
|
|
|
16
|
-
|
|
35
|
+
template = CPInformationTemplate(
|
|
17
36
|
title: Parser.parseText(text: config.title)!,
|
|
18
37
|
layout: .leading,
|
|
19
38
|
items: Parser.parseInformationItems(section: config.section),
|
|
@@ -21,42 +40,31 @@ class InformationTemplate: AutoPlayTemplate {
|
|
|
21
40
|
id: config.id
|
|
22
41
|
)
|
|
23
42
|
|
|
24
|
-
|
|
25
|
-
template: template,
|
|
26
|
-
header: config.headerActions,
|
|
27
|
-
autoDismissMs: config.autoDismissMs
|
|
28
|
-
)
|
|
29
|
-
|
|
30
|
-
setBarButtons()
|
|
43
|
+
setBarButtons(template: template, barButtons: barButtons)
|
|
31
44
|
}
|
|
32
45
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
setBarButtons()
|
|
39
|
-
|
|
46
|
+
func invalidate() {
|
|
47
|
+
setBarButtons(template: template, barButtons: barButtons)
|
|
40
48
|
template.items = Parser.parseInformationItems(section: config.section)
|
|
41
49
|
}
|
|
42
50
|
|
|
43
|
-
|
|
51
|
+
func onWillAppear(animated: Bool) {
|
|
44
52
|
config.onWillAppear?(animated)
|
|
45
53
|
}
|
|
46
54
|
|
|
47
|
-
|
|
55
|
+
func onDidAppear(animated: Bool) {
|
|
48
56
|
config.onDidAppear?(animated)
|
|
49
57
|
}
|
|
50
58
|
|
|
51
|
-
|
|
59
|
+
func onWillDisappear(animated: Bool) {
|
|
52
60
|
config.onWillDisappear?(animated)
|
|
53
61
|
}
|
|
54
62
|
|
|
55
|
-
|
|
63
|
+
func onDidDisappear(animated: Bool) {
|
|
56
64
|
config.onDidDisappear?(animated)
|
|
57
65
|
}
|
|
58
66
|
|
|
59
|
-
|
|
67
|
+
func onPopped() {
|
|
60
68
|
config.onPopped?()
|
|
61
69
|
}
|
|
62
70
|
|
|
@@ -7,34 +7,43 @@
|
|
|
7
7
|
|
|
8
8
|
import CarPlay
|
|
9
9
|
|
|
10
|
-
class ListTemplate: AutoPlayTemplate {
|
|
10
|
+
class ListTemplate: AutoPlayTemplate, AutoPlayHeaderProviding {
|
|
11
|
+
let template: CPListTemplate
|
|
11
12
|
var config: ListTemplateConfig
|
|
13
|
+
|
|
14
|
+
var barButtons: [NitroAction]? {
|
|
15
|
+
get {
|
|
16
|
+
return config.headerActions
|
|
17
|
+
}
|
|
18
|
+
set {
|
|
19
|
+
config.headerActions = newValue
|
|
20
|
+
setBarButtons(template: template, barButtons: newValue)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
var autoDismissMs: Double? {
|
|
25
|
+
return config.autoDismissMs
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
func getTemplate() -> CPTemplate {
|
|
29
|
+
return template
|
|
30
|
+
}
|
|
12
31
|
|
|
13
32
|
init(config: ListTemplateConfig) {
|
|
14
33
|
self.config = config
|
|
15
34
|
|
|
16
|
-
|
|
35
|
+
template = CPListTemplate(
|
|
17
36
|
title: Parser.parseText(text: config.title),
|
|
18
37
|
sections: [],
|
|
19
38
|
assistantCellConfiguration: nil,
|
|
20
39
|
id: config.id
|
|
21
40
|
)
|
|
22
|
-
|
|
23
|
-
super.init(
|
|
24
|
-
template: template,
|
|
25
|
-
header: config.headerActions,
|
|
26
|
-
autoDismissMs: config.autoDismissMs
|
|
27
|
-
)
|
|
28
|
-
|
|
41
|
+
|
|
29
42
|
invalidate()
|
|
30
43
|
}
|
|
31
44
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
setBarButtons()
|
|
45
|
+
func invalidate() {
|
|
46
|
+
setBarButtons(template: template, barButtons: barButtons)
|
|
38
47
|
|
|
39
48
|
template.updateSections(
|
|
40
49
|
Parser.parseSections(
|
|
@@ -45,23 +54,23 @@ class ListTemplate: AutoPlayTemplate {
|
|
|
45
54
|
)
|
|
46
55
|
}
|
|
47
56
|
|
|
48
|
-
|
|
57
|
+
func onWillAppear(animated: Bool) {
|
|
49
58
|
config.onWillAppear?(animated)
|
|
50
59
|
}
|
|
51
60
|
|
|
52
|
-
|
|
61
|
+
func onDidAppear(animated: Bool) {
|
|
53
62
|
config.onDidAppear?(animated)
|
|
54
63
|
}
|
|
55
64
|
|
|
56
|
-
|
|
65
|
+
func onWillDisappear(animated: Bool) {
|
|
57
66
|
config.onWillDisappear?(animated)
|
|
58
67
|
}
|
|
59
68
|
|
|
60
|
-
|
|
69
|
+
func onDidDisappear(animated: Bool) {
|
|
61
70
|
config.onDidDisappear?(animated)
|
|
62
71
|
}
|
|
63
72
|
|
|
64
|
-
|
|
73
|
+
func onPopped() {
|
|
65
74
|
config.onPopped?()
|
|
66
75
|
}
|
|
67
76
|
|