@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,120 @@
|
|
|
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
|
|
@@ -0,0 +1,70 @@
|
|
|
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
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_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.jni.HybridData
|
|
12
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import dalvik.annotation.optimization.FastNative
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Represents the JavaScript callback `(state: 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_AppFocusState: (AppFocusState) -> 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(state: AppFocusState): Unit
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Represents the JavaScript callback `(state: 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_AppFocusState_cxx: Func_void_AppFocusState {
|
|
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(state: AppFocusState): Unit
|
|
60
|
+
= invoke_cxx(state)
|
|
61
|
+
|
|
62
|
+
@FastNative
|
|
63
|
+
private external fun invoke_cxx(state: AppFocusState): Unit
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Represents the JavaScript callback `(state: struct) => void`.
|
|
68
|
+
* This is implemented in Java/Kotlin, via a `(AppFocusState) -> Unit`.
|
|
69
|
+
* The callback is always coming from native.
|
|
70
|
+
*/
|
|
71
|
+
@DoNotStrip
|
|
72
|
+
@Keep
|
|
73
|
+
@Suppress("ClassName", "RedundantUnitReturnType", "unused")
|
|
74
|
+
class Func_void_AppFocusState_java(private val function: (AppFocusState) -> Unit): Func_void_AppFocusState {
|
|
75
|
+
@DoNotStrip
|
|
76
|
+
@Keep
|
|
77
|
+
override fun invoke(state: AppFocusState): Unit {
|
|
78
|
+
return this.function(state)
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -25,13 +25,16 @@ data class GoogleSignIn(
|
|
|
25
25
|
val serverClientId: String,
|
|
26
26
|
@DoNotStrip
|
|
27
27
|
@Keep
|
|
28
|
-
val callback: Func_void_std__optional_std__string__std__optional_GoogleSignInAccount_
|
|
28
|
+
val callback: Func_void_std__optional_std__string__std__optional_GoogleSignInAccount_,
|
|
29
|
+
@DoNotStrip
|
|
30
|
+
@Keep
|
|
31
|
+
val signInButtonText: String
|
|
29
32
|
) {
|
|
30
33
|
/**
|
|
31
34
|
* Create a new instance of GoogleSignIn from Kotlin
|
|
32
35
|
*/
|
|
33
|
-
constructor(method: SignInMethods, serverClientId: String, callback: (error: String?, signInAccount: GoogleSignInAccount?) -> Unit):
|
|
34
|
-
this(method, serverClientId, Func_void_std__optional_std__string__std__optional_GoogleSignInAccount__java(callback))
|
|
36
|
+
constructor(method: SignInMethods, serverClientId: String, callback: (error: String?, signInAccount: GoogleSignInAccount?) -> Unit, signInButtonText: String):
|
|
37
|
+
this(method, serverClientId, Func_void_std__optional_std__string__std__optional_GoogleSignInAccount__java(callback), signInButtonText)
|
|
35
38
|
|
|
36
39
|
companion object {
|
|
37
40
|
/**
|
|
@@ -41,8 +44,8 @@ data class GoogleSignIn(
|
|
|
41
44
|
@Keep
|
|
42
45
|
@Suppress("unused")
|
|
43
46
|
@JvmStatic
|
|
44
|
-
private fun fromCpp(method: SignInMethods, serverClientId: String, callback: Func_void_std__optional_std__string__std__optional_GoogleSignInAccount_): GoogleSignIn {
|
|
45
|
-
return GoogleSignIn(method, serverClientId, callback)
|
|
47
|
+
private fun fromCpp(method: SignInMethods, serverClientId: String, callback: Func_void_std__optional_std__string__std__optional_GoogleSignInAccount_, signInButtonText: String): GoogleSignIn {
|
|
48
|
+
return GoogleSignIn(method, serverClientId, callback, signInButtonText)
|
|
46
49
|
}
|
|
47
50
|
}
|
|
48
51
|
}
|
|
@@ -0,0 +1,88 @@
|
|
|
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
|
+
}
|