Skip to content

Commit 972330a

Browse files
Truitt JanneyTruitt Janney
authored andcommitted
removed old arch files, updated readme
1 parent edcf580 commit 972330a

File tree

5 files changed

+22
-67
lines changed

5 files changed

+22
-67
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ A React Native component for drawing by touching on both iOS and Android, with T
1010

1111
## Features
1212

13-
- Supports New Architecture
13+
- Supports New Architecture only
1414
- Support iOS and Android
1515
- Full TypeScript support
1616
- Stroke thickness and color are changeable while drawing
@@ -28,6 +28,15 @@ A React Native component for drawing by touching on both iOS and Android, with T
2828
- Initial paths loading with native batch processing for optimal performance
2929
- Real-time path loading feedback with onInitialPathsLoaded callback
3030

31+
## Compatibility
32+
33+
| Sketch Canvas Version | React Native Version | New Architecture Support | Old Architecture Support |
34+
|-----------------------|----------------------|--------------------------|--------------------------|
35+
| 2.4.0 and above | 0.76.7 and above | Yes | No |
36+
| 2.3.x and below | 0.76.6 and below | Yes | Yes |
37+
38+
> **Note**: Starting from version 2.4.0, this library only supports React Native's New Architecture. For projects still using the old architecture, please use version 2.3.x or below.
39+
3140
## Installation
3241

3342
---

android/build.gradle

Lines changed: 11 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,9 @@ def reactNativeArchitectures() {
1919
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
2020
}
2121

22-
def isNewArchitectureEnabled() {
23-
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
24-
}
25-
2622
apply plugin: "com.android.library"
2723
apply plugin: "kotlin-android"
28-
29-
if (isNewArchitectureEnabled()) {
30-
apply plugin: "com.facebook.react"
31-
}
24+
apply plugin: "com.facebook.react"
3225

3326
def getExtOrDefault(name) {
3427
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["RNTSketchCanvas_" + name]
@@ -38,32 +31,15 @@ def getExtOrIntegerDefault(name) {
3831
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["RNTSketchCanvas_" + name]).toInteger()
3932
}
4033

41-
def supportsNamespace() {
42-
def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
43-
def major = parsed[0].toInteger()
44-
def minor = parsed[1].toInteger()
45-
46-
// Namespace support was added in 7.3.0
47-
return (major == 7 && minor >= 3) || major >= 8
48-
}
49-
5034
android {
51-
if (supportsNamespace()) {
52-
namespace "com.sourcetoad.reactnativesketchcanvas"
53-
54-
sourceSets {
55-
main {
56-
manifest.srcFile "src/main/AndroidManifestNew.xml"
57-
}
58-
}
59-
}
35+
namespace "com.sourcetoad.reactnativesketchcanvas"
6036

6137
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
6238

6339
defaultConfig {
6440
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
6541
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
66-
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
42+
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", "true"
6743

6844
}
6945

@@ -88,12 +64,10 @@ android {
8864

8965
sourceSets {
9066
main {
91-
if (isNewArchitectureEnabled()) {
92-
java.srcDirs += [
93-
"generated/java",
94-
"generated/jni"
95-
]
96-
}
67+
java.srcDirs += [
68+
"generated/java",
69+
"generated/jni"
70+
]
9771
}
9872
}
9973
}
@@ -114,10 +88,8 @@ dependencies {
11488
implementation 'androidx.exifinterface:exifinterface:1.3.6'
11589
}
11690

117-
if (isNewArchitectureEnabled()) {
118-
react {
119-
jsRootDir = file("../src/")
120-
libraryName = "RNTSketchCanvasView"
121-
codegenJavaPackageName = "com.sourcetoad.reactnativesketchcanvas"
122-
}
91+
react {
92+
jsRootDir = file("../src/")
93+
libraryName = "RNTSketchCanvasView"
94+
codegenJavaPackageName = "com.sourcetoad.reactnativesketchcanvas"
12395
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.sourcetoad.reactnativesketchcanvas">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
32
</manifest>

android/src/main/AndroidManifestNew.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

ios/RNSketchCanvasViewManager.mm

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)