Skip to content

Commit

Permalink
refactor: replace deprecated processTransform (#2554)
Browse files Browse the repository at this point in the history
# Summary

Replace deprecated `TransformHelper.processTransform` with a new
function that also gets `transformOrigin`.

## Test Plan

Transforms should function properly, and this error should not occur
during the build process:
```
> Task :react-native-svg:compileDebugJavaWithJavac
/react-native-svg/apps/paper-example/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/RenderableViewManager.java:390: warning: [removal] processTransform(ReadableArray,double[]) in TransformHelper has been deprecated and marked for removal
    TransformHelper.processTransform(transforms, sTransformDecompositionArray);
                   ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning
```

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| Android |    ✅      |
  • Loading branch information
jakex7 authored Nov 28, 2024
1 parent c617dec commit 2dcc832
Show file tree
Hide file tree
Showing 3 changed files with 1,762 additions and 6 deletions.
14 changes: 8 additions & 6 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,18 @@ android {
]
}

if (getReactNativeMinorVersion() >= 75) { // borderRadius fix https://github.com/software-mansion/react-native-svg/pull/2415
// Use for react-native@0.75 and above
if (getReactNativeMinorVersion() >= 75) { // Use for react-native@0.75 and above
// borderRadius fix https://github.com/software-mansion/react-native-svg/pull/2415
srcDirs += "src/SvgViewManager75/java"
} else {
// Maintain compatibility with react-native@0.73 and react-native@0.74
// processTransform replacement https://github.com/software-mansion/react-native-svg/pull/2554
srcDirs += "src/RenderableViewManager75/java"
} else { // Maintain compatibility with react-native@0.73 and react-native@0.74
srcDirs += "src/SvgViewManager73/java"
srcDirs += "src/RenderableViewManager73/java"
}

if (getReactNativeMinorVersion() >= 74) { // new API https://github.com/software-mansion/react-native-svg/pull/2541
// Use for react-native@0.74 and above
if (getReactNativeMinorVersion() >= 74) { // Use for react-native@0.74 and above
// new API https://github.com/software-mansion/react-native-svg/pull/2541
srcDirs += "src/SvgPackage74/java"
} else {
// Maintain compatibility with react-native@0.73
Expand Down
Loading

0 comments on commit 2dcc832

Please sign in to comment.