@iternio/react-native-auto-play 0.2.0-alpha.4 → 0.2.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/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/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,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
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
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
|
|
@@ -0,0 +1,87 @@
|
|
|
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
|