react-native-unistyles 2.0.0-beta.6 → 2.0.0-beta.7
Sign up to get free protection for your applications and to get access to all the features.
package/android/build.gradle
CHANGED
@@ -22,11 +22,20 @@ def resolveBuildType() {
|
|
22
22
|
return tskReqStr.contains('Release') ? 'release' : 'debug'
|
23
23
|
}
|
24
24
|
|
25
|
+
def isNewArchitectureEnabled() {
|
26
|
+
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
|
27
|
+
}
|
28
|
+
|
29
|
+
if (isNewArchitectureEnabled()) {
|
30
|
+
apply plugin: 'com.facebook.react'
|
31
|
+
}
|
32
|
+
|
25
33
|
android {
|
26
34
|
compileSdkVersion safeExtGet('compileSdkVersion', 33)
|
27
35
|
namespace "com.unistyles"
|
28
36
|
|
29
37
|
defaultConfig {
|
38
|
+
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
30
39
|
minSdkVersion safeExtGet('minSdkVersion', 21)
|
31
40
|
externalNativeBuild {
|
32
41
|
cmake {
|
@@ -80,16 +80,20 @@ class UnistylesModule(reactContext: ReactApplicationContext) : ReactContextBaseJ
|
|
80
80
|
System.loadLibrary("unistyles")
|
81
81
|
val config = this.getConfig()
|
82
82
|
|
83
|
-
this.
|
84
|
-
this.
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
83
|
+
this.reactApplicationContext.javaScriptContextHolder?.let {
|
84
|
+
this.nativeInstall(
|
85
|
+
it.get(),
|
86
|
+
config["width"] as Int,
|
87
|
+
config["height"] as Int,
|
88
|
+
config["colorScheme"] as String
|
89
|
+
)
|
89
90
|
|
90
|
-
|
91
|
+
Log.i(NAME, "Installed Unistyles \uD83E\uDD84!")
|
91
92
|
|
92
|
-
|
93
|
+
return true
|
94
|
+
}
|
95
|
+
|
96
|
+
false
|
93
97
|
} catch (e: Exception) {
|
94
98
|
false
|
95
99
|
}
|
package/package.json
CHANGED