@iternio/react-native-auto-play 0.2.0-alpha.4 → 0.2.0-alpha.7
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 +1 -1
- package/android/src/auto/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAndroidAutomotive.kt +25 -0
- package/android/src/automotive/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/AndroidTelemetryObserver.kt +2 -5
- package/android/src/automotive/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAndroidAutomotive.kt +185 -0
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/SignInWithGoogleActivity.kt +14 -20
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/template/AutomotivePermissionRequestTemplate.kt +3 -3
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/template/SignInTemplate.kt +15 -12
- package/android/src/main/res/drawable/google.xml +18 -0
- package/lib/hooks/useAndroidAutoTelemetry.d.ts +13 -4
- package/lib/hooks/useAndroidAutoTelemetry.js +6 -3
- package/lib/hooks/useIsAutoPlayFocused.d.ts +7 -0
- package/lib/hooks/useIsAutoPlayFocused.js +20 -0
- package/lib/hybrid.d.ts +2 -0
- package/lib/hybrid.js +2 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +4 -0
- package/lib/specs/AndroidAutomotive.nitro.d.ts +33 -0
- package/lib/specs/AndroidAutomotive.nitro.js +13 -0
- package/lib/specs/AutomotivePermissionRequestTemplate.d.ts +11 -0
- package/lib/specs/AutomotivePermissionRequestTemplate.js +1 -0
- package/lib/specs/AutomotivePermissionRequestTemplate.nitro.d.ts +11 -0
- package/lib/specs/AutomotivePermissionRequestTemplate.nitro.js +1 -0
- package/lib/templates/AutomotivePermissionRequestTemplate.d.ts +23 -0
- package/lib/templates/AutomotivePermissionRequestTemplate.js +18 -0
- package/lib/types/SignInMethod.d.ts +1 -0
- package/nitro.json +3 -0
- package/nitrogen/generated/android/ReactNativeAutoPlay+autolinking.cmake +2 -0
- package/nitrogen/generated/android/ReactNativeAutoPlayOnLoad.cpp +16 -2
- package/nitrogen/generated/android/c++/JActiveCarUxRestrictions.hpp +89 -0
- package/nitrogen/generated/android/c++/JAppFocusState.hpp +61 -0
- package/nitrogen/generated/android/c++/JCarUxRestrictions.hpp +82 -0
- package/nitrogen/generated/android/c++/JFunc_void_ActiveCarUxRestrictions.hpp +80 -0
- package/nitrogen/generated/android/c++/JFunc_void_AppFocusState.hpp +78 -0
- package/nitrogen/generated/android/c++/JGoogleSignIn.hpp +7 -3
- package/nitrogen/generated/android/c++/JHybridAndroidAutomotiveSpec.cpp +120 -0
- package/nitrogen/generated/android/c++/JHybridAndroidAutomotiveSpec.hpp +70 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/ActiveCarUxRestrictions.kt +47 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/AppFocusState.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/CarUxRestrictions.kt +31 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_ActiveCarUxRestrictions.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_AppFocusState.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/GoogleSignIn.kt +8 -5
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAndroidAutomotiveSpec.kt +88 -0
- package/nitrogen/generated/shared/c++/ActiveCarUxRestrictions.hpp +97 -0
- package/nitrogen/generated/shared/c++/AppFocusState.hpp +87 -0
- package/nitrogen/generated/shared/c++/CarUxRestrictions.hpp +81 -0
- package/nitrogen/generated/shared/c++/GoogleSignIn.hpp +6 -2
- package/nitrogen/generated/shared/c++/HybridAndroidAutomotiveSpec.cpp +25 -0
- package/nitrogen/generated/shared/c++/HybridAndroidAutomotiveSpec.hpp +71 -0
- package/package.json +1 -1
- package/src/hooks/useAndroidAutoTelemetry.ts +48 -32
- package/src/index.ts +11 -0
- package/src/specs/AndroidAutomotive.nitro.ts +37 -0
- package/src/types/SignInMethod.ts +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { CustomActionButtonAndroid } from '../types/Button';
|
|
2
|
+
import type { AutoText } from '../types/Text';
|
|
3
|
+
import { type NitroAction } from '../utils/NitroAction';
|
|
4
|
+
import { type HeaderActions, Template, type TemplateConfig } from './Template';
|
|
5
|
+
export interface NitroAutomotivePermissionRequestTemplateConfig extends TemplateConfig {
|
|
6
|
+
headerActions?: Array<NitroAction>;
|
|
7
|
+
title: AutoText;
|
|
8
|
+
actions: Array<NitroAction>;
|
|
9
|
+
}
|
|
10
|
+
export type AutomotivePermissionRequestTemplateConfig = Omit<NitroAutomotivePermissionRequestTemplateConfig, 'headerActions' | 'buttons'> & {
|
|
11
|
+
/**
|
|
12
|
+
* action buttons, usually at the the top right on Android and a top bar on iOS
|
|
13
|
+
*/
|
|
14
|
+
headerActions?: HeaderActions<AutomotivePermissionRequestTemplate>;
|
|
15
|
+
actions: [CustomActionButtonAndroid<AutomotivePermissionRequestTemplate>] | [
|
|
16
|
+
CustomActionButtonAndroid<AutomotivePermissionRequestTemplate>,
|
|
17
|
+
CustomActionButtonAndroid<AutomotivePermissionRequestTemplate>
|
|
18
|
+
];
|
|
19
|
+
};
|
|
20
|
+
export declare class AutomotivePermissionRequestTemplate extends Template<AutomotivePermissionRequestTemplateConfig, HeaderActions<AutomotivePermissionRequestTemplate>> {
|
|
21
|
+
private template;
|
|
22
|
+
constructor(config: AutomotivePermissionRequestTemplateConfig);
|
|
23
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { NitroModules } from 'react-native-nitro-modules';
|
|
2
|
+
import { NitroActionUtil } from '../utils/NitroAction';
|
|
3
|
+
import { Template, } from './Template';
|
|
4
|
+
const HybridAutomotivePermissionRequestTemplate = NitroModules.createHybridObject('AutomotivePermissionRequestTemplate');
|
|
5
|
+
export class AutomotivePermissionRequestTemplate extends Template {
|
|
6
|
+
template = this;
|
|
7
|
+
constructor(config) {
|
|
8
|
+
super(config);
|
|
9
|
+
const { headerActions, actions, ...rest } = config;
|
|
10
|
+
const nitroConfig = {
|
|
11
|
+
...rest,
|
|
12
|
+
id: this.id,
|
|
13
|
+
headerActions: NitroActionUtil.convert(this.template, headerActions),
|
|
14
|
+
actions: NitroActionUtil.convert(this.template, actions),
|
|
15
|
+
};
|
|
16
|
+
HybridAutomotivePermissionRequestTemplate.createAutomotivePermissionRequestTemplate(nitroConfig);
|
|
17
|
+
}
|
|
18
|
+
}
|
package/nitro.json
CHANGED
|
@@ -33,6 +33,7 @@ target_sources(
|
|
|
33
33
|
# Autolinking Setup
|
|
34
34
|
../nitrogen/generated/android/ReactNativeAutoPlayOnLoad.cpp
|
|
35
35
|
# Shared Nitrogen C++ sources
|
|
36
|
+
../nitrogen/generated/shared/c++/HybridAndroidAutomotiveSpec.cpp
|
|
36
37
|
../nitrogen/generated/shared/c++/HybridAndroidAutoTelemetrySpec.cpp
|
|
37
38
|
../nitrogen/generated/shared/c++/HybridAutoPlaySpec.cpp
|
|
38
39
|
../nitrogen/generated/shared/c++/HybridCarPlayDashboardSpec.cpp
|
|
@@ -45,6 +46,7 @@ target_sources(
|
|
|
45
46
|
../nitrogen/generated/shared/c++/HybridSearchTemplateSpec.cpp
|
|
46
47
|
../nitrogen/generated/shared/c++/HybridSignInTemplateSpec.cpp
|
|
47
48
|
# Android-specific Nitrogen C++ sources
|
|
49
|
+
../nitrogen/generated/android/c++/JHybridAndroidAutomotiveSpec.cpp
|
|
48
50
|
../nitrogen/generated/android/c++/JHybridAndroidAutoTelemetrySpec.cpp
|
|
49
51
|
../nitrogen/generated/android/c++/JHybridAutoPlaySpec.cpp
|
|
50
52
|
../nitrogen/generated/android/c++/JVariant_GlyphImage_AssetImage.cpp
|
|
@@ -15,8 +15,11 @@
|
|
|
15
15
|
#include <fbjni/fbjni.h>
|
|
16
16
|
#include <NitroModules/HybridObjectRegistry.hpp>
|
|
17
17
|
|
|
18
|
-
#include "
|
|
18
|
+
#include "JHybridAndroidAutomotiveSpec.hpp"
|
|
19
19
|
#include "JFunc_void.hpp"
|
|
20
|
+
#include "JFunc_void_ActiveCarUxRestrictions.hpp"
|
|
21
|
+
#include "JFunc_void_AppFocusState.hpp"
|
|
22
|
+
#include "JHybridAndroidAutoTelemetrySpec.hpp"
|
|
20
23
|
#include "JFunc_void_std__optional_Telemetry_.hpp"
|
|
21
24
|
#include "JHybridAutoPlaySpec.hpp"
|
|
22
25
|
#include "JFunc_void_VisibilityState.hpp"
|
|
@@ -54,8 +57,11 @@ int initialize(JavaVM* vm) {
|
|
|
54
57
|
|
|
55
58
|
return facebook::jni::initialize(vm, [] {
|
|
56
59
|
// Register native JNI methods
|
|
57
|
-
margelo::nitro::swe::iternio::reactnativeautoplay::
|
|
60
|
+
margelo::nitro::swe::iternio::reactnativeautoplay::JHybridAndroidAutomotiveSpec::registerNatives();
|
|
58
61
|
margelo::nitro::swe::iternio::reactnativeautoplay::JFunc_void_cxx::registerNatives();
|
|
62
|
+
margelo::nitro::swe::iternio::reactnativeautoplay::JFunc_void_ActiveCarUxRestrictions_cxx::registerNatives();
|
|
63
|
+
margelo::nitro::swe::iternio::reactnativeautoplay::JFunc_void_AppFocusState_cxx::registerNatives();
|
|
64
|
+
margelo::nitro::swe::iternio::reactnativeautoplay::JHybridAndroidAutoTelemetrySpec::registerNatives();
|
|
59
65
|
margelo::nitro::swe::iternio::reactnativeautoplay::JFunc_void_std__optional_Telemetry__cxx::registerNatives();
|
|
60
66
|
margelo::nitro::swe::iternio::reactnativeautoplay::JHybridAutoPlaySpec::registerNatives();
|
|
61
67
|
margelo::nitro::swe::iternio::reactnativeautoplay::JFunc_void_VisibilityState_cxx::registerNatives();
|
|
@@ -100,6 +106,14 @@ int initialize(JavaVM* vm) {
|
|
|
100
106
|
return instance->cthis()->shared();
|
|
101
107
|
}
|
|
102
108
|
);
|
|
109
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
110
|
+
"AndroidAutomotive",
|
|
111
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
112
|
+
static DefaultConstructableObject<JHybridAndroidAutomotiveSpec::javaobject> object("com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAndroidAutomotive");
|
|
113
|
+
auto instance = object.create();
|
|
114
|
+
return instance->cthis()->shared();
|
|
115
|
+
}
|
|
116
|
+
);
|
|
103
117
|
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
104
118
|
"SignInTemplate",
|
|
105
119
|
[]() -> std::shared_ptr<HybridObject> {
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JActiveCarUxRestrictions.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "ActiveCarUxRestrictions.hpp"
|
|
12
|
+
|
|
13
|
+
#include "CarUxRestrictions.hpp"
|
|
14
|
+
#include "JCarUxRestrictions.hpp"
|
|
15
|
+
#include <vector>
|
|
16
|
+
|
|
17
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
18
|
+
|
|
19
|
+
using namespace facebook;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The C++ JNI bridge between the C++ struct "ActiveCarUxRestrictions" and the the Kotlin data class "ActiveCarUxRestrictions".
|
|
23
|
+
*/
|
|
24
|
+
struct JActiveCarUxRestrictions final: public jni::JavaClass<JActiveCarUxRestrictions> {
|
|
25
|
+
public:
|
|
26
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/swe/iternio/reactnativeautoplay/ActiveCarUxRestrictions;";
|
|
27
|
+
|
|
28
|
+
public:
|
|
29
|
+
/**
|
|
30
|
+
* Convert this Java/Kotlin-based struct to the C++ struct ActiveCarUxRestrictions by copying all values to C++.
|
|
31
|
+
*/
|
|
32
|
+
[[maybe_unused]]
|
|
33
|
+
[[nodiscard]]
|
|
34
|
+
ActiveCarUxRestrictions toCpp() const {
|
|
35
|
+
static const auto clazz = javaClassStatic();
|
|
36
|
+
static const auto fieldMaxContentDepth = clazz->getField<double>("maxContentDepth");
|
|
37
|
+
double maxContentDepth = this->getFieldValue(fieldMaxContentDepth);
|
|
38
|
+
static const auto fieldMaxCumulativeContentItems = clazz->getField<double>("maxCumulativeContentItems");
|
|
39
|
+
double maxCumulativeContentItems = this->getFieldValue(fieldMaxCumulativeContentItems);
|
|
40
|
+
static const auto fieldMaxRestrictedStringLength = clazz->getField<double>("maxRestrictedStringLength");
|
|
41
|
+
double maxRestrictedStringLength = this->getFieldValue(fieldMaxRestrictedStringLength);
|
|
42
|
+
static const auto fieldActiveRestrictions = clazz->getField<jni::JArrayClass<JCarUxRestrictions>>("activeRestrictions");
|
|
43
|
+
jni::local_ref<jni::JArrayClass<JCarUxRestrictions>> activeRestrictions = this->getFieldValue(fieldActiveRestrictions);
|
|
44
|
+
return ActiveCarUxRestrictions(
|
|
45
|
+
maxContentDepth,
|
|
46
|
+
maxCumulativeContentItems,
|
|
47
|
+
maxRestrictedStringLength,
|
|
48
|
+
[&]() {
|
|
49
|
+
size_t __size = activeRestrictions->size();
|
|
50
|
+
std::vector<CarUxRestrictions> __vector;
|
|
51
|
+
__vector.reserve(__size);
|
|
52
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
53
|
+
auto __element = activeRestrictions->getElement(__i);
|
|
54
|
+
__vector.push_back(__element->toCpp());
|
|
55
|
+
}
|
|
56
|
+
return __vector;
|
|
57
|
+
}()
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
public:
|
|
62
|
+
/**
|
|
63
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
64
|
+
*/
|
|
65
|
+
[[maybe_unused]]
|
|
66
|
+
static jni::local_ref<JActiveCarUxRestrictions::javaobject> fromCpp(const ActiveCarUxRestrictions& value) {
|
|
67
|
+
using JSignature = JActiveCarUxRestrictions(double, double, double, jni::alias_ref<jni::JArrayClass<JCarUxRestrictions>>);
|
|
68
|
+
static const auto clazz = javaClassStatic();
|
|
69
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
70
|
+
return create(
|
|
71
|
+
clazz,
|
|
72
|
+
value.maxContentDepth,
|
|
73
|
+
value.maxCumulativeContentItems,
|
|
74
|
+
value.maxRestrictedStringLength,
|
|
75
|
+
[&]() {
|
|
76
|
+
size_t __size = value.activeRestrictions.size();
|
|
77
|
+
jni::local_ref<jni::JArrayClass<JCarUxRestrictions>> __array = jni::JArrayClass<JCarUxRestrictions>::newArray(__size);
|
|
78
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
79
|
+
const auto& __element = value.activeRestrictions[__i];
|
|
80
|
+
auto __elementJni = JCarUxRestrictions::fromCpp(__element);
|
|
81
|
+
__array->setElement(__i, *__elementJni);
|
|
82
|
+
}
|
|
83
|
+
return __array;
|
|
84
|
+
}()
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JAppFocusState.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "AppFocusState.hpp"
|
|
12
|
+
|
|
13
|
+
#include <optional>
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
16
|
+
|
|
17
|
+
using namespace facebook;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The C++ JNI bridge between the C++ struct "AppFocusState" and the the Kotlin data class "AppFocusState".
|
|
21
|
+
*/
|
|
22
|
+
struct JAppFocusState final: public jni::JavaClass<JAppFocusState> {
|
|
23
|
+
public:
|
|
24
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/swe/iternio/reactnativeautoplay/AppFocusState;";
|
|
25
|
+
|
|
26
|
+
public:
|
|
27
|
+
/**
|
|
28
|
+
* Convert this Java/Kotlin-based struct to the C++ struct AppFocusState by copying all values to C++.
|
|
29
|
+
*/
|
|
30
|
+
[[maybe_unused]]
|
|
31
|
+
[[nodiscard]]
|
|
32
|
+
AppFocusState toCpp() const {
|
|
33
|
+
static const auto clazz = javaClassStatic();
|
|
34
|
+
static const auto fieldIsFocusOwned = clazz->getField<jni::JBoolean>("isFocusOwned");
|
|
35
|
+
jni::local_ref<jni::JBoolean> isFocusOwned = this->getFieldValue(fieldIsFocusOwned);
|
|
36
|
+
static const auto fieldIsFocusActive = clazz->getField<jni::JBoolean>("isFocusActive");
|
|
37
|
+
jni::local_ref<jni::JBoolean> isFocusActive = this->getFieldValue(fieldIsFocusActive);
|
|
38
|
+
return AppFocusState(
|
|
39
|
+
isFocusOwned != nullptr ? std::make_optional(static_cast<bool>(isFocusOwned->value())) : std::nullopt,
|
|
40
|
+
isFocusActive != nullptr ? std::make_optional(static_cast<bool>(isFocusActive->value())) : std::nullopt
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
public:
|
|
45
|
+
/**
|
|
46
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
47
|
+
*/
|
|
48
|
+
[[maybe_unused]]
|
|
49
|
+
static jni::local_ref<JAppFocusState::javaobject> fromCpp(const AppFocusState& value) {
|
|
50
|
+
using JSignature = JAppFocusState(jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JBoolean>);
|
|
51
|
+
static const auto clazz = javaClassStatic();
|
|
52
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
53
|
+
return create(
|
|
54
|
+
clazz,
|
|
55
|
+
value.isFocusOwned.has_value() ? jni::JBoolean::valueOf(value.isFocusOwned.value()) : nullptr,
|
|
56
|
+
value.isFocusActive.has_value() ? jni::JBoolean::valueOf(value.isFocusActive.value()) : nullptr
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JCarUxRestrictions.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "CarUxRestrictions.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "CarUxRestrictions" and the the Kotlin enum "CarUxRestrictions".
|
|
19
|
+
*/
|
|
20
|
+
struct JCarUxRestrictions final: public jni::JavaClass<JCarUxRestrictions> {
|
|
21
|
+
public:
|
|
22
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/swe/iternio/reactnativeautoplay/CarUxRestrictions;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum CarUxRestrictions.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
CarUxRestrictions toCpp() const {
|
|
31
|
+
static const auto clazz = javaClassStatic();
|
|
32
|
+
static const auto fieldOrdinal = clazz->getField<int>("value");
|
|
33
|
+
int ordinal = this->getFieldValue(fieldOrdinal);
|
|
34
|
+
return static_cast<CarUxRestrictions>(ordinal);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
/**
|
|
39
|
+
* Create a Java/Kotlin-based enum with the given C++ enum's value.
|
|
40
|
+
*/
|
|
41
|
+
[[maybe_unused]]
|
|
42
|
+
static jni::alias_ref<JCarUxRestrictions> fromCpp(CarUxRestrictions value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case CarUxRestrictions::UX_RESTRICTIONS_FULLY_RESTRICTED:
|
|
46
|
+
static const auto fieldUX_RESTRICTIONS_FULLY_RESTRICTED = clazz->getStaticField<JCarUxRestrictions>("UX_RESTRICTIONS_FULLY_RESTRICTED");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldUX_RESTRICTIONS_FULLY_RESTRICTED);
|
|
48
|
+
case CarUxRestrictions::UX_RESTRICTIONS_LIMIT_CONTENT:
|
|
49
|
+
static const auto fieldUX_RESTRICTIONS_LIMIT_CONTENT = clazz->getStaticField<JCarUxRestrictions>("UX_RESTRICTIONS_LIMIT_CONTENT");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldUX_RESTRICTIONS_LIMIT_CONTENT);
|
|
51
|
+
case CarUxRestrictions::UX_RESTRICTIONS_LIMIT_STRING_LENGTH:
|
|
52
|
+
static const auto fieldUX_RESTRICTIONS_LIMIT_STRING_LENGTH = clazz->getStaticField<JCarUxRestrictions>("UX_RESTRICTIONS_LIMIT_STRING_LENGTH");
|
|
53
|
+
return clazz->getStaticFieldValue(fieldUX_RESTRICTIONS_LIMIT_STRING_LENGTH);
|
|
54
|
+
case CarUxRestrictions::UX_RESTRICTIONS_NO_DIALPAD:
|
|
55
|
+
static const auto fieldUX_RESTRICTIONS_NO_DIALPAD = clazz->getStaticField<JCarUxRestrictions>("UX_RESTRICTIONS_NO_DIALPAD");
|
|
56
|
+
return clazz->getStaticFieldValue(fieldUX_RESTRICTIONS_NO_DIALPAD);
|
|
57
|
+
case CarUxRestrictions::UX_RESTRICTIONS_NO_FILTERING:
|
|
58
|
+
static const auto fieldUX_RESTRICTIONS_NO_FILTERING = clazz->getStaticField<JCarUxRestrictions>("UX_RESTRICTIONS_NO_FILTERING");
|
|
59
|
+
return clazz->getStaticFieldValue(fieldUX_RESTRICTIONS_NO_FILTERING);
|
|
60
|
+
case CarUxRestrictions::UX_RESTRICTIONS_NO_KEYBOARD:
|
|
61
|
+
static const auto fieldUX_RESTRICTIONS_NO_KEYBOARD = clazz->getStaticField<JCarUxRestrictions>("UX_RESTRICTIONS_NO_KEYBOARD");
|
|
62
|
+
return clazz->getStaticFieldValue(fieldUX_RESTRICTIONS_NO_KEYBOARD);
|
|
63
|
+
case CarUxRestrictions::UX_RESTRICTIONS_NO_SETUP:
|
|
64
|
+
static const auto fieldUX_RESTRICTIONS_NO_SETUP = clazz->getStaticField<JCarUxRestrictions>("UX_RESTRICTIONS_NO_SETUP");
|
|
65
|
+
return clazz->getStaticFieldValue(fieldUX_RESTRICTIONS_NO_SETUP);
|
|
66
|
+
case CarUxRestrictions::UX_RESTRICTIONS_NO_TEXT_MESSAGE:
|
|
67
|
+
static const auto fieldUX_RESTRICTIONS_NO_TEXT_MESSAGE = clazz->getStaticField<JCarUxRestrictions>("UX_RESTRICTIONS_NO_TEXT_MESSAGE");
|
|
68
|
+
return clazz->getStaticFieldValue(fieldUX_RESTRICTIONS_NO_TEXT_MESSAGE);
|
|
69
|
+
case CarUxRestrictions::UX_RESTRICTIONS_NO_VIDEO:
|
|
70
|
+
static const auto fieldUX_RESTRICTIONS_NO_VIDEO = clazz->getStaticField<JCarUxRestrictions>("UX_RESTRICTIONS_NO_VIDEO");
|
|
71
|
+
return clazz->getStaticFieldValue(fieldUX_RESTRICTIONS_NO_VIDEO);
|
|
72
|
+
case CarUxRestrictions::UX_RESTRICTIONS_NO_VOICE_TRANSCRIPTION:
|
|
73
|
+
static const auto fieldUX_RESTRICTIONS_NO_VOICE_TRANSCRIPTION = clazz->getStaticField<JCarUxRestrictions>("UX_RESTRICTIONS_NO_VOICE_TRANSCRIPTION");
|
|
74
|
+
return clazz->getStaticFieldValue(fieldUX_RESTRICTIONS_NO_VOICE_TRANSCRIPTION);
|
|
75
|
+
default:
|
|
76
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
77
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JFunc_void_ActiveCarUxRestrictions.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include <functional>
|
|
12
|
+
|
|
13
|
+
#include "ActiveCarUxRestrictions.hpp"
|
|
14
|
+
#include <functional>
|
|
15
|
+
#include <NitroModules/JNICallable.hpp>
|
|
16
|
+
#include "JActiveCarUxRestrictions.hpp"
|
|
17
|
+
#include "CarUxRestrictions.hpp"
|
|
18
|
+
#include <vector>
|
|
19
|
+
#include "JCarUxRestrictions.hpp"
|
|
20
|
+
|
|
21
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
22
|
+
|
|
23
|
+
using namespace facebook;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Represents the Java/Kotlin callback `(restrictions: ActiveCarUxRestrictions) -> Unit`.
|
|
27
|
+
* This can be passed around between C++ and Java/Kotlin.
|
|
28
|
+
*/
|
|
29
|
+
struct JFunc_void_ActiveCarUxRestrictions: public jni::JavaClass<JFunc_void_ActiveCarUxRestrictions> {
|
|
30
|
+
public:
|
|
31
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_ActiveCarUxRestrictions;";
|
|
32
|
+
|
|
33
|
+
public:
|
|
34
|
+
/**
|
|
35
|
+
* Invokes the function this `JFunc_void_ActiveCarUxRestrictions` instance holds through JNI.
|
|
36
|
+
*/
|
|
37
|
+
void invoke(const ActiveCarUxRestrictions& restrictions) const {
|
|
38
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JActiveCarUxRestrictions> /* restrictions */)>("invoke");
|
|
39
|
+
method(self(), JActiveCarUxRestrictions::fromCpp(restrictions));
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* An implementation of Func_void_ActiveCarUxRestrictions that is backed by a C++ implementation (using `std::function<...>`)
|
|
45
|
+
*/
|
|
46
|
+
class JFunc_void_ActiveCarUxRestrictions_cxx final: public jni::HybridClass<JFunc_void_ActiveCarUxRestrictions_cxx, JFunc_void_ActiveCarUxRestrictions> {
|
|
47
|
+
public:
|
|
48
|
+
static jni::local_ref<JFunc_void_ActiveCarUxRestrictions::javaobject> fromCpp(const std::function<void(const ActiveCarUxRestrictions& /* restrictions */)>& func) {
|
|
49
|
+
return JFunc_void_ActiveCarUxRestrictions_cxx::newObjectCxxArgs(func);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
public:
|
|
53
|
+
/**
|
|
54
|
+
* Invokes the C++ `std::function<...>` this `JFunc_void_ActiveCarUxRestrictions_cxx` instance holds.
|
|
55
|
+
*/
|
|
56
|
+
void invoke_cxx(jni::alias_ref<JActiveCarUxRestrictions> restrictions) {
|
|
57
|
+
_func(restrictions->toCpp());
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
public:
|
|
61
|
+
[[nodiscard]]
|
|
62
|
+
inline const std::function<void(const ActiveCarUxRestrictions& /* restrictions */)>& getFunction() const {
|
|
63
|
+
return _func;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
public:
|
|
67
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_ActiveCarUxRestrictions_cxx;";
|
|
68
|
+
static void registerNatives() {
|
|
69
|
+
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_ActiveCarUxRestrictions_cxx::invoke_cxx)});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
private:
|
|
73
|
+
explicit JFunc_void_ActiveCarUxRestrictions_cxx(const std::function<void(const ActiveCarUxRestrictions& /* restrictions */)>& func): _func(func) { }
|
|
74
|
+
|
|
75
|
+
private:
|
|
76
|
+
friend HybridBase;
|
|
77
|
+
std::function<void(const ActiveCarUxRestrictions& /* restrictions */)> _func;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JFunc_void_AppFocusState.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include <functional>
|
|
12
|
+
|
|
13
|
+
#include "AppFocusState.hpp"
|
|
14
|
+
#include <functional>
|
|
15
|
+
#include <NitroModules/JNICallable.hpp>
|
|
16
|
+
#include "JAppFocusState.hpp"
|
|
17
|
+
#include <optional>
|
|
18
|
+
|
|
19
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
20
|
+
|
|
21
|
+
using namespace facebook;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Represents the Java/Kotlin callback `(state: AppFocusState) -> Unit`.
|
|
25
|
+
* This can be passed around between C++ and Java/Kotlin.
|
|
26
|
+
*/
|
|
27
|
+
struct JFunc_void_AppFocusState: public jni::JavaClass<JFunc_void_AppFocusState> {
|
|
28
|
+
public:
|
|
29
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_AppFocusState;";
|
|
30
|
+
|
|
31
|
+
public:
|
|
32
|
+
/**
|
|
33
|
+
* Invokes the function this `JFunc_void_AppFocusState` instance holds through JNI.
|
|
34
|
+
*/
|
|
35
|
+
void invoke(const AppFocusState& state) const {
|
|
36
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JAppFocusState> /* state */)>("invoke");
|
|
37
|
+
method(self(), JAppFocusState::fromCpp(state));
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* An implementation of Func_void_AppFocusState that is backed by a C++ implementation (using `std::function<...>`)
|
|
43
|
+
*/
|
|
44
|
+
class JFunc_void_AppFocusState_cxx final: public jni::HybridClass<JFunc_void_AppFocusState_cxx, JFunc_void_AppFocusState> {
|
|
45
|
+
public:
|
|
46
|
+
static jni::local_ref<JFunc_void_AppFocusState::javaobject> fromCpp(const std::function<void(const AppFocusState& /* state */)>& func) {
|
|
47
|
+
return JFunc_void_AppFocusState_cxx::newObjectCxxArgs(func);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public:
|
|
51
|
+
/**
|
|
52
|
+
* Invokes the C++ `std::function<...>` this `JFunc_void_AppFocusState_cxx` instance holds.
|
|
53
|
+
*/
|
|
54
|
+
void invoke_cxx(jni::alias_ref<JAppFocusState> state) {
|
|
55
|
+
_func(state->toCpp());
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
public:
|
|
59
|
+
[[nodiscard]]
|
|
60
|
+
inline const std::function<void(const AppFocusState& /* state */)>& getFunction() const {
|
|
61
|
+
return _func;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
public:
|
|
65
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_AppFocusState_cxx;";
|
|
66
|
+
static void registerNatives() {
|
|
67
|
+
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_AppFocusState_cxx::invoke_cxx)});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
private:
|
|
71
|
+
explicit JFunc_void_AppFocusState_cxx(const std::function<void(const AppFocusState& /* state */)>& func): _func(func) { }
|
|
72
|
+
|
|
73
|
+
private:
|
|
74
|
+
friend HybridBase;
|
|
75
|
+
std::function<void(const AppFocusState& /* state */)> _func;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
@@ -45,6 +45,8 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
45
45
|
jni::local_ref<jni::JString> serverClientId = this->getFieldValue(fieldServerClientId);
|
|
46
46
|
static const auto fieldCallback = clazz->getField<JFunc_void_std__optional_std__string__std__optional_GoogleSignInAccount_::javaobject>("callback");
|
|
47
47
|
jni::local_ref<JFunc_void_std__optional_std__string__std__optional_GoogleSignInAccount_::javaobject> callback = this->getFieldValue(fieldCallback);
|
|
48
|
+
static const auto fieldSignInButtonText = clazz->getField<jni::JString>("signInButtonText");
|
|
49
|
+
jni::local_ref<jni::JString> signInButtonText = this->getFieldValue(fieldSignInButtonText);
|
|
48
50
|
return GoogleSignIn(
|
|
49
51
|
method->toCpp(),
|
|
50
52
|
serverClientId->toStdString(),
|
|
@@ -56,7 +58,8 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
56
58
|
auto callbackRef = jni::make_global(callback);
|
|
57
59
|
return JNICallable<JFunc_void_std__optional_std__string__std__optional_GoogleSignInAccount_, void(std::optional<std::string>, std::optional<GoogleSignInAccount>)>(std::move(callbackRef));
|
|
58
60
|
}
|
|
59
|
-
}()
|
|
61
|
+
}(),
|
|
62
|
+
signInButtonText->toStdString()
|
|
60
63
|
);
|
|
61
64
|
}
|
|
62
65
|
|
|
@@ -66,14 +69,15 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
66
69
|
*/
|
|
67
70
|
[[maybe_unused]]
|
|
68
71
|
static jni::local_ref<JGoogleSignIn::javaobject> fromCpp(const GoogleSignIn& value) {
|
|
69
|
-
using JSignature = JGoogleSignIn(jni::alias_ref<JSignInMethods>, jni::alias_ref<jni::JString>, jni::alias_ref<JFunc_void_std__optional_std__string__std__optional_GoogleSignInAccount_::javaobject>);
|
|
72
|
+
using JSignature = JGoogleSignIn(jni::alias_ref<JSignInMethods>, jni::alias_ref<jni::JString>, jni::alias_ref<JFunc_void_std__optional_std__string__std__optional_GoogleSignInAccount_::javaobject>, jni::alias_ref<jni::JString>);
|
|
70
73
|
static const auto clazz = javaClassStatic();
|
|
71
74
|
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
72
75
|
return create(
|
|
73
76
|
clazz,
|
|
74
77
|
JSignInMethods::fromCpp(value.method),
|
|
75
78
|
jni::make_jstring(value.serverClientId),
|
|
76
|
-
JFunc_void_std__optional_std__string__std__optional_GoogleSignInAccount__cxx::fromCpp(value.callback)
|
|
79
|
+
JFunc_void_std__optional_std__string__std__optional_GoogleSignInAccount__cxx::fromCpp(value.callback),
|
|
80
|
+
jni::make_jstring(value.signInButtonText)
|
|
77
81
|
);
|
|
78
82
|
}
|
|
79
83
|
};
|