react-native-unistyles 3.0.20 → 3.0.22
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 +17 -13
- package/android/src/main/java/com/unistyles/NativePlatform+insets.kt +1 -1
- package/cxx/shadowTree/ShadowTreeManager.cpp +14 -5
- package/ios/Equatable.swift +11 -18
- package/ios/NativePlatform+keyboard.swift +23 -1
- package/nitrogen/generated/android/c++/JColorScheme.hpp +4 -5
- package/nitrogen/generated/android/c++/JDimensions.hpp +1 -1
- package/nitrogen/generated/android/c++/JFunc_void_UnistylesNativeMiniRuntime.hpp +1 -1
- package/nitrogen/generated/android/c++/JFunc_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.hpp +1 -1
- package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.cpp +8 -1
- package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.hpp +2 -1
- package/nitrogen/generated/android/c++/JInsets.hpp +1 -1
- package/nitrogen/generated/android/c++/JOrientation.hpp +3 -4
- package/nitrogen/generated/android/c++/JUnistyleDependency.hpp +17 -18
- package/nitrogen/generated/android/c++/JUnistylesNativeMiniRuntime.hpp +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/ColorScheme.kt +3 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Dimensions.kt +2 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Func_void_UnistylesNativeMiniRuntime.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/HybridNativePlatformSpec.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Insets.kt +2 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Orientation.kt +3 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/UnistyleDependency.kt +3 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/UnistylesNativeMiniRuntime.kt +2 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/unistylesOnLoad.kt +1 -1
- package/nitrogen/generated/android/unistyles+autolinking.cmake +1 -1
- package/nitrogen/generated/android/unistyles+autolinking.gradle +1 -1
- package/nitrogen/generated/android/unistylesOnLoad.cpp +1 -1
- package/nitrogen/generated/android/unistylesOnLoad.hpp +1 -1
- package/nitrogen/generated/ios/Unistyles+autolinking.rb +2 -2
- package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.cpp +1 -1
- package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.hpp +1 -1
- package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Umbrella.hpp +1 -1
- package/nitrogen/generated/ios/c++/HybridNativePlatformSpecSwift.cpp +1 -1
- package/nitrogen/generated/ios/c++/HybridNativePlatformSpecSwift.hpp +7 -1
- package/nitrogen/generated/ios/swift/ColorScheme.swift +1 -1
- package/nitrogen/generated/ios/swift/Dimensions.swift +5 -17
- package/nitrogen/generated/ios/swift/Func_void_UnistylesNativeMiniRuntime.swift +1 -1
- package/nitrogen/generated/ios/swift/Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridNativePlatformSpec.swift +3 -3
- package/nitrogen/generated/ios/swift/HybridNativePlatformSpec_cxx.swift +9 -1
- package/nitrogen/generated/ios/swift/Insets.swift +11 -41
- package/nitrogen/generated/ios/swift/Orientation.swift +1 -1
- package/nitrogen/generated/ios/swift/UnistyleDependency.swift +1 -1
- package/nitrogen/generated/ios/swift/UnistylesNativeMiniRuntime.swift +23 -89
- package/nitrogen/generated/shared/c++/ColorScheme.hpp +1 -1
- package/nitrogen/generated/shared/c++/Dimensions.hpp +16 -8
- package/nitrogen/generated/shared/c++/HybridNativePlatformSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridNativePlatformSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesNavigationBarSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesNavigationBarSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesRuntimeSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesRuntimeSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesShadowRegistrySpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesShadowRegistrySpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesStatusBarSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesStatusBarSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/Insets.hpp +25 -17
- package/nitrogen/generated/shared/c++/Orientation.hpp +1 -1
- package/nitrogen/generated/shared/c++/UnistyleDependency.hpp +1 -1
- package/nitrogen/generated/shared/c++/UnistylesCxxMiniRuntime.hpp +52 -44
- package/nitrogen/generated/shared/c++/UnistylesNativeMiniRuntime.hpp +43 -35
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -21,14 +21,14 @@ yarn add react-native-unistyles
|
|
|
21
21
|
Install dependencies:
|
|
22
22
|
|
|
23
23
|
```shell
|
|
24
|
-
yarn add react-native-edge-to-edge react-native-nitro-modules@0.
|
|
24
|
+
yarn add react-native-edge-to-edge react-native-nitro-modules@0.33.2
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
> To avoid unexpected behavior, always use a fixed version of `react-native-nitro-modules`
|
|
28
28
|
|
|
29
29
|
| react-native-unistyles | react-native-nitro-modules |
|
|
30
30
|
|------------------------|----------------------------|
|
|
31
|
-
| 3.0.0 | 0.
|
|
31
|
+
| 3.0.0 | 0.33.2 |
|
|
32
32
|
|
|
33
33
|
Then follow [installation guides](https://unistyl.es/v3/start/getting-started) for your platform.
|
|
34
34
|
|
|
@@ -62,9 +62,6 @@ Then follow [installation guides](https://unistyl.es/v3/start/getting-started) f
|
|
|
62
62
|
<a href="https://github.com/biw">
|
|
63
63
|
<img src="https://avatars.githubusercontent.com/u/6139501?v=4" height="70px" width="70px" alt="biw" />
|
|
64
64
|
</a>
|
|
65
|
-
<a href="https://github.com/happyfloat">
|
|
66
|
-
<img src="https://avatars.githubusercontent.com/u/186333704?s=200&v=4" height="70px" width="70px" alt="happyfloat" />
|
|
67
|
-
</a>
|
|
68
65
|
<a href="https://github.com/ryanlanciaux">
|
|
69
66
|
<img src="https://avatars.githubusercontent.com/u/85041?v=4" height="70px" width="70px" alt="ryanlanciaux" />
|
|
70
67
|
</a>
|
|
@@ -74,16 +71,11 @@ Then follow [installation guides](https://unistyl.es/v3/start/getting-started) f
|
|
|
74
71
|
<a href="https://github.com/kerwanp">
|
|
75
72
|
<img src="https://avatars.githubusercontent.com/u/36955373?v=4" height="70px" width="70px" alt="kerwanp" />
|
|
76
73
|
</a>
|
|
77
|
-
<a href="https://github.com/
|
|
78
|
-
<img src="https://avatars.githubusercontent.com/u/
|
|
79
|
-
</a>
|
|
80
|
-
<a href="https://github.com/oliverloops">
|
|
81
|
-
<img src="https://avatars.githubusercontent.com/u/33361399?v=4" height="70px" width="70px" alt="oliverloops" />
|
|
82
|
-
</a>
|
|
83
|
-
<a href="https://github.com/cargurus-oss-fund">
|
|
84
|
-
<img src="https://avatars.githubusercontent.com/u/108300759?v=4" height="70px" width="70px" alt="cargurus-oss-fund" />
|
|
74
|
+
<a href="https://github.com/andkindness">
|
|
75
|
+
<img src="https://avatars.githubusercontent.com/u/143941782?v=4" height="70px" width="70px" alt="andkindness" />
|
|
85
76
|
</a>
|
|
86
77
|
|
|
78
|
+
|
|
87
79
|
## Past sponsors
|
|
88
80
|
|
|
89
81
|
<a href="https://github.com/kmartinezmedia">
|
|
@@ -143,6 +135,18 @@ Then follow [installation guides](https://unistyl.es/v3/start/getting-started) f
|
|
|
143
135
|
<a href="https://github.com/mwarger">
|
|
144
136
|
<img src="https://avatars.githubusercontent.com/u/686823?v=4" height="60px" width="60px" alt="mwarger" />
|
|
145
137
|
</a>
|
|
138
|
+
<a href="https://github.com/happyfloat">
|
|
139
|
+
<img src="https://avatars.githubusercontent.com/u/186333704?s=200&v=4" height="60px" width="60px" alt="happyfloat" />
|
|
140
|
+
</a>
|
|
141
|
+
<a href="https://github.com/cargurus-oss-fund">
|
|
142
|
+
<img src="https://avatars.githubusercontent.com/u/108300759?v=4" height="60px" width="60px" alt="cargurus-oss-fund" />
|
|
143
|
+
</a>
|
|
144
|
+
<a href="https://github.com/rauchg">
|
|
145
|
+
<img src="https://avatars.githubusercontent.com/u/13041?v=4" height="60px" width="60px" alt="rauchg" />
|
|
146
|
+
</a>
|
|
147
|
+
<a href="https://github.com/oliverloops">
|
|
148
|
+
<img src="https://avatars.githubusercontent.com/u/33361399?v=4" height="60px" width="60px" alt="oliverloops" />
|
|
149
|
+
</a>
|
|
146
150
|
|
|
147
151
|
## Sponsor my work
|
|
148
152
|
|
|
@@ -139,7 +139,7 @@ class NativePlatformInsets(
|
|
|
139
139
|
if (Build.VERSION.SDK_INT >= 30) {
|
|
140
140
|
ViewCompat.setWindowInsetsAnimationCallback(
|
|
141
141
|
mainView,
|
|
142
|
-
object : WindowInsetsAnimationCompat.Callback(
|
|
142
|
+
object : WindowInsetsAnimationCompat.Callback(DISPATCH_MODE_CONTINUE_ON_SUBTREE) {
|
|
143
143
|
override fun onProgress(
|
|
144
144
|
insets: WindowInsetsCompat,
|
|
145
145
|
runningAnimations: List<WindowInsetsAnimationCompat>
|
|
@@ -22,9 +22,13 @@ void shadow::ShadowTreeManager::updateShadowTree(jsi::Runtime& rt) {
|
|
|
22
22
|
for (const auto& [family, props] : updates) {
|
|
23
23
|
tagToProps.insert({family->getTag(), props});
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
auto* mutableFamily = const_cast<ShadowNodeFamily*>(family);
|
|
26
|
+
|
|
27
|
+
if (mutableFamily->nativeProps_DEPRECATED) {
|
|
28
|
+
mutableFamily->nativeProps_DEPRECATED->update(props);
|
|
29
|
+
} else {
|
|
30
|
+
mutableFamily->nativeProps_DEPRECATED = std::make_unique<folly::dynamic>(props);
|
|
31
|
+
}
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
UIManagerBinding::getBinding(rt)->getUIManager().updateShadowTree(std::move(tagToProps));
|
|
@@ -40,8 +44,13 @@ void shadow::ShadowTreeManager::updateShadowTree(jsi::Runtime& rt) {
|
|
|
40
44
|
|
|
41
45
|
for (const auto& [family, props] : updates) {
|
|
42
46
|
// Merge props to fix glitches caused by REA updates
|
|
43
|
-
const_cast<ShadowNodeFamily*>(family)
|
|
44
|
-
|
|
47
|
+
auto* mutableFamily = const_cast<ShadowNodeFamily*>(family);
|
|
48
|
+
|
|
49
|
+
if (mutableFamily->nativeProps_DEPRECATED) {
|
|
50
|
+
mutableFamily->nativeProps_DEPRECATED->update(props);
|
|
51
|
+
} else {
|
|
52
|
+
mutableFamily->nativeProps_DEPRECATED = std::make_unique<folly::dynamic>(props);
|
|
53
|
+
}
|
|
45
54
|
}
|
|
46
55
|
|
|
47
56
|
return std::static_pointer_cast<RootShadowNode>(shadow::ShadowTreeManager::cloneShadowTree(
|
package/ios/Equatable.swift
CHANGED
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
import Foundation
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return lhs.width == rhs.width && lhs.height == rhs.height
|
|
6
|
-
}
|
|
3
|
+
func dimensionsEqual(_ lhs: Dimensions, _ rhs: Dimensions) -> Bool {
|
|
4
|
+
return lhs.width == rhs.width && lhs.height == rhs.height
|
|
7
5
|
}
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return false
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
if (lhs.left != rhs.left || lhs.right != rhs.right) {
|
|
16
|
-
return false
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
return lhs.ime == rhs.ime
|
|
7
|
+
func insetsEqual(_ lhs: Insets, _ rhs: Insets) -> Bool {
|
|
8
|
+
if (lhs.ime != rhs.ime) {
|
|
9
|
+
return false
|
|
20
10
|
}
|
|
11
|
+
|
|
12
|
+
return lhs.top == rhs.top && lhs.bottom == rhs.bottom &&
|
|
13
|
+
lhs.left == rhs.left && lhs.right == rhs.right
|
|
21
14
|
}
|
|
22
15
|
|
|
23
16
|
extension UnistylesNativeMiniRuntime {
|
|
@@ -28,7 +21,7 @@ extension UnistylesNativeMiniRuntime {
|
|
|
28
21
|
dependencies.append(UnistyleDependency.colorscheme)
|
|
29
22
|
}
|
|
30
23
|
|
|
31
|
-
if (lhs.screen
|
|
24
|
+
if !dimensionsEqual(lhs.screen, rhs.screen) {
|
|
32
25
|
dependencies.append(UnistyleDependency.dimensions)
|
|
33
26
|
}
|
|
34
27
|
|
|
@@ -45,7 +38,7 @@ extension UnistylesNativeMiniRuntime {
|
|
|
45
38
|
dependencies.append(UnistyleDependency.contentsizecategory)
|
|
46
39
|
}
|
|
47
40
|
|
|
48
|
-
if (lhs.insets
|
|
41
|
+
if !insetsEqual(lhs.insets, rhs.insets) {
|
|
49
42
|
dependencies.append(UnistyleDependency.insets)
|
|
50
43
|
}
|
|
51
44
|
|
|
@@ -53,7 +46,7 @@ extension UnistylesNativeMiniRuntime {
|
|
|
53
46
|
dependencies.append(UnistyleDependency.fontscale)
|
|
54
47
|
}
|
|
55
48
|
|
|
56
|
-
if (lhs.statusBar
|
|
49
|
+
if !dimensionsEqual(lhs.statusBar, rhs.statusBar) {
|
|
57
50
|
dependencies.append(UnistyleDependency.statusbar)
|
|
58
51
|
}
|
|
59
52
|
|
|
@@ -72,7 +72,29 @@ extension NativeIOSPlatform {
|
|
|
72
72
|
// Interpolate between 'from' and 'to'
|
|
73
73
|
keyboardAnimation.animatedImeInset = keyboardAnimation.from + (keyboardAnimation.to - keyboardAnimation.from) * CGFloat(easedProgress)
|
|
74
74
|
|
|
75
|
-
self.miniRuntime
|
|
75
|
+
guard let current = self.miniRuntime else { return }
|
|
76
|
+
|
|
77
|
+
let newInsets = Insets(
|
|
78
|
+
top: current.insets.top,
|
|
79
|
+
bottom: current.insets.bottom,
|
|
80
|
+
left: current.insets.left,
|
|
81
|
+
right: current.insets.right,
|
|
82
|
+
ime: Double(keyboardAnimation.animatedImeInset)
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
self.miniRuntime = UnistylesNativeMiniRuntime(
|
|
86
|
+
colorScheme: current.colorScheme,
|
|
87
|
+
screen: current.screen,
|
|
88
|
+
contentSizeCategory: current.contentSizeCategory,
|
|
89
|
+
insets: newInsets,
|
|
90
|
+
pixelRatio: current.pixelRatio,
|
|
91
|
+
fontScale: current.fontScale,
|
|
92
|
+
rtl: current.rtl,
|
|
93
|
+
statusBar: current.statusBar,
|
|
94
|
+
navigationBar: current.navigationBar,
|
|
95
|
+
isPortrait: current.isPortrait,
|
|
96
|
+
isLandscape: current.isLandscape
|
|
97
|
+
)
|
|
76
98
|
self.emitImeEvent(updatedMiniRuntime: self.miniRuntime!)
|
|
77
99
|
|
|
78
100
|
if linearProgress >= 1 {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// JColorScheme.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -41,16 +41,15 @@ namespace margelo::nitro::unistyles {
|
|
|
41
41
|
[[maybe_unused]]
|
|
42
42
|
static jni::alias_ref<JColorScheme> fromCpp(ColorScheme value) {
|
|
43
43
|
static const auto clazz = javaClassStatic();
|
|
44
|
-
static const auto fieldDARK = clazz->getStaticField<JColorScheme>("DARK");
|
|
45
|
-
static const auto fieldLIGHT = clazz->getStaticField<JColorScheme>("LIGHT");
|
|
46
|
-
static const auto fieldUNSPECIFIED = clazz->getStaticField<JColorScheme>("UNSPECIFIED");
|
|
47
|
-
|
|
48
44
|
switch (value) {
|
|
49
45
|
case ColorScheme::DARK:
|
|
46
|
+
static const auto fieldDARK = clazz->getStaticField<JColorScheme>("DARK");
|
|
50
47
|
return clazz->getStaticFieldValue(fieldDARK);
|
|
51
48
|
case ColorScheme::LIGHT:
|
|
49
|
+
static const auto fieldLIGHT = clazz->getStaticField<JColorScheme>("LIGHT");
|
|
52
50
|
return clazz->getStaticFieldValue(fieldLIGHT);
|
|
53
51
|
case ColorScheme::UNSPECIFIED:
|
|
52
|
+
static const auto fieldUNSPECIFIED = clazz->getStaticField<JColorScheme>("UNSPECIFIED");
|
|
54
53
|
return clazz->getStaticFieldValue(fieldUNSPECIFIED);
|
|
55
54
|
default:
|
|
56
55
|
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// JFunc_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// JHybridNativePlatformSpec.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#include "JHybridNativePlatformSpec.hpp"
|
|
@@ -56,6 +56,13 @@ namespace margelo::nitro::unistyles {
|
|
|
56
56
|
return method(_javaPart);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
bool JHybridNativePlatformSpec::equals(const std::shared_ptr<HybridObject>& other) {
|
|
60
|
+
if (auto otherCast = std::dynamic_pointer_cast<JHybridNativePlatformSpec>(other)) {
|
|
61
|
+
return _javaPart == otherCast->_javaPart;
|
|
62
|
+
}
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
|
|
59
66
|
void JHybridNativePlatformSpec::dispose() noexcept {
|
|
60
67
|
static const auto method = javaClassStatic()->getMethod<void()>("dispose");
|
|
61
68
|
method(_javaPart);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridNativePlatformSpec.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -40,6 +40,7 @@ namespace margelo::nitro::unistyles {
|
|
|
40
40
|
|
|
41
41
|
public:
|
|
42
42
|
size_t getExternalMemorySize() noexcept override;
|
|
43
|
+
bool equals(const std::shared_ptr<HybridObject>& other) override;
|
|
43
44
|
void dispose() noexcept override;
|
|
44
45
|
std::string toString() override;
|
|
45
46
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// JOrientation.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -41,13 +41,12 @@ namespace margelo::nitro::unistyles {
|
|
|
41
41
|
[[maybe_unused]]
|
|
42
42
|
static jni::alias_ref<JOrientation> fromCpp(Orientation value) {
|
|
43
43
|
static const auto clazz = javaClassStatic();
|
|
44
|
-
static const auto fieldPORTRAIT = clazz->getStaticField<JOrientation>("PORTRAIT");
|
|
45
|
-
static const auto fieldLANDSCAPE = clazz->getStaticField<JOrientation>("LANDSCAPE");
|
|
46
|
-
|
|
47
44
|
switch (value) {
|
|
48
45
|
case Orientation::PORTRAIT:
|
|
46
|
+
static const auto fieldPORTRAIT = clazz->getStaticField<JOrientation>("PORTRAIT");
|
|
49
47
|
return clazz->getStaticFieldValue(fieldPORTRAIT);
|
|
50
48
|
case Orientation::LANDSCAPE:
|
|
49
|
+
static const auto fieldLANDSCAPE = clazz->getStaticField<JOrientation>("LANDSCAPE");
|
|
51
50
|
return clazz->getStaticFieldValue(fieldLANDSCAPE);
|
|
52
51
|
default:
|
|
53
52
|
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// JUnistyleDependency.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -41,55 +41,54 @@ namespace margelo::nitro::unistyles {
|
|
|
41
41
|
[[maybe_unused]]
|
|
42
42
|
static jni::alias_ref<JUnistyleDependency> fromCpp(UnistyleDependency value) {
|
|
43
43
|
static const auto clazz = javaClassStatic();
|
|
44
|
-
static const auto fieldTHEME = clazz->getStaticField<JUnistyleDependency>("THEME");
|
|
45
|
-
static const auto fieldTHEMENAME = clazz->getStaticField<JUnistyleDependency>("THEMENAME");
|
|
46
|
-
static const auto fieldADAPTIVETHEMES = clazz->getStaticField<JUnistyleDependency>("ADAPTIVETHEMES");
|
|
47
|
-
static const auto fieldBREAKPOINTS = clazz->getStaticField<JUnistyleDependency>("BREAKPOINTS");
|
|
48
|
-
static const auto fieldVARIANTS = clazz->getStaticField<JUnistyleDependency>("VARIANTS");
|
|
49
|
-
static const auto fieldCOLORSCHEME = clazz->getStaticField<JUnistyleDependency>("COLORSCHEME");
|
|
50
|
-
static const auto fieldDIMENSIONS = clazz->getStaticField<JUnistyleDependency>("DIMENSIONS");
|
|
51
|
-
static const auto fieldORIENTATION = clazz->getStaticField<JUnistyleDependency>("ORIENTATION");
|
|
52
|
-
static const auto fieldCONTENTSIZECATEGORY = clazz->getStaticField<JUnistyleDependency>("CONTENTSIZECATEGORY");
|
|
53
|
-
static const auto fieldINSETS = clazz->getStaticField<JUnistyleDependency>("INSETS");
|
|
54
|
-
static const auto fieldPIXELRATIO = clazz->getStaticField<JUnistyleDependency>("PIXELRATIO");
|
|
55
|
-
static const auto fieldFONTSCALE = clazz->getStaticField<JUnistyleDependency>("FONTSCALE");
|
|
56
|
-
static const auto fieldSTATUSBAR = clazz->getStaticField<JUnistyleDependency>("STATUSBAR");
|
|
57
|
-
static const auto fieldNAVIGATIONBAR = clazz->getStaticField<JUnistyleDependency>("NAVIGATIONBAR");
|
|
58
|
-
static const auto fieldIME = clazz->getStaticField<JUnistyleDependency>("IME");
|
|
59
|
-
static const auto fieldRTL = clazz->getStaticField<JUnistyleDependency>("RTL");
|
|
60
|
-
|
|
61
44
|
switch (value) {
|
|
62
45
|
case UnistyleDependency::THEME:
|
|
46
|
+
static const auto fieldTHEME = clazz->getStaticField<JUnistyleDependency>("THEME");
|
|
63
47
|
return clazz->getStaticFieldValue(fieldTHEME);
|
|
64
48
|
case UnistyleDependency::THEMENAME:
|
|
49
|
+
static const auto fieldTHEMENAME = clazz->getStaticField<JUnistyleDependency>("THEMENAME");
|
|
65
50
|
return clazz->getStaticFieldValue(fieldTHEMENAME);
|
|
66
51
|
case UnistyleDependency::ADAPTIVETHEMES:
|
|
52
|
+
static const auto fieldADAPTIVETHEMES = clazz->getStaticField<JUnistyleDependency>("ADAPTIVETHEMES");
|
|
67
53
|
return clazz->getStaticFieldValue(fieldADAPTIVETHEMES);
|
|
68
54
|
case UnistyleDependency::BREAKPOINTS:
|
|
55
|
+
static const auto fieldBREAKPOINTS = clazz->getStaticField<JUnistyleDependency>("BREAKPOINTS");
|
|
69
56
|
return clazz->getStaticFieldValue(fieldBREAKPOINTS);
|
|
70
57
|
case UnistyleDependency::VARIANTS:
|
|
58
|
+
static const auto fieldVARIANTS = clazz->getStaticField<JUnistyleDependency>("VARIANTS");
|
|
71
59
|
return clazz->getStaticFieldValue(fieldVARIANTS);
|
|
72
60
|
case UnistyleDependency::COLORSCHEME:
|
|
61
|
+
static const auto fieldCOLORSCHEME = clazz->getStaticField<JUnistyleDependency>("COLORSCHEME");
|
|
73
62
|
return clazz->getStaticFieldValue(fieldCOLORSCHEME);
|
|
74
63
|
case UnistyleDependency::DIMENSIONS:
|
|
64
|
+
static const auto fieldDIMENSIONS = clazz->getStaticField<JUnistyleDependency>("DIMENSIONS");
|
|
75
65
|
return clazz->getStaticFieldValue(fieldDIMENSIONS);
|
|
76
66
|
case UnistyleDependency::ORIENTATION:
|
|
67
|
+
static const auto fieldORIENTATION = clazz->getStaticField<JUnistyleDependency>("ORIENTATION");
|
|
77
68
|
return clazz->getStaticFieldValue(fieldORIENTATION);
|
|
78
69
|
case UnistyleDependency::CONTENTSIZECATEGORY:
|
|
70
|
+
static const auto fieldCONTENTSIZECATEGORY = clazz->getStaticField<JUnistyleDependency>("CONTENTSIZECATEGORY");
|
|
79
71
|
return clazz->getStaticFieldValue(fieldCONTENTSIZECATEGORY);
|
|
80
72
|
case UnistyleDependency::INSETS:
|
|
73
|
+
static const auto fieldINSETS = clazz->getStaticField<JUnistyleDependency>("INSETS");
|
|
81
74
|
return clazz->getStaticFieldValue(fieldINSETS);
|
|
82
75
|
case UnistyleDependency::PIXELRATIO:
|
|
76
|
+
static const auto fieldPIXELRATIO = clazz->getStaticField<JUnistyleDependency>("PIXELRATIO");
|
|
83
77
|
return clazz->getStaticFieldValue(fieldPIXELRATIO);
|
|
84
78
|
case UnistyleDependency::FONTSCALE:
|
|
79
|
+
static const auto fieldFONTSCALE = clazz->getStaticField<JUnistyleDependency>("FONTSCALE");
|
|
85
80
|
return clazz->getStaticFieldValue(fieldFONTSCALE);
|
|
86
81
|
case UnistyleDependency::STATUSBAR:
|
|
82
|
+
static const auto fieldSTATUSBAR = clazz->getStaticField<JUnistyleDependency>("STATUSBAR");
|
|
87
83
|
return clazz->getStaticFieldValue(fieldSTATUSBAR);
|
|
88
84
|
case UnistyleDependency::NAVIGATIONBAR:
|
|
85
|
+
static const auto fieldNAVIGATIONBAR = clazz->getStaticField<JUnistyleDependency>("NAVIGATIONBAR");
|
|
89
86
|
return clazz->getStaticFieldValue(fieldNAVIGATIONBAR);
|
|
90
87
|
case UnistyleDependency::IME:
|
|
88
|
+
static const auto fieldIME = clazz->getStaticField<JUnistyleDependency>("IME");
|
|
91
89
|
return clazz->getStaticFieldValue(fieldIME);
|
|
92
90
|
case UnistyleDependency::RTL:
|
|
91
|
+
static const auto fieldRTL = clazz->getStaticField<JUnistyleDependency>("RTL");
|
|
93
92
|
return clazz->getStaticFieldValue(fieldRTL);
|
|
94
93
|
default:
|
|
95
94
|
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// ColorScheme.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
package com.margelo.nitro.unistyles
|
|
@@ -19,4 +19,6 @@ enum class ColorScheme(@DoNotStrip @Keep val value: Int) {
|
|
|
19
19
|
DARK(0),
|
|
20
20
|
LIGHT(1),
|
|
21
21
|
UNSPECIFIED(2);
|
|
22
|
+
|
|
23
|
+
companion object
|
|
22
24
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// Dimensions.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
package com.margelo.nitro.unistyles
|
|
@@ -26,7 +26,7 @@ data class Dimensions(
|
|
|
26
26
|
) {
|
|
27
27
|
/* primary constructor */
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
companion object {
|
|
30
30
|
/**
|
|
31
31
|
* Constructor called from C++
|
|
32
32
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// Func_void_UnistylesNativeMiniRuntime.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
package com.margelo.nitro.unistyles
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
package com.margelo.nitro.unistyles
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/HybridNativePlatformSpec.kt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridNativePlatformSpec.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
package com.margelo.nitro.unistyles
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// Insets.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
package com.margelo.nitro.unistyles
|
|
@@ -35,7 +35,7 @@ data class Insets(
|
|
|
35
35
|
) {
|
|
36
36
|
/* primary constructor */
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
companion object {
|
|
39
39
|
/**
|
|
40
40
|
* Constructor called from C++
|
|
41
41
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// Orientation.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
package com.margelo.nitro.unistyles
|
|
@@ -18,4 +18,6 @@ import com.facebook.proguard.annotations.DoNotStrip
|
|
|
18
18
|
enum class Orientation(@DoNotStrip @Keep val value: Int) {
|
|
19
19
|
PORTRAIT(0),
|
|
20
20
|
LANDSCAPE(1);
|
|
21
|
+
|
|
22
|
+
companion object
|
|
21
23
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// UnistyleDependency.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
package com.margelo.nitro.unistyles
|
|
@@ -32,4 +32,6 @@ enum class UnistyleDependency(@DoNotStrip @Keep val value: Int) {
|
|
|
32
32
|
NAVIGATIONBAR(13),
|
|
33
33
|
IME(14),
|
|
34
34
|
RTL(15);
|
|
35
|
+
|
|
36
|
+
companion object
|
|
35
37
|
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/UnistylesNativeMiniRuntime.kt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// UnistylesNativeMiniRuntime.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
package com.margelo.nitro.unistyles
|
|
@@ -53,7 +53,7 @@ data class UnistylesNativeMiniRuntime(
|
|
|
53
53
|
) {
|
|
54
54
|
/* primary constructor */
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
companion object {
|
|
57
57
|
/**
|
|
58
58
|
* Constructor called from C++
|
|
59
59
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# unistyles+autolinking.cmake
|
|
3
3
|
# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
# https://github.com/mrousavy/nitro
|
|
5
|
-
# Copyright ©
|
|
5
|
+
# Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
#
|
|
7
7
|
|
|
8
8
|
# This is a CMake file that adds all files generated by Nitrogen
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// unistyles+autolinking.gradle
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
/// This is a Gradle file that adds all files generated by Nitrogen
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// unistylesOnLoad.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#ifndef BUILDING_UNISTYLES_WITH_GENERATED_CMAKE_PROJECT
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Unistyles+autolinking.rb
|
|
3
3
|
# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
# https://github.com/mrousavy/nitro
|
|
5
|
-
# Copyright ©
|
|
5
|
+
# Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
#
|
|
7
7
|
|
|
8
8
|
# This is a Ruby script that adds all files generated by Nitrogen
|
|
@@ -52,7 +52,7 @@ def add_nitrogen_files(spec)
|
|
|
52
52
|
spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({
|
|
53
53
|
# Use C++ 20
|
|
54
54
|
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
|
55
|
-
# Enables C++ <-> Swift interop (by default it's only
|
|
55
|
+
# Enables C++ <-> Swift interop (by default it's only ObjC)
|
|
56
56
|
"SWIFT_OBJC_INTEROP_MODE" => "objcxx",
|
|
57
57
|
# Enables stricter modular headers
|
|
58
58
|
"DEFINES_MODULE" => "YES",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// Unistyles-Swift-Cxx-Bridge.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#include "Unistyles-Swift-Cxx-Bridge.hpp"
|