@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,78 +0,0 @@
|
|
|
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
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// JHybridAndroidAutomotiveSpec.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 "JHybridAndroidAutomotiveSpec.hpp"
|
|
9
|
-
|
|
10
|
-
// Forward declaration of `ActiveCarUxRestrictions` to properly resolve imports.
|
|
11
|
-
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct ActiveCarUxRestrictions; }
|
|
12
|
-
// Forward declaration of `CarUxRestrictions` to properly resolve imports.
|
|
13
|
-
namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class CarUxRestrictions; }
|
|
14
|
-
// Forward declaration of `AppFocusState` to properly resolve imports.
|
|
15
|
-
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct AppFocusState; }
|
|
16
|
-
|
|
17
|
-
#include <functional>
|
|
18
|
-
#include "JFunc_void.hpp"
|
|
19
|
-
#include <NitroModules/JNICallable.hpp>
|
|
20
|
-
#include "ActiveCarUxRestrictions.hpp"
|
|
21
|
-
#include "JActiveCarUxRestrictions.hpp"
|
|
22
|
-
#include "CarUxRestrictions.hpp"
|
|
23
|
-
#include <vector>
|
|
24
|
-
#include "JCarUxRestrictions.hpp"
|
|
25
|
-
#include "AppFocusState.hpp"
|
|
26
|
-
#include "JAppFocusState.hpp"
|
|
27
|
-
#include <optional>
|
|
28
|
-
#include "JFunc_void_ActiveCarUxRestrictions.hpp"
|
|
29
|
-
#include "JFunc_void_AppFocusState.hpp"
|
|
30
|
-
|
|
31
|
-
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
32
|
-
|
|
33
|
-
jni::local_ref<JHybridAndroidAutomotiveSpec::jhybriddata> JHybridAndroidAutomotiveSpec::initHybrid(jni::alias_ref<jhybridobject> jThis) {
|
|
34
|
-
return makeCxxInstance(jThis);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
void JHybridAndroidAutomotiveSpec::registerNatives() {
|
|
38
|
-
registerHybrid({
|
|
39
|
-
makeNativeMethod("initHybrid", JHybridAndroidAutomotiveSpec::initHybrid),
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
size_t JHybridAndroidAutomotiveSpec::getExternalMemorySize() noexcept {
|
|
44
|
-
static const auto method = javaClassStatic()->getMethod<jlong()>("getMemorySize");
|
|
45
|
-
return method(_javaPart);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
bool JHybridAndroidAutomotiveSpec::equals(const std::shared_ptr<HybridObject>& other) {
|
|
49
|
-
if (auto otherCast = std::dynamic_pointer_cast<JHybridAndroidAutomotiveSpec>(other)) {
|
|
50
|
-
return _javaPart == otherCast->_javaPart;
|
|
51
|
-
}
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
void JHybridAndroidAutomotiveSpec::dispose() noexcept {
|
|
56
|
-
static const auto method = javaClassStatic()->getMethod<void()>("dispose");
|
|
57
|
-
method(_javaPart);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
std::string JHybridAndroidAutomotiveSpec::toString() {
|
|
61
|
-
static const auto method = javaClassStatic()->getMethod<jni::JString()>("toString");
|
|
62
|
-
auto javaString = method(_javaPart);
|
|
63
|
-
return javaString->toStdString();
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// Properties
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
// Methods
|
|
70
|
-
std::function<void()> JHybridAndroidAutomotiveSpec::registerCarUxRestrictionsListener(const std::function<void(const ActiveCarUxRestrictions& /* restrictions */)>& callback) {
|
|
71
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void::javaobject>(jni::alias_ref<JFunc_void_ActiveCarUxRestrictions::javaobject> /* callback */)>("registerCarUxRestrictionsListener_cxx");
|
|
72
|
-
auto __result = method(_javaPart, JFunc_void_ActiveCarUxRestrictions_cxx::fromCpp(callback));
|
|
73
|
-
return [&]() -> std::function<void()> {
|
|
74
|
-
if (__result->isInstanceOf(JFunc_void_cxx::javaClassStatic())) [[likely]] {
|
|
75
|
-
auto downcast = jni::static_ref_cast<JFunc_void_cxx::javaobject>(__result);
|
|
76
|
-
return downcast->cthis()->getFunction();
|
|
77
|
-
} else {
|
|
78
|
-
auto __resultRef = jni::make_global(__result);
|
|
79
|
-
return JNICallable<JFunc_void, void()>(std::move(__resultRef));
|
|
80
|
-
}
|
|
81
|
-
}();
|
|
82
|
-
}
|
|
83
|
-
ActiveCarUxRestrictions JHybridAndroidAutomotiveSpec::getCarUxRestrictions() {
|
|
84
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JActiveCarUxRestrictions>()>("getCarUxRestrictions");
|
|
85
|
-
auto __result = method(_javaPart);
|
|
86
|
-
return __result->toCpp();
|
|
87
|
-
}
|
|
88
|
-
std::function<void()> JHybridAndroidAutomotiveSpec::registerAppFocusListener(const std::function<void(const AppFocusState& /* state */)>& callback) {
|
|
89
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void::javaobject>(jni::alias_ref<JFunc_void_AppFocusState::javaobject> /* callback */)>("registerAppFocusListener_cxx");
|
|
90
|
-
auto __result = method(_javaPart, JFunc_void_AppFocusState_cxx::fromCpp(callback));
|
|
91
|
-
return [&]() -> std::function<void()> {
|
|
92
|
-
if (__result->isInstanceOf(JFunc_void_cxx::javaClassStatic())) [[likely]] {
|
|
93
|
-
auto downcast = jni::static_ref_cast<JFunc_void_cxx::javaobject>(__result);
|
|
94
|
-
return downcast->cthis()->getFunction();
|
|
95
|
-
} else {
|
|
96
|
-
auto __resultRef = jni::make_global(__result);
|
|
97
|
-
return JNICallable<JFunc_void, void()>(std::move(__resultRef));
|
|
98
|
-
}
|
|
99
|
-
}();
|
|
100
|
-
}
|
|
101
|
-
AppFocusState JHybridAndroidAutomotiveSpec::getAppFocusState() {
|
|
102
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JAppFocusState>()>("getAppFocusState");
|
|
103
|
-
auto __result = method(_javaPart);
|
|
104
|
-
return __result->toCpp();
|
|
105
|
-
}
|
|
106
|
-
std::function<void()> JHybridAndroidAutomotiveSpec::requestAppFocus() {
|
|
107
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void::javaobject>()>("requestAppFocus_cxx");
|
|
108
|
-
auto __result = method(_javaPart);
|
|
109
|
-
return [&]() -> std::function<void()> {
|
|
110
|
-
if (__result->isInstanceOf(JFunc_void_cxx::javaClassStatic())) [[likely]] {
|
|
111
|
-
auto downcast = jni::static_ref_cast<JFunc_void_cxx::javaobject>(__result);
|
|
112
|
-
return downcast->cthis()->getFunction();
|
|
113
|
-
} else {
|
|
114
|
-
auto __resultRef = jni::make_global(__result);
|
|
115
|
-
return JNICallable<JFunc_void, void()>(std::move(__resultRef));
|
|
116
|
-
}
|
|
117
|
-
}();
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
@@ -1,70 +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
|
-
#include <NitroModules/JHybridObject.hpp>
|
|
11
|
-
#include <fbjni/fbjni.h>
|
|
12
|
-
#include "HybridAndroidAutomotiveSpec.hpp"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
18
|
-
|
|
19
|
-
using namespace facebook;
|
|
20
|
-
|
|
21
|
-
class JHybridAndroidAutomotiveSpec: public jni::HybridClass<JHybridAndroidAutomotiveSpec, JHybridObject>,
|
|
22
|
-
public virtual HybridAndroidAutomotiveSpec {
|
|
23
|
-
public:
|
|
24
|
-
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAndroidAutomotiveSpec;";
|
|
25
|
-
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
|
|
26
|
-
static void registerNatives();
|
|
27
|
-
|
|
28
|
-
protected:
|
|
29
|
-
// C++ constructor (called from Java via `initHybrid()`)
|
|
30
|
-
explicit JHybridAndroidAutomotiveSpec(jni::alias_ref<jhybridobject> jThis) :
|
|
31
|
-
HybridObject(HybridAndroidAutomotiveSpec::TAG),
|
|
32
|
-
HybridBase(jThis),
|
|
33
|
-
_javaPart(jni::make_global(jThis)) {}
|
|
34
|
-
|
|
35
|
-
public:
|
|
36
|
-
~JHybridAndroidAutomotiveSpec() override {
|
|
37
|
-
// Hermes GC can destroy JS objects on a non-JNI Thread.
|
|
38
|
-
jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); });
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
public:
|
|
42
|
-
size_t getExternalMemorySize() noexcept override;
|
|
43
|
-
bool equals(const std::shared_ptr<HybridObject>& other) override;
|
|
44
|
-
void dispose() noexcept override;
|
|
45
|
-
std::string toString() override;
|
|
46
|
-
|
|
47
|
-
public:
|
|
48
|
-
inline const jni::global_ref<JHybridAndroidAutomotiveSpec::javaobject>& getJavaPart() const noexcept {
|
|
49
|
-
return _javaPart;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
public:
|
|
53
|
-
// Properties
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
public:
|
|
57
|
-
// Methods
|
|
58
|
-
std::function<void()> registerCarUxRestrictionsListener(const std::function<void(const ActiveCarUxRestrictions& /* restrictions */)>& callback) override;
|
|
59
|
-
ActiveCarUxRestrictions getCarUxRestrictions() override;
|
|
60
|
-
std::function<void()> registerAppFocusListener(const std::function<void(const AppFocusState& /* state */)>& callback) override;
|
|
61
|
-
AppFocusState getAppFocusState() override;
|
|
62
|
-
std::function<void()> requestAppFocus() override;
|
|
63
|
-
|
|
64
|
-
private:
|
|
65
|
-
friend HybridBase;
|
|
66
|
-
using HybridBase::HybridBase;
|
|
67
|
-
jni::global_ref<JHybridAndroidAutomotiveSpec::javaobject> _javaPart;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// JVariant_QrSignIn_PinSignIn_InputSignIn.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 "JVariant_QrSignIn_PinSignIn_InputSignIn.hpp"
|
|
9
|
-
|
|
10
|
-
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
11
|
-
/**
|
|
12
|
-
* Converts JVariant_QrSignIn_PinSignIn_InputSignIn to std::variant<QrSignIn, PinSignIn, InputSignIn>
|
|
13
|
-
*/
|
|
14
|
-
std::variant<QrSignIn, PinSignIn, InputSignIn> JVariant_QrSignIn_PinSignIn_InputSignIn::toCpp() const {
|
|
15
|
-
if (isInstanceOf(JVariant_QrSignIn_PinSignIn_InputSignIn_impl::First::javaClassStatic())) {
|
|
16
|
-
// It's a `QrSignIn`
|
|
17
|
-
auto jniValue = static_cast<const JVariant_QrSignIn_PinSignIn_InputSignIn_impl::First*>(this)->getValue();
|
|
18
|
-
return jniValue->toCpp();
|
|
19
|
-
} else if (isInstanceOf(JVariant_QrSignIn_PinSignIn_InputSignIn_impl::Second::javaClassStatic())) {
|
|
20
|
-
// It's a `PinSignIn`
|
|
21
|
-
auto jniValue = static_cast<const JVariant_QrSignIn_PinSignIn_InputSignIn_impl::Second*>(this)->getValue();
|
|
22
|
-
return jniValue->toCpp();
|
|
23
|
-
} else if (isInstanceOf(JVariant_QrSignIn_PinSignIn_InputSignIn_impl::Third::javaClassStatic())) {
|
|
24
|
-
// It's a `InputSignIn`
|
|
25
|
-
auto jniValue = static_cast<const JVariant_QrSignIn_PinSignIn_InputSignIn_impl::Third*>(this)->getValue();
|
|
26
|
-
return jniValue->toCpp();
|
|
27
|
-
}
|
|
28
|
-
throw std::invalid_argument("Variant is unknown Kotlin instance!");
|
|
29
|
-
}
|
|
30
|
-
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// ActiveCarUxRestrictions.kt
|
|
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
|
-
package com.margelo.nitro.swe.iternio.reactnativeautoplay
|
|
9
|
-
|
|
10
|
-
import androidx.annotation.Keep
|
|
11
|
-
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Represents the JavaScript object/struct "ActiveCarUxRestrictions".
|
|
16
|
-
*/
|
|
17
|
-
@DoNotStrip
|
|
18
|
-
@Keep
|
|
19
|
-
data class ActiveCarUxRestrictions(
|
|
20
|
-
@DoNotStrip
|
|
21
|
-
@Keep
|
|
22
|
-
val maxContentDepth: Double,
|
|
23
|
-
@DoNotStrip
|
|
24
|
-
@Keep
|
|
25
|
-
val maxCumulativeContentItems: Double,
|
|
26
|
-
@DoNotStrip
|
|
27
|
-
@Keep
|
|
28
|
-
val maxRestrictedStringLength: Double,
|
|
29
|
-
@DoNotStrip
|
|
30
|
-
@Keep
|
|
31
|
-
val activeRestrictions: Array<CarUxRestrictions>
|
|
32
|
-
) {
|
|
33
|
-
/* primary constructor */
|
|
34
|
-
|
|
35
|
-
companion object {
|
|
36
|
-
/**
|
|
37
|
-
* Constructor called from C++
|
|
38
|
-
*/
|
|
39
|
-
@DoNotStrip
|
|
40
|
-
@Keep
|
|
41
|
-
@Suppress("unused")
|
|
42
|
-
@JvmStatic
|
|
43
|
-
private fun fromCpp(maxContentDepth: Double, maxCumulativeContentItems: Double, maxRestrictedStringLength: Double, activeRestrictions: Array<CarUxRestrictions>): ActiveCarUxRestrictions {
|
|
44
|
-
return ActiveCarUxRestrictions(maxContentDepth, maxCumulativeContentItems, maxRestrictedStringLength, activeRestrictions)
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// AppFocusState.kt
|
|
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
|
-
package com.margelo.nitro.swe.iternio.reactnativeautoplay
|
|
9
|
-
|
|
10
|
-
import androidx.annotation.Keep
|
|
11
|
-
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Represents the JavaScript object/struct "AppFocusState".
|
|
16
|
-
*/
|
|
17
|
-
@DoNotStrip
|
|
18
|
-
@Keep
|
|
19
|
-
data class AppFocusState(
|
|
20
|
-
@DoNotStrip
|
|
21
|
-
@Keep
|
|
22
|
-
val isFocusOwned: Boolean?,
|
|
23
|
-
@DoNotStrip
|
|
24
|
-
@Keep
|
|
25
|
-
val isFocusActive: Boolean?
|
|
26
|
-
) {
|
|
27
|
-
/* primary constructor */
|
|
28
|
-
|
|
29
|
-
companion object {
|
|
30
|
-
/**
|
|
31
|
-
* Constructor called from C++
|
|
32
|
-
*/
|
|
33
|
-
@DoNotStrip
|
|
34
|
-
@Keep
|
|
35
|
-
@Suppress("unused")
|
|
36
|
-
@JvmStatic
|
|
37
|
-
private fun fromCpp(isFocusOwned: Boolean?, isFocusActive: Boolean?): AppFocusState {
|
|
38
|
-
return AppFocusState(isFocusOwned, isFocusActive)
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// CarUxRestrictions.kt
|
|
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
|
-
package com.margelo.nitro.swe.iternio.reactnativeautoplay
|
|
9
|
-
|
|
10
|
-
import androidx.annotation.Keep
|
|
11
|
-
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Represents the JavaScript enum/union "CarUxRestrictions".
|
|
15
|
-
*/
|
|
16
|
-
@DoNotStrip
|
|
17
|
-
@Keep
|
|
18
|
-
enum class CarUxRestrictions(@DoNotStrip @Keep val value: Int) {
|
|
19
|
-
UX_RESTRICTIONS_FULLY_RESTRICTED(511),
|
|
20
|
-
UX_RESTRICTIONS_LIMIT_CONTENT(32),
|
|
21
|
-
UX_RESTRICTIONS_LIMIT_STRING_LENGTH(4),
|
|
22
|
-
UX_RESTRICTIONS_NO_DIALPAD(1),
|
|
23
|
-
UX_RESTRICTIONS_NO_FILTERING(2),
|
|
24
|
-
UX_RESTRICTIONS_NO_KEYBOARD(8),
|
|
25
|
-
UX_RESTRICTIONS_NO_SETUP(64),
|
|
26
|
-
UX_RESTRICTIONS_NO_TEXT_MESSAGE(128),
|
|
27
|
-
UX_RESTRICTIONS_NO_VIDEO(16),
|
|
28
|
-
UX_RESTRICTIONS_NO_VOICE_TRANSCRIPTION(256);
|
|
29
|
-
|
|
30
|
-
companion object
|
|
31
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// Func_void_ActiveCarUxRestrictions.kt
|
|
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
|
-
package com.margelo.nitro.swe.iternio.reactnativeautoplay
|
|
9
|
-
|
|
10
|
-
import androidx.annotation.Keep
|
|
11
|
-
import com.facebook.jni.HybridData
|
|
12
|
-
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
-
import dalvik.annotation.optimization.FastNative
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Represents the JavaScript callback `(restrictions: struct) => void`.
|
|
18
|
-
* This can be either implemented in C++ (in which case it might be a callback coming from JS),
|
|
19
|
-
* or in Kotlin/Java (in which case it is a native callback).
|
|
20
|
-
*/
|
|
21
|
-
@DoNotStrip
|
|
22
|
-
@Keep
|
|
23
|
-
@Suppress("ClassName", "RedundantUnitReturnType")
|
|
24
|
-
fun interface Func_void_ActiveCarUxRestrictions: (ActiveCarUxRestrictions) -> Unit {
|
|
25
|
-
/**
|
|
26
|
-
* Call the given JS callback.
|
|
27
|
-
* @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted.
|
|
28
|
-
*/
|
|
29
|
-
@DoNotStrip
|
|
30
|
-
@Keep
|
|
31
|
-
override fun invoke(restrictions: ActiveCarUxRestrictions): Unit
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Represents the JavaScript callback `(restrictions: struct) => void`.
|
|
36
|
-
* This is implemented in C++, via a `std::function<...>`.
|
|
37
|
-
* The callback might be coming from JS.
|
|
38
|
-
*/
|
|
39
|
-
@DoNotStrip
|
|
40
|
-
@Keep
|
|
41
|
-
@Suppress(
|
|
42
|
-
"KotlinJniMissingFunction", "unused",
|
|
43
|
-
"RedundantSuppression", "RedundantUnitReturnType", "FunctionName",
|
|
44
|
-
"ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName",
|
|
45
|
-
)
|
|
46
|
-
class Func_void_ActiveCarUxRestrictions_cxx: Func_void_ActiveCarUxRestrictions {
|
|
47
|
-
@DoNotStrip
|
|
48
|
-
@Keep
|
|
49
|
-
private val mHybridData: HybridData
|
|
50
|
-
|
|
51
|
-
@DoNotStrip
|
|
52
|
-
@Keep
|
|
53
|
-
private constructor(hybridData: HybridData) {
|
|
54
|
-
mHybridData = hybridData
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
@DoNotStrip
|
|
58
|
-
@Keep
|
|
59
|
-
override fun invoke(restrictions: ActiveCarUxRestrictions): Unit
|
|
60
|
-
= invoke_cxx(restrictions)
|
|
61
|
-
|
|
62
|
-
@FastNative
|
|
63
|
-
private external fun invoke_cxx(restrictions: ActiveCarUxRestrictions): Unit
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Represents the JavaScript callback `(restrictions: struct) => void`.
|
|
68
|
-
* This is implemented in Java/Kotlin, via a `(ActiveCarUxRestrictions) -> Unit`.
|
|
69
|
-
* The callback is always coming from native.
|
|
70
|
-
*/
|
|
71
|
-
@DoNotStrip
|
|
72
|
-
@Keep
|
|
73
|
-
@Suppress("ClassName", "RedundantUnitReturnType", "unused")
|
|
74
|
-
class Func_void_ActiveCarUxRestrictions_java(private val function: (ActiveCarUxRestrictions) -> Unit): Func_void_ActiveCarUxRestrictions {
|
|
75
|
-
@DoNotStrip
|
|
76
|
-
@Keep
|
|
77
|
-
override fun invoke(restrictions: ActiveCarUxRestrictions): Unit {
|
|
78
|
-
return this.function(restrictions)
|
|
79
|
-
}
|
|
80
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// HybridAndroidAutomotiveSpec.kt
|
|
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
|
-
package com.margelo.nitro.swe.iternio.reactnativeautoplay
|
|
9
|
-
|
|
10
|
-
import androidx.annotation.Keep
|
|
11
|
-
import com.facebook.jni.HybridData
|
|
12
|
-
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
-
import com.margelo.nitro.core.HybridObject
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* A Kotlin class representing the AndroidAutomotive HybridObject.
|
|
17
|
-
* Implement this abstract class to create Kotlin-based instances of AndroidAutomotive.
|
|
18
|
-
*/
|
|
19
|
-
@DoNotStrip
|
|
20
|
-
@Keep
|
|
21
|
-
@Suppress(
|
|
22
|
-
"KotlinJniMissingFunction", "unused",
|
|
23
|
-
"RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet",
|
|
24
|
-
"LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
|
|
25
|
-
)
|
|
26
|
-
abstract class HybridAndroidAutomotiveSpec: HybridObject() {
|
|
27
|
-
@DoNotStrip
|
|
28
|
-
private var mHybridData: HybridData = initHybrid()
|
|
29
|
-
|
|
30
|
-
init {
|
|
31
|
-
super.updateNative(mHybridData)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
override fun updateNative(hybridData: HybridData) {
|
|
35
|
-
mHybridData = hybridData
|
|
36
|
-
super.updateNative(hybridData)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Default implementation of `HybridObject.toString()`
|
|
40
|
-
override fun toString(): String {
|
|
41
|
-
return "[HybridObject AndroidAutomotive]"
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Properties
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
// Methods
|
|
48
|
-
abstract fun registerCarUxRestrictionsListener(callback: (restrictions: ActiveCarUxRestrictions) -> Unit): () -> Unit
|
|
49
|
-
|
|
50
|
-
@DoNotStrip
|
|
51
|
-
@Keep
|
|
52
|
-
private fun registerCarUxRestrictionsListener_cxx(callback: Func_void_ActiveCarUxRestrictions): Func_void {
|
|
53
|
-
val __result = registerCarUxRestrictionsListener(callback)
|
|
54
|
-
return Func_void_java(__result)
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
@DoNotStrip
|
|
58
|
-
@Keep
|
|
59
|
-
abstract fun getCarUxRestrictions(): ActiveCarUxRestrictions
|
|
60
|
-
|
|
61
|
-
abstract fun registerAppFocusListener(callback: (state: AppFocusState) -> Unit): () -> Unit
|
|
62
|
-
|
|
63
|
-
@DoNotStrip
|
|
64
|
-
@Keep
|
|
65
|
-
private fun registerAppFocusListener_cxx(callback: Func_void_AppFocusState): Func_void {
|
|
66
|
-
val __result = registerAppFocusListener(callback)
|
|
67
|
-
return Func_void_java(__result)
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
@DoNotStrip
|
|
71
|
-
@Keep
|
|
72
|
-
abstract fun getAppFocusState(): AppFocusState
|
|
73
|
-
|
|
74
|
-
abstract fun requestAppFocus(): () -> Unit
|
|
75
|
-
|
|
76
|
-
@DoNotStrip
|
|
77
|
-
@Keep
|
|
78
|
-
private fun requestAppFocus_cxx(): Func_void {
|
|
79
|
-
val __result = requestAppFocus()
|
|
80
|
-
return Func_void_java(__result)
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
private external fun initHybrid(): HybridData
|
|
84
|
-
|
|
85
|
-
companion object {
|
|
86
|
-
protected const val TAG = "HybridAndroidAutomotiveSpec"
|
|
87
|
-
}
|
|
88
|
-
}
|