@iternio/react-native-auto-play 0.2.0-alpha.3 → 0.2.0-alpha.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/build.gradle +2 -2
- package/android/src/automotive/AndroidManifest.xml +2 -0
- package/android/src/automotive/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/AndroidTelemetryObserver.kt +5 -2
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/SignInWithGoogleActivity.kt +63 -0
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/template/SignInTemplate.kt +52 -0
- package/lib/hooks/useAndroidAutoTelemetry.d.ts +4 -13
- package/lib/hooks/useAndroidAutoTelemetry.js +3 -6
- package/lib/index.d.ts +0 -4
- package/lib/index.js +0 -4
- package/lib/types/SignInMethod.d.ts +17 -2
- package/lib/types/SignInMethod.js +1 -1
- package/nitro.json +0 -3
- package/nitrogen/generated/android/ReactNativeAutoPlay+autolinking.cmake +1 -3
- package/nitrogen/generated/android/ReactNativeAutoPlayOnLoad.cpp +4 -16
- package/nitrogen/generated/android/c++/JFunc_void_std__optional_std__string__std__optional_GoogleSignInAccount_.hpp +79 -0
- package/nitrogen/generated/android/c++/JGoogleSignIn.hpp +81 -0
- package/nitrogen/generated/android/c++/JGoogleSignInAccount.hpp +86 -0
- package/nitrogen/generated/android/c++/JHybridSignInTemplateSpec.cpp +10 -1
- package/nitrogen/generated/android/c++/JSignInMethods.hpp +3 -3
- package/nitrogen/generated/android/c++/JSignInTemplateConfig.hpp +10 -5
- package/nitrogen/generated/android/c++/JVariant_QrSignIn_PinSignIn_InputSignIn_GoogleSignIn.cpp +34 -0
- package/nitrogen/generated/android/c++/{JVariant_QrSignIn_PinSignIn_InputSignIn.hpp → JVariant_QrSignIn_PinSignIn_InputSignIn_GoogleSignIn.hpp} +40 -20
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/{Func_void_AppFocusState.kt → Func_void_std__optional_std__string__std__optional_GoogleSignInAccount_.kt} +14 -14
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/GoogleSignIn.kt +48 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/GoogleSignInAccount.kt +59 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/SignInMethods.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/SignInTemplateConfig.kt +3 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/{Variant_QrSignIn_PinSignIn_InputSignIn.kt → Variant_QrSignIn_PinSignIn_InputSignIn_GoogleSignIn.kt} +23 -10
- package/nitrogen/generated/shared/c++/GoogleSignIn.hpp +98 -0
- package/nitrogen/generated/shared/c++/GoogleSignInAccount.hpp +112 -0
- package/nitrogen/generated/shared/c++/SignInMethods.hpp +1 -1
- package/nitrogen/generated/shared/c++/SignInTemplateConfig.hpp +8 -5
- package/package.json +1 -1
- package/src/hooks/useAndroidAutoTelemetry.ts +32 -48
- package/src/index.ts +0 -11
- package/src/types/SignInMethod.ts +19 -2
- package/android/src/auto/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAndroidAutomotive.kt +0 -25
- package/android/src/automotive/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAndroidAutomotive.kt +0 -190
- package/lib/hooks/useIsAutoPlayFocused.d.ts +0 -7
- package/lib/hooks/useIsAutoPlayFocused.js +0 -20
- package/lib/hybrid.d.ts +0 -2
- package/lib/hybrid.js +0 -2
- package/lib/specs/AndroidAutomotive.nitro.d.ts +0 -33
- package/lib/specs/AndroidAutomotive.nitro.js +0 -13
- package/lib/specs/AutomotivePermissionRequestTemplate.d.ts +0 -11
- package/lib/specs/AutomotivePermissionRequestTemplate.js +0 -1
- package/lib/specs/AutomotivePermissionRequestTemplate.nitro.d.ts +0 -11
- package/lib/specs/AutomotivePermissionRequestTemplate.nitro.js +0 -1
- package/lib/templates/AutomotivePermissionRequestTemplate.d.ts +0 -23
- package/lib/templates/AutomotivePermissionRequestTemplate.js +0 -18
- package/nitrogen/generated/android/c++/JActiveCarUxRestrictions.hpp +0 -89
- package/nitrogen/generated/android/c++/JAppFocusState.hpp +0 -61
- package/nitrogen/generated/android/c++/JCarUxRestrictions.hpp +0 -82
- package/nitrogen/generated/android/c++/JFunc_void_ActiveCarUxRestrictions.hpp +0 -80
- package/nitrogen/generated/android/c++/JFunc_void_AppFocusState.hpp +0 -78
- package/nitrogen/generated/android/c++/JHybridAndroidAutomotiveSpec.cpp +0 -120
- package/nitrogen/generated/android/c++/JHybridAndroidAutomotiveSpec.hpp +0 -70
- package/nitrogen/generated/android/c++/JVariant_QrSignIn_PinSignIn_InputSignIn.cpp +0 -30
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/ActiveCarUxRestrictions.kt +0 -47
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/AppFocusState.kt +0 -41
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/CarUxRestrictions.kt +0 -31
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_ActiveCarUxRestrictions.kt +0 -80
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAndroidAutomotiveSpec.kt +0 -88
- package/nitrogen/generated/shared/c++/ActiveCarUxRestrictions.hpp +0 -97
- package/nitrogen/generated/shared/c++/AppFocusState.hpp +0 -87
- package/nitrogen/generated/shared/c++/CarUxRestrictions.hpp +0 -81
- package/nitrogen/generated/shared/c++/HybridAndroidAutomotiveSpec.cpp +0 -25
- package/nitrogen/generated/shared/c++/HybridAndroidAutomotiveSpec.hpp +0 -71
- package/src/specs/AndroidAutomotive.nitro.ts +0 -37
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// 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
|
-
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
-
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
-
#else
|
|
13
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
-
#endif
|
|
15
|
-
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
-
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
-
#else
|
|
18
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
-
#endif
|
|
20
|
-
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
-
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
-
#else
|
|
23
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
-
#endif
|
|
25
|
-
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
-
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
-
#else
|
|
28
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
-
#endif
|
|
30
|
-
|
|
31
|
-
// Forward declaration of `CarUxRestrictions` to properly resolve imports.
|
|
32
|
-
namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class CarUxRestrictions; }
|
|
33
|
-
|
|
34
|
-
#include "CarUxRestrictions.hpp"
|
|
35
|
-
#include <vector>
|
|
36
|
-
|
|
37
|
-
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* A struct which can be represented as a JavaScript object (ActiveCarUxRestrictions).
|
|
41
|
-
*/
|
|
42
|
-
struct ActiveCarUxRestrictions final {
|
|
43
|
-
public:
|
|
44
|
-
double maxContentDepth SWIFT_PRIVATE;
|
|
45
|
-
double maxCumulativeContentItems SWIFT_PRIVATE;
|
|
46
|
-
double maxRestrictedStringLength SWIFT_PRIVATE;
|
|
47
|
-
std::vector<CarUxRestrictions> activeRestrictions SWIFT_PRIVATE;
|
|
48
|
-
|
|
49
|
-
public:
|
|
50
|
-
ActiveCarUxRestrictions() = default;
|
|
51
|
-
explicit ActiveCarUxRestrictions(double maxContentDepth, double maxCumulativeContentItems, double maxRestrictedStringLength, std::vector<CarUxRestrictions> activeRestrictions): maxContentDepth(maxContentDepth), maxCumulativeContentItems(maxCumulativeContentItems), maxRestrictedStringLength(maxRestrictedStringLength), activeRestrictions(activeRestrictions) {}
|
|
52
|
-
|
|
53
|
-
public:
|
|
54
|
-
friend bool operator==(const ActiveCarUxRestrictions& lhs, const ActiveCarUxRestrictions& rhs) = default;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
58
|
-
|
|
59
|
-
namespace margelo::nitro {
|
|
60
|
-
|
|
61
|
-
// C++ ActiveCarUxRestrictions <> JS ActiveCarUxRestrictions (object)
|
|
62
|
-
template <>
|
|
63
|
-
struct JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::ActiveCarUxRestrictions> final {
|
|
64
|
-
static inline margelo::nitro::swe::iternio::reactnativeautoplay::ActiveCarUxRestrictions fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
65
|
-
jsi::Object obj = arg.asObject(runtime);
|
|
66
|
-
return margelo::nitro::swe::iternio::reactnativeautoplay::ActiveCarUxRestrictions(
|
|
67
|
-
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxContentDepth"))),
|
|
68
|
-
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxCumulativeContentItems"))),
|
|
69
|
-
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxRestrictedStringLength"))),
|
|
70
|
-
JSIConverter<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::CarUxRestrictions>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "activeRestrictions")))
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::swe::iternio::reactnativeautoplay::ActiveCarUxRestrictions& arg) {
|
|
74
|
-
jsi::Object obj(runtime);
|
|
75
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "maxContentDepth"), JSIConverter<double>::toJSI(runtime, arg.maxContentDepth));
|
|
76
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "maxCumulativeContentItems"), JSIConverter<double>::toJSI(runtime, arg.maxCumulativeContentItems));
|
|
77
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "maxRestrictedStringLength"), JSIConverter<double>::toJSI(runtime, arg.maxRestrictedStringLength));
|
|
78
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "activeRestrictions"), JSIConverter<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::CarUxRestrictions>>::toJSI(runtime, arg.activeRestrictions));
|
|
79
|
-
return obj;
|
|
80
|
-
}
|
|
81
|
-
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
82
|
-
if (!value.isObject()) {
|
|
83
|
-
return false;
|
|
84
|
-
}
|
|
85
|
-
jsi::Object obj = value.getObject(runtime);
|
|
86
|
-
if (!nitro::isPlainObject(runtime, obj)) {
|
|
87
|
-
return false;
|
|
88
|
-
}
|
|
89
|
-
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxContentDepth")))) return false;
|
|
90
|
-
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxCumulativeContentItems")))) return false;
|
|
91
|
-
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxRestrictedStringLength")))) return false;
|
|
92
|
-
if (!JSIConverter<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::CarUxRestrictions>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "activeRestrictions")))) return false;
|
|
93
|
-
return true;
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
} // namespace margelo::nitro
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// 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
|
-
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
-
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
-
#else
|
|
13
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
-
#endif
|
|
15
|
-
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
-
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
-
#else
|
|
18
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
-
#endif
|
|
20
|
-
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
-
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
-
#else
|
|
23
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
-
#endif
|
|
25
|
-
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
-
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
-
#else
|
|
28
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
-
#endif
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
#include <optional>
|
|
34
|
-
|
|
35
|
-
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* A struct which can be represented as a JavaScript object (AppFocusState).
|
|
39
|
-
*/
|
|
40
|
-
struct AppFocusState final {
|
|
41
|
-
public:
|
|
42
|
-
std::optional<bool> isFocusOwned SWIFT_PRIVATE;
|
|
43
|
-
std::optional<bool> isFocusActive SWIFT_PRIVATE;
|
|
44
|
-
|
|
45
|
-
public:
|
|
46
|
-
AppFocusState() = default;
|
|
47
|
-
explicit AppFocusState(std::optional<bool> isFocusOwned, std::optional<bool> isFocusActive): isFocusOwned(isFocusOwned), isFocusActive(isFocusActive) {}
|
|
48
|
-
|
|
49
|
-
public:
|
|
50
|
-
friend bool operator==(const AppFocusState& lhs, const AppFocusState& rhs) = default;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
54
|
-
|
|
55
|
-
namespace margelo::nitro {
|
|
56
|
-
|
|
57
|
-
// C++ AppFocusState <> JS AppFocusState (object)
|
|
58
|
-
template <>
|
|
59
|
-
struct JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::AppFocusState> final {
|
|
60
|
-
static inline margelo::nitro::swe::iternio::reactnativeautoplay::AppFocusState fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
61
|
-
jsi::Object obj = arg.asObject(runtime);
|
|
62
|
-
return margelo::nitro::swe::iternio::reactnativeautoplay::AppFocusState(
|
|
63
|
-
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isFocusOwned"))),
|
|
64
|
-
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isFocusActive")))
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::swe::iternio::reactnativeautoplay::AppFocusState& arg) {
|
|
68
|
-
jsi::Object obj(runtime);
|
|
69
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "isFocusOwned"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.isFocusOwned));
|
|
70
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "isFocusActive"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.isFocusActive));
|
|
71
|
-
return obj;
|
|
72
|
-
}
|
|
73
|
-
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
74
|
-
if (!value.isObject()) {
|
|
75
|
-
return false;
|
|
76
|
-
}
|
|
77
|
-
jsi::Object obj = value.getObject(runtime);
|
|
78
|
-
if (!nitro::isPlainObject(runtime, obj)) {
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isFocusOwned")))) return false;
|
|
82
|
-
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isFocusActive")))) return false;
|
|
83
|
-
return true;
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
} // namespace margelo::nitro
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// CarUxRestrictions.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
|
-
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
-
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
-
#else
|
|
13
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
-
#endif
|
|
15
|
-
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
-
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
-
#else
|
|
18
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
-
#endif
|
|
20
|
-
|
|
21
|
-
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* An enum which can be represented as a JavaScript enum (CarUxRestrictions).
|
|
25
|
-
*/
|
|
26
|
-
enum class CarUxRestrictions {
|
|
27
|
-
UX_RESTRICTIONS_FULLY_RESTRICTED SWIFT_NAME(uxRestrictionsFullyRestricted) = 511,
|
|
28
|
-
UX_RESTRICTIONS_LIMIT_CONTENT SWIFT_NAME(uxRestrictionsLimitContent) = 32,
|
|
29
|
-
UX_RESTRICTIONS_LIMIT_STRING_LENGTH SWIFT_NAME(uxRestrictionsLimitStringLength) = 4,
|
|
30
|
-
UX_RESTRICTIONS_NO_DIALPAD SWIFT_NAME(uxRestrictionsNoDialpad) = 1,
|
|
31
|
-
UX_RESTRICTIONS_NO_FILTERING SWIFT_NAME(uxRestrictionsNoFiltering) = 2,
|
|
32
|
-
UX_RESTRICTIONS_NO_KEYBOARD SWIFT_NAME(uxRestrictionsNoKeyboard) = 8,
|
|
33
|
-
UX_RESTRICTIONS_NO_SETUP SWIFT_NAME(uxRestrictionsNoSetup) = 64,
|
|
34
|
-
UX_RESTRICTIONS_NO_TEXT_MESSAGE SWIFT_NAME(uxRestrictionsNoTextMessage) = 128,
|
|
35
|
-
UX_RESTRICTIONS_NO_VIDEO SWIFT_NAME(uxRestrictionsNoVideo) = 16,
|
|
36
|
-
UX_RESTRICTIONS_NO_VOICE_TRANSCRIPTION SWIFT_NAME(uxRestrictionsNoVoiceTranscription) = 256,
|
|
37
|
-
} CLOSED_ENUM;
|
|
38
|
-
|
|
39
|
-
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
40
|
-
|
|
41
|
-
namespace margelo::nitro {
|
|
42
|
-
|
|
43
|
-
// C++ CarUxRestrictions <> JS CarUxRestrictions (enum)
|
|
44
|
-
template <>
|
|
45
|
-
struct JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::CarUxRestrictions> final {
|
|
46
|
-
static inline margelo::nitro::swe::iternio::reactnativeautoplay::CarUxRestrictions fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
47
|
-
int enumValue = JSIConverter<int>::fromJSI(runtime, arg);
|
|
48
|
-
return static_cast<margelo::nitro::swe::iternio::reactnativeautoplay::CarUxRestrictions>(enumValue);
|
|
49
|
-
}
|
|
50
|
-
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::swe::iternio::reactnativeautoplay::CarUxRestrictions arg) {
|
|
51
|
-
int enumValue = static_cast<int>(arg);
|
|
52
|
-
return JSIConverter<int>::toJSI(runtime, enumValue);
|
|
53
|
-
}
|
|
54
|
-
static inline bool canConvert(jsi::Runtime&, const jsi::Value& value) {
|
|
55
|
-
if (!value.isNumber()) {
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
double number = value.getNumber();
|
|
59
|
-
int integer = static_cast<int>(number);
|
|
60
|
-
if (number != integer) {
|
|
61
|
-
// The integer is not the same value as the double - we truncated floating points.
|
|
62
|
-
// Enums are all integers, so the input floating point number is obviously invalid.
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
switch (integer) {
|
|
66
|
-
case 511 /* UX_RESTRICTIONS_FULLY_RESTRICTED */: return true;
|
|
67
|
-
case 32 /* UX_RESTRICTIONS_LIMIT_CONTENT */: return true;
|
|
68
|
-
case 4 /* UX_RESTRICTIONS_LIMIT_STRING_LENGTH */: return true;
|
|
69
|
-
case 1 /* UX_RESTRICTIONS_NO_DIALPAD */: return true;
|
|
70
|
-
case 2 /* UX_RESTRICTIONS_NO_FILTERING */: return true;
|
|
71
|
-
case 8 /* UX_RESTRICTIONS_NO_KEYBOARD */: return true;
|
|
72
|
-
case 64 /* UX_RESTRICTIONS_NO_SETUP */: return true;
|
|
73
|
-
case 128 /* UX_RESTRICTIONS_NO_TEXT_MESSAGE */: return true;
|
|
74
|
-
case 16 /* UX_RESTRICTIONS_NO_VIDEO */: return true;
|
|
75
|
-
case 256 /* UX_RESTRICTIONS_NO_VOICE_TRANSCRIPTION */: return true;
|
|
76
|
-
default: return false;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
} // namespace margelo::nitro
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// HybridAndroidAutomotiveSpec.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 "HybridAndroidAutomotiveSpec.hpp"
|
|
9
|
-
|
|
10
|
-
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
11
|
-
|
|
12
|
-
void HybridAndroidAutomotiveSpec::loadHybridMethods() {
|
|
13
|
-
// load base methods/properties
|
|
14
|
-
HybridObject::loadHybridMethods();
|
|
15
|
-
// load custom methods/properties
|
|
16
|
-
registerHybrids(this, [](Prototype& prototype) {
|
|
17
|
-
prototype.registerHybridMethod("registerCarUxRestrictionsListener", &HybridAndroidAutomotiveSpec::registerCarUxRestrictionsListener);
|
|
18
|
-
prototype.registerHybridMethod("getCarUxRestrictions", &HybridAndroidAutomotiveSpec::getCarUxRestrictions);
|
|
19
|
-
prototype.registerHybridMethod("registerAppFocusListener", &HybridAndroidAutomotiveSpec::registerAppFocusListener);
|
|
20
|
-
prototype.registerHybridMethod("getAppFocusState", &HybridAndroidAutomotiveSpec::getAppFocusState);
|
|
21
|
-
prototype.registerHybridMethod("requestAppFocus", &HybridAndroidAutomotiveSpec::requestAppFocus);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// HybridAndroidAutomotiveSpec.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
|
-
#if __has_include(<NitroModules/HybridObject.hpp>)
|
|
11
|
-
#include <NitroModules/HybridObject.hpp>
|
|
12
|
-
#else
|
|
13
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
-
#endif
|
|
15
|
-
|
|
16
|
-
// Forward declaration of `ActiveCarUxRestrictions` to properly resolve imports.
|
|
17
|
-
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct ActiveCarUxRestrictions; }
|
|
18
|
-
// Forward declaration of `AppFocusState` to properly resolve imports.
|
|
19
|
-
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct AppFocusState; }
|
|
20
|
-
|
|
21
|
-
#include <functional>
|
|
22
|
-
#include "ActiveCarUxRestrictions.hpp"
|
|
23
|
-
#include "AppFocusState.hpp"
|
|
24
|
-
|
|
25
|
-
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
26
|
-
|
|
27
|
-
using namespace margelo::nitro;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* An abstract base class for `AndroidAutomotive`
|
|
31
|
-
* Inherit this class to create instances of `HybridAndroidAutomotiveSpec` in C++.
|
|
32
|
-
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
|
|
33
|
-
* @example
|
|
34
|
-
* ```cpp
|
|
35
|
-
* class HybridAndroidAutomotive: public HybridAndroidAutomotiveSpec {
|
|
36
|
-
* public:
|
|
37
|
-
* HybridAndroidAutomotive(...): HybridObject(TAG) { ... }
|
|
38
|
-
* // ...
|
|
39
|
-
* };
|
|
40
|
-
* ```
|
|
41
|
-
*/
|
|
42
|
-
class HybridAndroidAutomotiveSpec: public virtual HybridObject {
|
|
43
|
-
public:
|
|
44
|
-
// Constructor
|
|
45
|
-
explicit HybridAndroidAutomotiveSpec(): HybridObject(TAG) { }
|
|
46
|
-
|
|
47
|
-
// Destructor
|
|
48
|
-
~HybridAndroidAutomotiveSpec() override = default;
|
|
49
|
-
|
|
50
|
-
public:
|
|
51
|
-
// Properties
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
public:
|
|
55
|
-
// Methods
|
|
56
|
-
virtual std::function<void()> registerCarUxRestrictionsListener(const std::function<void(const ActiveCarUxRestrictions& /* restrictions */)>& callback) = 0;
|
|
57
|
-
virtual ActiveCarUxRestrictions getCarUxRestrictions() = 0;
|
|
58
|
-
virtual std::function<void()> registerAppFocusListener(const std::function<void(const AppFocusState& /* state */)>& callback) = 0;
|
|
59
|
-
virtual AppFocusState getAppFocusState() = 0;
|
|
60
|
-
virtual std::function<void()> requestAppFocus() = 0;
|
|
61
|
-
|
|
62
|
-
protected:
|
|
63
|
-
// Hybrid Setup
|
|
64
|
-
void loadHybridMethods() override;
|
|
65
|
-
|
|
66
|
-
protected:
|
|
67
|
-
// Tag for logging
|
|
68
|
-
static constexpr auto TAG = "AndroidAutomotive";
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { HybridObject } from 'react-native-nitro-modules';
|
|
2
|
-
import type { CleanupCallback } from '../types/Event';
|
|
3
|
-
|
|
4
|
-
export enum CarUxRestrictions {
|
|
5
|
-
UX_RESTRICTIONS_FULLY_RESTRICTED = 511,
|
|
6
|
-
UX_RESTRICTIONS_LIMIT_CONTENT = 32,
|
|
7
|
-
UX_RESTRICTIONS_LIMIT_STRING_LENGTH = 4,
|
|
8
|
-
UX_RESTRICTIONS_NO_DIALPAD = 1,
|
|
9
|
-
UX_RESTRICTIONS_NO_FILTERING = 2,
|
|
10
|
-
UX_RESTRICTIONS_NO_KEYBOARD = 8,
|
|
11
|
-
UX_RESTRICTIONS_NO_SETUP = 64,
|
|
12
|
-
UX_RESTRICTIONS_NO_TEXT_MESSAGE = 128,
|
|
13
|
-
UX_RESTRICTIONS_NO_VIDEO = 16,
|
|
14
|
-
UX_RESTRICTIONS_NO_VOICE_TRANSCRIPTION = 256,
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface ActiveCarUxRestrictions {
|
|
18
|
-
maxContentDepth: number;
|
|
19
|
-
maxCumulativeContentItems: number;
|
|
20
|
-
maxRestrictedStringLength: number;
|
|
21
|
-
activeRestrictions: Array<CarUxRestrictions>;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface AppFocusState {
|
|
25
|
-
isFocusOwned?: boolean;
|
|
26
|
-
isFocusActive?: boolean;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface AndroidAutomotive extends HybridObject<{ android: 'kotlin' }> {
|
|
30
|
-
registerCarUxRestrictionsListener(
|
|
31
|
-
callback: (restrictions: ActiveCarUxRestrictions) => void
|
|
32
|
-
): CleanupCallback;
|
|
33
|
-
getCarUxRestrictions(): ActiveCarUxRestrictions;
|
|
34
|
-
registerAppFocusListener(callback: (state: AppFocusState) => void): CleanupCallback;
|
|
35
|
-
getAppFocusState(): AppFocusState;
|
|
36
|
-
requestAppFocus(): CleanupCallback;
|
|
37
|
-
}
|